summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbscreen.cpp
diff options
context:
space:
mode:
authorMartin Gräßlin <mgraesslin@kde.org>2014-06-16 14:20:05 +0200
committerMartin Gräßlin <mgraesslin@kde.org>2014-06-20 11:25:24 +0200
commit075c36e39beedb33ec4b239d57075f54acb21acf (patch)
tree9edb48731984d5e8fc9d6b90ed251a1e72a6e8f3 /src/plugins/platforms/xcb/qxcbscreen.cpp
parent47b3ecf3f49933f2a7e3a9dd98f0641d513822bb (diff)
Do not overwrite existing event mask of root window
QXcbScreen installs its own event mask on the screen's root window. This overwrites any existing event mask already set and by that breaks applications when a new screen is added. By first fetching the existing event mask and adding it to the newly installed event mask, Qt does no longer break applications also installing an event mask on the root window. Task-number: QTBUG-39648 Change-Id: I8686dd6ae49d0e807c6fe1ea4a231ff728bfcf25 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Uli Schlachter <psychon@znc.in> Reviewed-by: Gatis Paeglis <gatis.paeglis@digia.com>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbscreen.cpp')
-rw-r--r--src/plugins/platforms/xcb/qxcbscreen.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/plugins/platforms/xcb/qxcbscreen.cpp b/src/plugins/platforms/xcb/qxcbscreen.cpp
index 9f19841437..01e78465b6 100644
--- a/src/plugins/platforms/xcb/qxcbscreen.cpp
+++ b/src/plugins/platforms/xcb/qxcbscreen.cpp
@@ -106,6 +106,11 @@ QXcbScreen::QXcbScreen(QXcbConnection *connection, xcb_screen_t *scr,
qDebug(" root ID........: %x", screen()->root);
#endif
+ QScopedPointer<xcb_get_window_attributes_reply_t, QScopedPointerPodDeleter> rootAttribs(
+ xcb_get_window_attributes_reply(xcb_connection(),
+ xcb_get_window_attributes_unchecked(xcb_connection(), screen()->root), NULL));
+ const quint32 existingEventMask = rootAttribs.isNull() ? 0 : rootAttribs->your_event_mask;
+
const quint32 mask = XCB_CW_EVENT_MASK;
const quint32 values[] = {
// XCB_CW_EVENT_MASK
@@ -113,6 +118,7 @@ QXcbScreen::QXcbScreen(QXcbConnection *connection, xcb_screen_t *scr,
| XCB_EVENT_MASK_LEAVE_WINDOW
| XCB_EVENT_MASK_PROPERTY_CHANGE
| XCB_EVENT_MASK_STRUCTURE_NOTIFY // for the "MANAGER" atom (system tray notification).
+ | existingEventMask // don't overwrite the event mask on the root window
};
xcb_change_window_attributes(xcb_connection(), screen()->root, mask, values);