diff options
author | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-06-09 09:07:22 (GMT) |
---|---|---|
committer | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-06-11 19:05:13 (GMT) |
commit | 8a745d2a1048ba922232530d36c2fd01d4c92159 (patch) | |
tree | 0572014f1f6b344630d3d3af9ea37430ca8b10c6 /src/gui/kernel/qclipboard_x11.cpp | |
parent | 82a32d2e0fb603d5ebe4e0958ff68501b1f1b75b (diff) | |
download | Qt-8a745d2a1048ba922232530d36c2fd01d4c92159.zip Qt-8a745d2a1048ba922232530d36c2fd01d4c92159.tar.gz Qt-8a745d2a1048ba922232530d36c2fd01d4c92159.tar.bz2 |
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
Diffstat (limited to 'src/gui/kernel/qclipboard_x11.cpp')
-rw-r--r-- | src/gui/kernel/qclipboard_x11.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gui/kernel/qclipboard_x11.cpp b/src/gui/kernel/qclipboard_x11.cpp index 089cc43..4560357 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; |