From 40fd093fb1926492380aa8e9f1c89d2b30741639 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 27 May 2011 16:04:18 +0000 Subject: [PATCH] Reverted part of revision r12294 that introduced threading related problems under X11 due to checking the _display Display member variable assigned to the graphics thread from the main thread. --- src/osgViewer/GraphicsWindowX11.cpp | 42 +++++++++++++---------------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/src/osgViewer/GraphicsWindowX11.cpp b/src/osgViewer/GraphicsWindowX11.cpp index c560b319a..f93c2caa0 100644 --- a/src/osgViewer/GraphicsWindowX11.cpp +++ b/src/osgViewer/GraphicsWindowX11.cpp @@ -1090,6 +1090,25 @@ void GraphicsWindowX11::swapBuffersImplementation() #endif glXSwapBuffers( _display, _window ); #endif + + + while( XPending(_display) ) + { + XEvent ev; + XNextEvent( _display, &ev ); + + switch( ev.type ) + { + case ClientMessage: + { + if (static_cast(ev.xclient.data.l[0]) == _deleteWindow) + { + OSG_INFO<<"DeleteWindow event received"<closeWindow(); + } + } + } + } } void GraphicsWindowX11::checkEvents() @@ -1461,29 +1480,6 @@ void GraphicsWindowX11::checkEvents() } } - - // - // process events of _display - // - while( XPending(_display) ) - { - XEvent ev; - XNextEvent( _display, &ev ); - - switch( ev.type ) - { - case ClientMessage: - { - if (static_cast(ev.xclient.data.l[0]) == _deleteWindow) - { - OSG_INFO<<"DeleteWindow event received"<closeWindow(); - } - break; - } - } - } - #if 0 if (destroyWindowRequested) {