summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-06-09 11:07:22 +0200
committerJason McDonald <jason.mcdonald@nokia.com>2009-06-12 19:29:59 +1000
commit7e51e1a102de62931be94d1ebb5d0f393c5e3f10 (patch)
tree4945746bd402da91c25d93b0cdb00e0c0be76d4d
parent70f890a06c86aa30fd851cc420c283a85ad1a00b (diff)
Copy-paste didn't work for application on non-first screen in multiscreen setup.
We need to subscribe to xfixes selection notify events on all available screens. Also implemented delayed subscription to xfixes events since we don't really need clipboard change notifications unless the application explicitely asked for by (i.e. created a qclipboard object). Task-number: 255609 Reviewed-by: Bradley T. Hughes (cherry picked from commit 8a745d2a1048ba922232530d36c2fd01d4c92159)
-rw-r--r--src/gui/kernel/qapplication_x11.cpp8
-rw-r--r--src/gui/kernel/qclipboard_x11.cpp14
2 files changed, 14 insertions, 8 deletions
diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp
index 705e9acefe..0bd7c4d598 100644
--- a/src/gui/kernel/qapplication_x11.cpp
+++ b/src/gui/kernel/qapplication_x11.cpp
@@ -2057,14 +2057,6 @@ void qt_init(QApplicationPrivate *priv, int,
X11->xfixes_major = major;
}
}
- if (X11->use_xfixes && X11->ptrXFixesSelectSelectionInput) {
- const unsigned long eventMask =
- XFixesSetSelectionOwnerNotifyMask | XFixesSelectionWindowDestroyNotifyMask | XFixesSelectionClientCloseNotifyMask;
- X11->ptrXFixesSelectSelectionInput(X11->display, QX11Info::appRootWindow(0),
- XA_PRIMARY, eventMask);
- X11->ptrXFixesSelectSelectionInput(X11->display, QX11Info::appRootWindow(0),
- ATOM(CLIPBOARD), eventMask);
- }
#endif // QT_NO_XFIXES
#ifndef QT_NO_XCURSOR
diff --git a/src/gui/kernel/qclipboard_x11.cpp b/src/gui/kernel/qclipboard_x11.cpp
index fe562a3327..98c730a4c6 100644
--- a/src/gui/kernel/qclipboard_x11.cpp
+++ b/src/gui/kernel/qclipboard_x11.cpp
@@ -428,6 +428,20 @@ QClipboard::QClipboard(QObject *parent)
// XFixesSelectionNotify events when someone changes the
// clipboard.
(void)QApplication::desktop();
+
+#ifndef QT_NO_XFIXES
+ if (X11->use_xfixes && X11->ptrXFixesSelectSelectionInput) {
+ const unsigned long eventMask =
+ XFixesSetSelectionOwnerNotifyMask | XFixesSelectionWindowDestroyNotifyMask | XFixesSelectionClientCloseNotifyMask;
+ for (int i = 0; i < X11->screenCount; ++i) {
+ X11->ptrXFixesSelectSelectionInput(X11->display, QX11Info::appRootWindow(i),
+ XA_PRIMARY, eventMask);
+ X11->ptrXFixesSelectSelectionInput(X11->display, QX11Info::appRootWindow(i),
+ ATOM(CLIPBOARD), eventMask);
+ }
+ }
+#endif // QT_NO_XFIXES
+
if (X11->time == CurrentTime) {
// send a dummy event to myself to get the timestamp from X11.
qt_init_timestamp_data data;