summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbclipboard.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Make sure timestamp is initialized before using it for seting selection owner.Gatis Paeglis2012-10-131-0/+3
| | | | | | | | | | | | | | | | | | | | | Convention from icccm: Clients attempting to acquire a selection must set the time value of the xcb_set_selection_owner request to the timestamp of the event triggering the acquisition attempt, not to XCB_CURRENT_TIME. In some cases it happened that timestamp was set to XCB_CURRENT_TIME. A zero-length append to a property is a way to obtain a timestamp for this purpose; the timestamp is in the corresponding XCB_PROPERTY_NOTIFY event. We used to have this mechanism in 4.8, it was achieved by XWindowEvent. AFAIK there isn't an equivalent for XWindowEvent in XCB. Therefore i had to introduce a new mechanism in QXcbConnection - getTimestamp. This function blocks until it receives the requested event. Change-Id: Ide46a4fdd44cf026fdd17a79d3c4b17741d1b7d4 Task-number: QTBUG-26783 Reviewed-by: Uli Schlachter <psychon@znc.in> Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Retrieve drop data with a proper timestampGatis Paeglis2012-10-021-2/+4
| | | | | | | | | | | Occasionally drag-and-drop was returning empty mimedata due to using wrong value for timestamp. Accoring to the xdnd specification we must use timestamp from XdndPosition or XdndDroptime for retrieving the data. Task-number: QTBUG-27367 Change-Id: Iadb6b6989cfc4e8ab241e2fd0ded59355108f22f Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Don't let mimeData return 0.Gatis Paeglis2012-10-021-12/+25
| | | | | | | | | Fixes bug introduced in SHA e247e2810 (QTBUG-26709). Change-Id: I9aa80239675b2d564d08a019ca267a9aa814074e Reviewed-by: David Faure <faure@kde.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Fix mimedata updating and signal emision issues in xcb clipboard.Gatis Paeglis2012-08-021-26/+38
| | | | | | | | | | | | | Clipboard should reacquire the clipboard whenever the content or metadata (e.g the list of supported targets) changes. Patch enables us to monitor changes to the clipboard through help of XFixes extension. Cleanup xlib xa_* naming conventions Task-number: QTBUG-26709 Change-Id: I9d47766ad9859b5628b0358b1c47e8af8fecef73 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Fix badAtom issues introduced by behavior changes between Xlib and xcb.Gatis Paeglis2012-08-021-22/+7
| | | | | | | | | | | | In Xlib, the 'length' variable gets updated with the the actual number of 8-bit, 16-bit, or 32-bit items stored in the returned data, but xcb returns the actual number of bytes read through xcb_get_property_value_length, therefore the logic of calculating offset was broken. Task-number: QTBUG-26709 Change-Id: I04de3b5c5631cfaf9b3c2c3d4513be73c569f61f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Fix xcb plugin compilation for -qconfig largeTasuku Suzuki2012-05-261-0/+4
| | | | | | Change-Id: I1ee1fb9c140396e83272d607ee4dd63ce2c50b8d Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Cleaned up debug and warning output in xcb plugin.Samuel Rødal2012-03-021-9/+9
| | | | | | | | | Got rid of unnecessary debug output, and prefixed debug / warnings with class name to provide more context. Change-Id: Ia68e85ec0207de4d87d02226bdf6e4cddf464afc Reviewed-by: Uli Schlachter <psychon@znc.in> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* QClipboard: Fix autotest failsDebao Zhang2012-02-271-0/+1
| | | | | | | | | | | | | | | tst_qclipboard.cpp still has Q_WS_WIN which must be clear away. After clean up, auto test will fail under windows: When setMimeData() is called, dataChanged() signal will be emited twice. The solution for QTBUG-24184 has partially solved the problem, but it still there. Make sure emitChanged() only called by QPlatformClipboard will give our more control for this. Task-number: QTBUG-24484 Change-Id: I23566c6d3b32828b6865234c311af3635fe9e299 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-231-1/+1
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Rename check to checkEvent.Stephen Kelly2012-01-101-2/+2
| | | | | | | Avoids conflict with macro on Mac OS. Change-Id: I1b597205c32531e054832fcb396622b47b18040a Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Use clipboard_timeout instead of hardcoded 5000 (since its the same value)Albert Astals Cid2012-01-051-1/+1
| | | | | Change-Id: Ia0edf04e36c8d30394a2bc9a691ab9aa78831f78 Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Free the repliesAlbert Astals Cid2012-01-051-0/+2
| | | | | Change-Id: I719bd95d94f3bfd41eeb09a49ac3e2701a516619 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Check for the clipboard manager when looping due to app quitingAlbert Astals Cid2012-01-051-2/+12
| | | | | | | | | | | | | One can be extremely unlucky and on session logout get this: * All apps are going down * A Qt app checks if the clipboard manager is there to yield its clipboard contents * The clipboard manager is still there * Then just after that check, the clipboard manager finishes because of the session end * This means the Qt app will loop for 5 seconds trying to yield its clipboard contents to a clipboard manager that is not there anymore Change-Id: Ia89670d4deb72f12e660a0d7aa5b2d212955d6fe Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Make qtbase build with Qt-in-namespace againKent Hansen2011-09-281-0/+4
| | | | | | | Change-Id: I5faa8690a05d6ec352fc69c0b69848539f2ed216 Reviewed-on: http://codereview.qt-project.org/5460 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* workaround XCB-ICCCM 3.8 breakage, second instanceOswald Buddenhagen2011-09-231-0/+2
| | | | | | | | Change-Id: Ic456f6ca9d845f50506b41d71bb5d2b83239a37e Reviewed-on: http://codereview.qt-project.org/5333 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fix stale license headers from refactor branchJason McDonald2011-09-151-17/+17
| | | | | | Change-Id: I38cd941202641f50bf632af35165a944d03a20e3 Reviewed-on: http://codereview.qt-project.org/4848 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Don't crash if Clipboard and Selection hold the same mimedateLars Knoll2011-06-201-1/+2
| | | | | | | | Cliboard and Selection can hold the same QMimeData object. Don't delete the mimedata in this case before when clearing only one of them. Reviewed-by: Samuel
* use selection changed events from XFixesLars Knoll2011-06-201-18/+32
| | | | | | | | properly initialize the XFixes extension and then use the selection changed events to notify Qt apps. Reviewed-by: Samuel
* Enhance Xcb clipboard codeLars Knoll2011-06-201-67/+133
| | | | | | | | | | Some cleanup on the data structures. Properly implement support for timestamps on each selection. Transfer selections to the clipboard manager on exit if it exists. Properly clear our selection when X11 asks us to do so.
* cosmetic changesLars Knoll2011-06-081-4/+4
|
* cleanups codeLars Knoll2011-06-071-65/+64
| | | | | | | Make QXcbClipboard and QXcbDrag a QXcbObject to simplify the code. Use the predefined atoms in xproto.h instead of our own defines.
* Fix some remaining issues with DnDLars Knoll2011-06-071-18/+7
| | | | | | | | | Do not set the event mask of the window we drop onto to NO_EVENT. Always use the clipboards requestor window to convert selections. Reviewed-by: Samuel
* Implement XDnD in the xcb pluginLars Knoll2011-06-071-4/+4
| | | | | | | | | Ported most of the code to support dragging from qdnd_x11.cpp to xcb. Some features are still not working 100% correct, but it's becoming usable. Reviewed-by: Samuel
* X11 DnD implementationLars Knoll2011-06-071-14/+19
| | | | | | | | | | | Initial code for DnD on X11. Only Xdnd based, Motif DnD is being ignored. The code is currently limited to dropping stuff onto the application. Starting drags is not yet implemented. Reviewed-by: Samuel
* Cleanup code for copy/paste of textLars Knoll2011-05-301-21/+0
| | | | | | | | | | Remove support for COMPOUND_TEXT. All apps should these days support UTF8_STRING. If not they'll have to live with STRING or TEXT. ICCCM states that TEXT is in the encoding of choice. Make this latin1 instead of local8bit. XA_STRING is defined to be latin1, so don't use local8bit here neither.
* correctly decode pasted textLars Knoll2011-05-301-6/+7
|
* partially working pasteLars Knoll2011-05-301-6/+18
| | | | | | We now paste something from the clipboard, but the format conversion seems to be still off at times.
* add an xcb based clipboard implementationLars Knoll2011-05-301-0/+782
Copying from the app to somewhere else works fine, but pasting into the app is still broken.