mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-24 13:50:49 +03:00
0030619: Draw Harness, ViewerTest - add continuous rendering option to vrepaint command
Aspect_Window::InvalidateContent() - added new virtual method for invalidating window content using platform-specific API. TKDraw, tkLoop() on Window platform has been changed so that to prevent continuous input window events blocking terminal input (e.g. in case if processing events is not fast enough or if another continuously sends new events). TKViewerTest, on X11 platform has been fixed a message processing so that to avoid messages being not processed. Added aggregation of Exposer and ConfigureNotify events. Fixed aggregation MotionNotify events.
This commit is contained in:
@@ -482,4 +482,26 @@ void Xw_Window::Size (Standard_Integer& theWidth,
|
||||
theHeight = aWinAttr.height;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : InvalidateContent
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void Xw_Window::InvalidateContent (const Handle(Aspect_DisplayConnection)& theDisp)
|
||||
{
|
||||
if (myXWindow == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const Handle(Aspect_DisplayConnection)& aDisp = !theDisp.IsNull() ? theDisp : myDisplay;
|
||||
Display* aDispX = aDisp->GetDisplay();
|
||||
|
||||
XEvent anEvent;
|
||||
memset (&anEvent, 0, sizeof(anEvent));
|
||||
anEvent.type = Expose;
|
||||
anEvent.xexpose.window = myXWindow;
|
||||
XSendEvent (aDispX, myXWindow, False, ExposureMask, &anEvent);
|
||||
XFlush (aDispX);
|
||||
}
|
||||
|
||||
#endif // Win32 or Mac OS X
|
||||
|
@@ -111,6 +111,13 @@ public:
|
||||
return myFBConfig;
|
||||
}
|
||||
|
||||
//! Invalidate entire window content through generation of Expose event.
|
||||
//! This method does not aggregate multiple calls into single event - dedicated event will be sent on each call.
|
||||
//! When NULL display connection is specified, the connection specified on window creation will be used.
|
||||
//! Sending exposure messages from non-window thread would require dedicated display connection opened specifically
|
||||
//! for this working thread to avoid race conditions, since Xlib display connection is not thread-safe by default.
|
||||
Standard_EXPORT virtual void InvalidateContent (const Handle(Aspect_DisplayConnection)& theDisp) Standard_OVERRIDE;
|
||||
|
||||
protected:
|
||||
|
||||
Handle(Aspect_DisplayConnection) myDisplay; //!< X Display connection
|
||||
|
Reference in New Issue
Block a user