summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbclipboard.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Updated license headersJani Heikkinen2016-01-151-14/+20
| | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* xcb: Use XShape for DnD when a compositing manager is not runningAlexander Volkov2015-10-141-22/+2
| | | | | | | | | Otherwise transparent areas of the drag'n'drop pixmap are painted with the black color. Task-number: QTBUG-45193 Change-Id: I55b7c7caababe13584fa1c7a52835f112e20f920 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Handle SelectionWindowDestroy in QXcbClipboardMartin Gräßlin2015-03-271-1/+2
| | | | | | | | | | | | | | This change is related to 6a7ee92b3958e3a3ebc16be15f8bd34217ec7bd2 which added handling for SelectionClientClose. Further testing showed that with e.g. Qt 4 applications the SelectionClientClose is not emitted, but the selection window seems to be destroyed before the client is destroyed. Fur a destroyed selection window the same applies: the clipboard content is no longer valid and we should emit the changed signal. Change-Id: I173e272dbe912084deed5342d7a4adb55ea1974f Reviewed-by: Gatis Paeglis <gatis.paeglis@digia.com>
* QPA plugins: Fix const correctness in old style castsThiago Macieira2015-03-091-2/+2
| | | | | | | | Found with GCC's -Wcast-qual. Change-Id: Ia0aac2f09e9245339951ffff13c946899b4ba15b Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* QXcbClipboard: don't hold on to the screen pointerSandro Mani2015-02-041-6/+13
| | | | | | | | | | | | Remove the QXcbClipboard::m_screen member variable and make it use connection()->primaryScreen() instead. The clipboard is created in the QXcbConnection constructor, and QXcbClipboard::m_screen was set to the primary screen at the time of construction. If the primary screen later gets disconnected, m_screen ends up pointing to a non-existing screen. Change-Id: I2d23106673d0ba013056d4dbb7078acdf6f9bc7c Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.4' into devSimon Hausmann2014-12-181-1/+2
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.h src/platformsupport/platformcompositor/qopenglcompositor.cpp src/platformsupport/platformcompositor/qopenglcompositorbackingstore.cpp tests/auto/gui/kernel/qwindow/tst_qwindow.cpp Change-Id: I5422868500be695584a496dbbbc719d146bc572d
| * Handle SelectionClientClose in QXcbClipboardMartin Gräßlin2014-12-101-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | QXcbClipboard listens for subtype SelectionClientClose of Xfixes SelectionNotify event, but doesn't handle it. When the client holding the clipboard selection closes the Clipboard becomes empty and thus the change should be emitted. This fixes downstream KDE Bug #329174. Change-Id: I19fb8cfd7bd3b249c0bc6ca2a724a9aeeb05ac7e Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com> Reviewed-by: Aleix Pol Gonzalez <aleixpol@kde.org>
* | Add Q_DECL_OVERRIDE in the src subdirectoryOlivier Goffart2014-12-031-4/+4
|/ | | | | | | | | | Done automatically with clang-modernize on linux (But does not add Q_DECL_OVERRIDE to the function that are marked as inline because it a compilation error with MSVC2010) Change-Id: I2196ee26e3e6fe20816834ecea5ea389eeab3171 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* xcb: Fix getting the primary screen from QXcbConnection::screens()Alexander Volkov2014-10-291-1/+1
| | | | | | | | | | | | | | | | Currently getting QXcbScreen* for primary screen is too messy and it wrongly uses QXcbConnection::primaryScreen() as an index in QXcbConnection::screens() although QXcbConnection::screens() returns the primary screen as the first item in the list since 3c8eb404877df9c967d81fa9df7d718c538fb407. So to clear the API rename primaryScreen() to primaryScreenNumber(), add QXcbConnection::primaryScreen() that returns correct QXcbScreen* and use it directly. Change-Id: Icb7391aa3e82b32ca48f2bda764dcf7ffd89cc47 Reviewed-by: Uli Schlachter <psychon@znc.in> Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Merge remote-tracking branch 'origin/5.3' into 5.4Gabriel de Dietrich2014-09-291-0/+3
|\ | | | | | | | | | | | | | | Conflicts: src/network/socket/qnativesocketengine_unix.cpp src/widgets/kernel/qwidget_qpa.cpp Change-Id: I6f1aa320d5ca66cd92d601a95885aeaab0abb191
| * XCB: fix a possible array overflow leading to a crashGiuseppe D'Angelo2014-09-221-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | The QClipboard::Mode returned from modeForAtom should be checked everywhere because values greater than Selection (i.e. FindBuffer) aren't supported on X and should mean error conditions. The lack of such a check did an out-of-bounds array access, which could lead to a crash. Change-Id: I70f70b5f713ab2f892e258d4df2f7afeb434f0c1 Reviewed-by: Uli Schlachter <psychon@znc.in> Reviewed-by: Gatis Paeglis <gatis.paeglis@digia.com>
* | Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | | | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* | xcb: replace inefficient uses of QList with QVectorMarc Mutz2014-02-261-2/+3
|/ | | | | | | | | | xcb atoms are uint32s, so a QList of them wastes 50% memory on 64-bit platforms. Other parts of the code already store xcb_atom_t's in QVector, so use QVector everywhere (also leads to less code expansion). Change-Id: Ib4afb35e499577a7509d04a18b830d9b31f6abd0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* xcb: every window should have a title in debug modeShawn Rutledge2013-10-091-0/+22
| | | | | | | | | | | | Qt creates various invisible windows for internal purposes. Giving them all titles makes the output of tools like xprop and xwininfo more readable, which makes solving certain bugs (like transient-window bugs) easier. Task-number: QTBUG-33644 Change-Id: I9d37b40d3339fb0f81ffeae64949b88ecb655474 Reviewed-by: Uli Schlachter <psychon@znc.in> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Fix timing issue in incremental data retrieval mechanismGatis Paeglis2013-09-191-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Make sure that we are not reading wrong PropertyNotify events. From icccm: Requestors may receive a property of type INCR in response to any target that results in selection data. This indicates that the owner will send the actual data incrementally. The selection requestor: - Waits for the SelectionNotify event. - Loops: + Retrieving data using GetProperty with the delete argument True. + Waiting for a PropertyNotify with the state argument NewValue. - Waits until the property named by the PropertyNotify event is zero-length. - Deletes the zero-length property. The issue with the current approach was that after receiving INCR we simply fetched the first PropertyNotify event from the queue, where timestamp indicates that it was generated before INCR, which is not what need. We need PropertyNotify events with a timestamp older than the one on INCR. Task-number: QTBUG-32045 Change-Id: I3b9a006f7d346f67c51e1a296d67a9dc89efadb1 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Implement INCR property mechanism for large data transfers [XCB]Gatis Paeglis2013-09-191-4/+126
| | | | | | | Implement INCR property mechanism according to the icccm specification. Change-Id: Ic8f85b71cab825d70ee1b61f29acd09fa4c3e642 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* 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.