[qt] Buttons in Qt applications not clickable when run under gnome-shell (#742658, QTBUG-21900)

Rex Dieter rdieter at fedoraproject.org
Tue Oct 18 12:27:42 UTC 2011


commit 95b646ad34fd1317c5f0b3f57ec25b781f945dd1
Author: Rex Dieter <rdieter at fedoraproject.org>
Date:   Tue Oct 18 07:35:04 2011 -0500

    Buttons in Qt applications not clickable when run under gnome-shell (#742658, QTBUG-21900)

 ...erywhere-opensource-src-4.8.0-QTBUG-21900.patch |  101 ++++++++++++++++++++
 qt.spec                                            |    9 ++-
 2 files changed, 109 insertions(+), 1 deletions(-)
---
diff --git a/qt-everywhere-opensource-src-4.8.0-QTBUG-21900.patch b/qt-everywhere-opensource-src-4.8.0-QTBUG-21900.patch
new file mode 100644
index 0000000..29fc82e
--- /dev/null
+++ b/qt-everywhere-opensource-src-4.8.0-QTBUG-21900.patch
@@ -0,0 +1,101 @@
+From a91e9dd202640598d8dec091c67ec94536390e7f Mon Sep 17 00:00:00 2001
+From: "Owen W. Taylor" <otaylor at fishsoup.net>
+Date: Mon, 17 Oct 2011 17:27:43 -0400
+Subject: [PATCH] Fix logic for figuring out what ConfigureNotify positions
+ can be trusted
+
+When reading ahead in the queue for ConfigureNotify events, it's necessary
+to look for intermediate ReparentNotify events as well, since they will
+determine whether the position in the event can be trusted or not.
+---
+ src/gui/kernel/qapplication_x11.cpp |   47 ++++++++++++++++++++++++++++++----
+ 1 files changed, 41 insertions(+), 6 deletions(-)
+
+diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp
+index 408e9ac..3a1d3eb 100644
+--- a/src/gui/kernel/qapplication_x11.cpp
++++ b/src/gui/kernel/qapplication_x11.cpp
+@@ -816,6 +816,27 @@ static Bool qt_sync_request_scanner(Display*, XEvent *event, XPointer arg)
+ #endif
+ #endif // QT_NO_XSYNC
+ 
++struct qt_configure_event_data
++{
++    WId window;
++    WId parent;
++};
++
++static Bool qt_configure_event_scanner(Display*, XEvent *event, XPointer arg)
++{
++    qt_configure_event_data *data =
++        reinterpret_cast<qt_configure_event_data*>(arg);
++    if (event->type == ConfigureNotify &&
++        event->xconfigure.window == data->window) {
++        return true;
++    } else if (event->type == ReparentNotify &&
++               event->xreparent.window == data->window) {
++        data->parent = event->xreparent.parent;
++    }
++
++    return false;
++}
++
+ static void qt_x11_create_intern_atoms()
+ {
+     const char *names[QX11Data::NAtoms];
+@@ -5273,8 +5294,11 @@ bool QETWidget::translateConfigEvent(const XEvent *event)
+         if (d->extra->compress_events) {
+             // ConfigureNotify compression for faster opaque resizing
+             XEvent otherEvent;
+-            while (XCheckTypedWindowEvent(X11->display, internalWinId(), ConfigureNotify,
+-                                          &otherEvent)) {
++            qt_configure_event_data configureData;
++            configureData.window = internalWinId();
++            configureData.parent = d->topData()->parentWinId;
++            while (XCheckIfEvent(X11->display, &otherEvent,
++                                 &qt_configure_event_scanner, (XPointer)&configureData)) {
+                 if (qt_x11EventFilter(&otherEvent))
+                     continue;
+ 
+@@ -5287,13 +5311,19 @@ bool QETWidget::translateConfigEvent(const XEvent *event)
+                 newSize.setWidth(otherEvent.xconfigure.width);
+                 newSize.setHeight(otherEvent.xconfigure.height);
+ 
++                trust = isVisible()
++                        && (configureData.parent == XNone ||
++                            configureData.parent == QX11Info::appRootWindow());
++
+                 if (otherEvent.xconfigure.send_event || trust) {
+                     newCPos.rx() = otherEvent.xconfigure.x +
+                                    otherEvent.xconfigure.border_width;
+                     newCPos.ry() = otherEvent.xconfigure.y +
+                                    otherEvent.xconfigure.border_width;
+                     isCPos = true;
+-                }
++                } else {
++                    isCPos = false;
++               }
+             }
+ #ifndef QT_NO_XSYNC
+             qt_sync_request_event_data sync_event;
+@@ -5306,9 +5336,14 @@ bool QETWidget::translateConfigEvent(const XEvent *event)
+         }
+ 
+         if (!isCPos) {
+-            // we didn't get an updated position of the toplevel.
+-            // either we haven't moved or there is a bug in the window manager.
+-            // anyway, let's query the position to be certain.
++            // If the last configure event didn't have a trustable position,
++            // it's necessary to query, see ICCCM 4.24:
++            //
++            //  Any real ConfigureNotify event on a top-level window implies
++            //  that the window’s position on the root may have changed, even
++            //  though the event reports that the window’s position in its
++            //  parent is unchanged because the window may have been reparented.
++
+             int x, y;
+             Window child;
+             XTranslateCoordinates(X11->display, internalWinId(),
+-- 
+1.7.6.4
+
diff --git a/qt.spec b/qt.spec
index f65f5a8..aa7caa7 100644
--- a/qt.spec
+++ b/qt.spec
@@ -11,7 +11,7 @@ Summary: Qt toolkit
 Name:    qt
 Epoch:   1
 Version: 4.8.0
-Release: 0.16.rc1%{?dist}
+Release: 0.17.rc1%{?dist}
 
 # See LGPL_EXCEPTIONS.txt, LICENSE.GPL3, respectively, for exception details
 License: (LGPLv2 with exceptions or GPLv3 with exceptions) and ASL 2.0 and BSD and FTL and MIT
@@ -82,6 +82,9 @@ Patch69: qt-everywhere-opensource-src-4.8.0-QTBUG-22037.patch
 # Qt doesn't close orphaned file descriptors after printing (#746601, QTBUG-14724)
 Patch70: qt-everywhere-opensource-src-4.8.0-QTBUG-14724.patch 
 
+# Buttons in Qt applications not clickable when run under gnome-shell (#742658, QTBUG-21900)
+Patch71:  qt-everywhere-opensource-src-4.8.0-QTBUG-21900.patch
+
 # upstream patches
 
 # security patches
@@ -400,6 +403,7 @@ pushd src/3rdparty/webkit
 popd
 %patch69 -p1 -b .QTBUG-22037
 %patch70 -p1 -b .QTBUG-14724
+%patch71 -p1 -b .QTBUG-21900
 
 # upstream patches
 
@@ -1032,6 +1036,9 @@ fi
 
 
 %changelog
+* Tue Oct 18 2011 Rex Dieter <rdieter at fedoraproject.org> 4.8.0-0.17.rc1
+- Buttons in Qt applications not clickable when run under gnome-shell (#742658, QTBUG-21900)
+
 * Mon Oct 17 2011 Rex Dieter <rdieter at fedoraproject.org> 4.8.0-0.16.rc1
 - Qt doesn't close orphaned file descriptors after printing (#746601, QTBUG-14724)
 


More information about the scm-commits mailing list