diff options
author | Darrell Anderson <[email protected]> | 2013-01-14 14:51:19 -0600 |
---|---|---|
committer | Darrell Anderson <[email protected]> | 2013-01-14 14:51:19 -0600 |
commit | 67196343e4fac61834c980d6ccd4d9b661e781b6 (patch) | |
tree | 45ac953d2594dbdbfa82a5f94c477e54e60f2d3d | |
parent | f8224f3a623495e4e1dbf852554d7601a6b7c4c4 (diff) | |
parent | cae29925399133e2c0991071708d8689d8b98be9 (diff) | |
download | tqt3-67196343e4fac61834c980d6ccd4d9b661e781b6.tar.gz tqt3-67196343e4fac61834c980d6ccd4d9b661e781b6.zip |
Merge branch 'master' of http://scm.trinitydesktop.org/scm/git/tqt3
-rw-r--r-- | src/kernel/qapplication_x11.cpp | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/src/kernel/qapplication_x11.cpp b/src/kernel/qapplication_x11.cpp index 8602b5625..68eaa904e 100644 --- a/src/kernel/qapplication_x11.cpp +++ b/src/kernel/qapplication_x11.cpp @@ -3472,13 +3472,26 @@ int TQApplication::x11ProcessEvent( XEvent* event ) // update the size for desktop widget int scr = XRRRootToScreen( appDpy, event->xany.window ); TQWidget *w = desktop()->screen( scr ); - TQSize oldSize( w->size() ); - w->crect.setWidth( DisplayWidth( appDpy, scr ) ); - w->crect.setHeight( DisplayHeight( appDpy, scr ) ); - if ( w->size() != oldSize ) { - TQResizeEvent e( w->size(), oldSize ); - TQApplication::sendEvent( w, &e ); - emit desktop()->resized( scr ); + + if (w) { + int widgetScr = -1; + // make sure the specified widget is on the same screen that received the XRandR event + XWindowAttributes widgetAttr; + XGetWindowAttributes(appDpy, w->winId(), &widgetAttr); + if (widgetAttr.screen) { + widgetScr = XScreenNumberOfScreen(widgetAttr.screen); + } + + if ((widgetScr < 0) || (widgetScr == scr)) { + TQSize oldSize( w->size() ); + w->crect.setWidth( DisplayWidth( appDpy, scr ) ); + w->crect.setHeight( DisplayHeight( appDpy, scr ) ); + if ( w->size() != oldSize ) { + TQResizeEvent e( w->size(), oldSize ); + TQApplication::sendEvent( w, &e ); + emit desktop()->resized( scr ); + } + } } } #endif // QT_NO_XRANDR |