Changeset 561 for trunk/src/gui/kernel/qclipboard_x11.cpp
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/gui/kernel/qclipboard_x11.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information ([email protected]) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation ([email protected]) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you 37 ** @nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 79 79 #include "qvariant.h" 80 80 #include "qdnd_p.h" 81 81 82 82 83 #ifndef QT_NO_XFIXES … … 132 133 requestor->createWinId(); 133 134 requestor->setObjectName(QLatin1String("internal clipboard requestor")); 135 136 137 138 139 134 140 qAddPostRoutine(cleanup); 135 141 } … … 429 435 // clipboard. 430 436 (void)QApplication::desktop(); 437 438 439 440 441 442 443 444 445 446 447 448 449 450 431 451 if (X11->time == CurrentTime) { 432 452 // send a dummy event to myself to get the timestamp from X11. … … 756 776 requestor = new QWidget(0); 757 777 requestor->setObjectName(QLatin1String("internal clipboard requestor")); 778 779 780 758 781 759 782 return QByteArray(); … … 774 797 types.append(ATOM(MULTIPLE)); 775 798 types.append(ATOM(TIMESTAMP)); 799 776 800 777 801 XChangeProperty(X11->display, window, property, XA_ATOM, 32, … … 787 811 788 812 QByteArray fmt = X11->xdndAtomToString(target); 789 if (fmt.isEmpty() || !QInternalMimeData::hasFormatHelper(QString::fromAscii(fmt), d->source())) { // Not a MIME type we have813 if (fmt.isEmpty()) { // Not a MIME type we have 790 814 DEBUG("QClipboard: send_selection(): converting to type '%s' is not supported", fmt.data()); 791 815 return XNone; … … 898 922 Display *dpy = X11->display; 899 923 900 if (!xevent) 924 if (!xevent) { 925 // That means application exits and we need to give clipboard 926 // content to the clipboard manager. 927 // First we check if there is a clipboard manager. 928 if (XGetSelectionOwner(X11->display, ATOM(CLIPBOARD_MANAGER)) == XNone 929 || !owner) 930 return true; 931 932 Window ownerId = owner->internalWinId(); 933 Q_ASSERT(ownerId); 934 // we delete the property so the manager saves all TARGETS. 935 XDeleteProperty(X11->display, ownerId, ATOM(_QT_SELECTION)); 936 XConvertSelection(X11->display, ATOM(CLIPBOARD_MANAGER), ATOM(SAVE_TARGETS), 937 ATOM(_QT_SELECTION), ownerId, X11->time); 938 XSync(dpy, false); 939 940 XEvent event; 941 // waiting until the clipboard manager fetches the content. 942 if (!X11->clipboardWaitForEvent(ownerId, SelectionNotify, &event, 10000)) { 943 qWarning("QClipboard: Unable to receive an event from the " 944 "clipboard manager in a reasonable time"); 945 } 946 901 947 return true; 948 902 949 903 950 switch (xevent->type) {
Note:
See TracChangeset
for help on using the changeset viewer.