diff options
author | Darrell Anderson <[email protected]> | 2013-01-14 14:47:37 -0600 |
---|---|---|
committer | Darrell Anderson <[email protected]> | 2013-01-14 14:47:37 -0600 |
commit | 577ad042c85beec9b04041e4565eac34db57abb0 (patch) | |
tree | 883aec53aaca3a48eb1df642a196c193933a77f8 | |
parent | 35202ed0d899a9ff3c77dad72b501fb30e4dcf93 (diff) | |
parent | b85cdabf4805af35799b141cb3dd6deb411b9b47 (diff) | |
download | qt3-577ad042c85beec9b04041e4565eac34db57abb0.tar.gz qt3-577ad042c85beec9b04041e4565eac34db57abb0.zip |
Merge branch 'master' of http://scm.trinitydesktop.org/scm/git/qt3
-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 c2c0288..2875228 100644 --- a/src/kernel/qapplication_x11.cpp +++ b/src/kernel/qapplication_x11.cpp @@ -3472,13 +3472,26 @@ int QApplication::x11ProcessEvent( XEvent* event ) // update the size for desktop widget int scr = XRRRootToScreen( appDpy, event->xany.window ); QWidget *w = desktop()->screen( scr ); - QSize oldSize( w->size() ); - w->crect.setWidth( DisplayWidth( appDpy, scr ) ); - w->crect.setHeight( DisplayHeight( appDpy, scr ) ); - if ( w->size() != oldSize ) { - QResizeEvent e( w->size(), oldSize ); - QApplication::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)) { + QSize oldSize( w->size() ); + w->crect.setWidth( DisplayWidth( appDpy, scr ) ); + w->crect.setHeight( DisplayHeight( appDpy, scr ) ); + if ( w->size() != oldSize ) { + QResizeEvent e( w->size(), oldSize ); + QApplication::sendEvent( w, &e ); + emit desktop()->resized( scr ); + } + } } } #endif // QT_NO_XRANDR |