summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-05-24 00:53:55 -0500
committerSlávek Banko <slavek.banko@axis.cz>2012-06-02 20:32:32 +0200
commit34681cac0d27ecfacb1d8832deb3891afa963204 (patch)
tree0be0314f7c4bea681d3134f2ca580085641543a6
parent55af72cf2c4b7190d90396aa1b6c9a69c1b1e36a (diff)
downloadqt3-34681cac0d27ecfacb1d8832deb3891afa963204.tar.gz
qt3-34681cac0d27ecfacb1d8832deb3891afa963204.zip
Fix xrandr resize event failing on some systems
(cherry picked from commit 6ff026570df6bf0d2988e5e94465fc8d19ef2133)
-rw-r--r--src/kernel/qapplication_x11.cpp41
1 files changed, 21 insertions, 20 deletions
diff --git a/src/kernel/qapplication_x11.cpp b/src/kernel/qapplication_x11.cpp
index c2bb456..4cb71a5 100644
--- a/src/kernel/qapplication_x11.cpp
+++ b/src/kernel/qapplication_x11.cpp
@@ -3436,6 +3436,27 @@ int QApplication::x11ProcessEvent( XEvent* event )
return 0;
}
+#ifndef QT_NO_XRANDR
+ // XRandR doesn't care if Qt doesn't know about the widget, so handle XRandR stuff before the !widget check below
+ if (event->type == xrandr_eventbase + RRScreenChangeNotify
+ || ( event->type == ConfigureNotify && event->xconfigure.window == QPaintDevice::x11AppRootWindow())) {
+ // update Xlib internals with the latest screen configuration
+ XRRUpdateConfiguration(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 );
+ }
+ }
+#endif // QT_NO_XRANDR
+
if ( !widget ) { // don't know this windows
QWidget* popup = QApplication::activePopupWidget();
if ( popup ) {
@@ -3486,26 +3507,6 @@ int QApplication::x11ProcessEvent( XEvent* event )
}
#endif
-#ifndef QT_NO_XRANDR
- if (event->type == xrandr_eventbase + RRScreenChangeNotify
- || ( event->type == ConfigureNotify && event->xconfigure.window == QPaintDevice::x11AppRootWindow())) {
- // update Xlib internals with the latest screen configuration
- XRRUpdateConfiguration(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 );
- }
- }
-#endif // QT_NO_XRANDR
-
switch ( event->type ) {
case ButtonRelease: // mouse event