summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-01-12 19:30:50 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-01-12 19:30:50 -0600
commitcae29925399133e2c0991071708d8689d8b98be9 (patch)
treef8dc9894da4d5527c45106b4f6404e7dd1fa9288
parente8cbbedf46da493d2c206444a7e18e5777402905 (diff)
downloadtqt3-cae29925399133e2c0991071708d8689d8b98be9.tar.gz
tqt3-cae29925399133e2c0991071708d8689d8b98be9.zip
Automated update from Qt3
-rw-r--r--src/kernel/qapplication_x11.cpp27
1 files changed, 20 insertions, 7 deletions
diff --git a/src/kernel/qapplication_x11.cpp b/src/kernel/qapplication_x11.cpp
index 8602b562..68eaa904 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