summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbdrag.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add Q_DECL_OVERRIDE in the src subdirectoryOlivier Goffart2014-12-031-3/+3
| | | | | | | | | | 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>
* 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: Fix memory leaks in DnDAlexander Volkov2014-09-191-3/+10
| | | | | | Change-Id: Ie19711c17769128db67a0b083ef72109f49bfe78 Spotted-by: Alexander Smirnov Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* xcb: fix getting a XdndAware property if a proxy window existsAlexander Volkov2014-09-091-1/+1
| | | | | | | | | | | | According to the XDND standard (http://www.newplanetsoftware.com/xdnd/) if the proxy window exists then it should be checked for the XdndAware property rather than the target window directly. c3f9de62966d32d8e33d62eb374fe2657a4cfebe introduced the mistake. In the old code the proxy window was used. Change-Id: I83b66d4b1f08a1f44d5c1451d0f1735c084bcf09 Spotted-by: Alexander Smirnov Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* devicePixelRatio support for XCBPaul Olav Tvete2014-08-191-3/+12
| | | | | | | | | | This adds support for the environment variable QT_DEVICE_PIXEL_RATIO for the xcb platform plugin. Task-number: QTBUG-38858 Change-Id: I7faca2f2e7dc5c601a82b3cc08456870b3e5602d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com> Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Move deletion of the QDrag object into QDragManager::drag().Friedemann Kleint2014-07-011-3/+0
| | | | | | | | | | The QDrag objects were apparently leaking on all platforms other than XCB. Task-number: QTBUG-39651 Change-Id: I09efcd250c1f42eb385e9d5779be7af6b9b59376 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com> Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-03-241-2/+2
|\ | | | | | | | | | | | | Conflicts: src/gui/image/qjpeghandler.cpp Change-Id: I9db3acea7d5c82f5da679c8eaeb29431136665f0
| * [XCB] Fix crash in QML drag-and-dropGatis Paeglis2014-03-141-1/+2
| | | | | | | | | | | | | | | | | | | | | | Use QPointer to make sure that we are not trying to destroy already deleted object. Task-number: QTBUG-35702 Change-Id: Ib746996787488e636f25e6ea5be0571607ee2ded Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
| * [XCB] Fix drag-and-drop segfaultGatis Paeglis2014-03-141-1/+0
| | | | | | | | | | | | | | | | | | | | | | QXcbDrag inherits QBasicDrag which takes care of calling updateAction() when needed, we don't need to call it explicitly. Task-number: QTBUG-33057 Change-Id: I754408f74f56de36ace8ffa40a61bd7c64619899 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* | xcb: replace inefficient uses of QList with QVectorMarc Mutz2014-02-261-2/+2
|/ | | | | | | | | | 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>
* expand tabs and related whitespace fixes in *.{cpp,h,qdoc}Oswald Buddenhagen2014-01-131-2/+2
| | | | | | | | the diff -w for this commit is empty. Started-by: Thiago Macieira <thiago.macieira@intel.com> Change-Id: I77bb84e71c63ce75e0709e5b94bee18e3ce6ab9e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix crash in QXcbDrag.Friedemann Kleint2013-10-231-1/+1
| | | | | | | | | handleStatus() was called with drag==0 when releasing the mouse over the desktop. Task-number: QTBUG-33920 Change-Id: I553647d1e734934b7c6caf4c984683cff88f9162 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Move QBasicDrag and QSimpleDrag to QtGui.Samuel Rødal2013-05-301-2/+2
| | | | | | | | | | | | These are useful as default implementations of QPlatformIntegration::drag(), instead of having it return 0 which will lead to crashes in Qt Quick 2 and widgets applications that use drag and drop. Task-number: QTBUG-31288 Change-Id: I70efa139306ced5d879def0f74e3a72d3bcd64f7 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Add QXcbConnectionGrabber classJørgen Lind2013-05-201-2/+1
| | | | | | | Inspired by QMutexLocker Change-Id: I66e31091d2a006db3272b627567d95d3e0b1c4f9 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Restore cursor before sending QDropEventGatis Paeglis2013-05-131-1/+0
| | | | | | | | | When users created a modal window in a dropEvent(QDropEvent* event), the cursor was not restored to its original shape until after the modal window had been dismissed. Change-Id: Id4723e3cb66b36a3ca18ff097a3993563816d9e1 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Don't send QMouseEvent events from the QXcbDrag::timerEvent()Gatis Paeglis2013-05-131-19/+1
| | | | | | | | | | | | | | | | | | This is not needed. The DnD initiated scrolling is done by installing an eventFilter which forwards all MouseMove events to the QGuiApplicationPrivate::processDrag which creates and forwards all the necessary QDrag* events. QAbstractScrollArea has its own logic in the timerEvent() to make the view scroll when the pointer is standing still on the edge and the drag process is still ongoing. With the current implementation, widgets (during the DnD) were receiving DragMove events even when the pointer was standing still outside auto scroll areas. Task-number: QTBUG-28171 Change-Id: I355d88f3eab0ad39f916f84d66f5d0af7c0ff93e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Moving logic from Qt4 for grabbing the X serverJørgen Lind2013-04-261-2/+2
| | | | | | | | | Basically you don't want to grab the X server while your debugging. Also added an environment variable which lets you force to not grab the X server Change-Id: Iba03f11c8f486ce71c55fac7716bffcb7cc8cb98 Reviewed-by: Samuel Rødal <samuel.rodal@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>
* Fix drops from external sources.Gatis Paeglis2012-11-221-6/+5
| | | | | | | Task-number: QTBUG-26832 Change-Id: Ia1ccce391178e73d26a4f09955bce6c37616384f Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Rename all QWindow properties that have "window" in themShawn Rutledge2012-11-071-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | windowTitle, windowModality, windowIcon and so on are named that way to be similar to the ones in QWidget. However QQuickWindow inherits all of the declared properties, and we would like to have shorter property names in QML. If you are working with a Window then it's obvious the title property is the window title. Unfortunately, there must be patches in many other modules which depend on this one. In order to avoid the need to merge them all at the same time, there is also patch https://codereview.qt-project.org/#change,39001 which temporarily adds backwards-compatible accessors, which can be removed after the other modules are able to build without them. We should not rename windowState to state, because in QML, state usually drives the state machine for animation transitions etc. (although QWindow is not an Item, a user might get confused about it). Related patches are https://codereview.qt-project.org/#change,39001 https://codereview.qt-project.org/#change,37764 https://codereview.qt-project.org/#change,37765 https://codereview.qt-project.org/#change,37766 https://codereview.qt-project.org/#change,37762 Change-Id: Ie4424ec15fbdef6b29b137f90a2ae33f173edd21 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Modularize drag and drop documentationGatis Paeglis2012-10-191-19/+6
| | | | | | | | - Move dnd docs and examples out of QtDoc module to gui library in QtBase - Remove info related to Motif dnd since Qt5 doesn't implement it Change-Id: Id7eb4eb422f4294a36dd92709ce3007903371f03 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Simplify transaction expiry mechanismGatis Paeglis2012-10-131-28/+35
| | | | | | | | | | | | | | | | | | | | | This patch makes transaction mechanism less scattered around and conforms to the xdnd specification: Don't block and keep a history of previous data. This can be very difficult to implement, but it is clearly the ideal behavior from the user's perspective because it allows him to drop something and then continue working with the assurance that the target will get the data regardless of how slow the network connections are. When the source receives XdndFinished, it can remove the item from its history, thereby keeping it from getting too large. The source must also be prepared to throw out extremely old data in case a target malfunctions. I assume that 10min for drag-and-drop operation can be considered 'extremely' old data. Change-Id: I73dcd21aee3ad188d2260e49d80824da6ba040ab Task-numer: QTBUG-14493 Reviewed-by: David Faure (fixes for KDE) <faure@kde.org> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Stop delivering messages when drop has occurred.Gatis Paeglis2012-10-021-0/+6
| | | | | | | Task-number: QTBUG-27406 Change-Id: If14c108060ad6de70991658f0e0249eb544b87a0 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Retrieve drop data with a proper timestampGatis Paeglis2012-10-021-1/+1
| | | | | | | | | | | 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>
* Ensure that QDrag is set correctly at all times.Gatis Paeglis2012-10-021-5/+7
| | | | | | | | | | | | | This patch fixes broken code in handleSelectionRequest(). There are 2 cases when this function is called: 1) When XdndDrop has arrived (on mouse release) 2) When drop has not occurred yet (while mouse are still pressed down) Second case was not working due to this bug. Task-number: QTBUG-27405 Change-Id: I913cfd332128a28861e2fcc027b406eb821d2597 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Fixed xdnd protocol-version detection codeGatis Paeglis2012-10-021-3/+3
| | | | | | | | | | | Bug introduced when porting from Xlib to xcb. Xcb returns actual number of bytes read while Xlib returns number of 8-bit, 16-bit, or 32-bit items stored in the returned data. Task-number: QTBUG-27403 Change-Id: Ia64da1953ec7be8d32cc591565cd1b41ce8d7dbb 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>
* Revert "Move QWindowSystemInterface out of qpa."Paul Olav Tvete2012-08-031-1/+1
| | | | | | | | | | | | | | This reverts commit 784a877d3cd9a1a75aca9c83146389503a966071. Conflicts: src/plugins/platforms/cocoa/qcocoawindow.mm src/testlib/qtestkeyboard.h src/testlib/qtestmouse.h src/testlib/qtesttouch.h Change-Id: Iebfed179b3eb7f30e4c95edcae5a8ad6fd50330e Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Move QWindowSystemInterface out of qpa.Stephen Kelly2012-07-191-1/+1
| | | | | | | | Public QtTest headers require it, so all unit tests would have to use private Qt headers otherwise, which is not practical. Change-Id: I5d4466ec30b6a57ebdfc34413e716e657eb51368 Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
* Suppress QWindowSystemInterface inclusion warnings.Girish Ramakrishnan2012-07-031-1/+1
| | | | | | | | | | | | | Since QWindowSystemInterface is now part of QPA API. The correct inclusion is: #include <qpa/qwindowsysteminterface.h> #include <qpa/qwindowsysteminterface_p.h> Bulk of the work was done by: find . -type f | xargs sed -i -e 's,#include <\(QtGui/\)\?QWindowSystemInterface>,#include <qpa/qwindowsysteminterface.h>,g' Change-Id: If75fc32611e72ef1cf58505794def375b1acf74a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Set window's surface format to support alpha channel.Gatis Paeglis2012-06-281-1/+0
| | | | | | Task-number: QTBUG-26114 Change-Id: I33f191373327832fb9d3054366412ec5be855cff Reviewed-by: Friedemann Kleint <Friedemann.Kleint@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>
* XShaping drag and drop fixesAlbert Astals Cid2012-05-101-8/+12
| | | | | | | | No shaping rectangles means no interaction with the window The shaping rectangles are based on the window coords, so need to substract the window coords when checking for the point Change-Id: Ic9004a8ec0f447cddcd1b4324d9fd60a94787cb9 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* xcb: Check for SHAPE extension before using itUli Schlachter2012-03-021-4/+6
| | | | | | | | | | | | | This change makes sure that the X11 server really supports the SHAPE extension before it is used. Before this, libxcb would disconnect from the server as soon as it was told to send a SHAPE request to a server which doesn't support SHAPE. Oh and of course it would do so without any good error message. Change-Id: I5f9481e488925e74e62f229e9f637ef262020c04 Signed-off-by: Uli Schlachter <psychon@znc.in> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Take into account input shaping in findRealWindowAlbert Astals Cid2012-03-011-16/+24
| | | | | | | | | | | | | | In previous commits we took into account bound shaping, but X also supports input shaping, so make sure it's inside both input and bounding shaping to consider the position as inside a window My tests show that when unset Bound Shaping and Input Shaping return the rectangle of the window itself, so we need to be inside both of the rectangle sets to consider the position as a dragabble position for the window Change-Id: I77973e51168d2a6d274d166f29f32e1bc02c32c3 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Refactor the QPA dnd interface.Friedemann Kleint2012-02-291-247/+149
| | | | | | | | | | | | | | | - Give QPlatformDrag a synchronous drag() function returning the Qt::DropAction - Move the base functionality for asynchronous event handling to the platformsupport library as QBasicDrag (extendable base class handling drag icon and providing new virtuals) and QSimpleDrag (sample implementation for drag within the Qt application). - Change the Windows implementation accordingly. - Change XCB to be based on QBasicDrag. - Clean up QDragManager. Change-Id: I654f76f0e55a385ba189bd74f3ceaded6a8fe318 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Take into account shaping in findRealWindowAlbert Astals Cid2012-02-091-3/+25
| | | | | | | | | | | | | | It can happen that there is a window covering all the screen but it is shaped to only take part of the screen. If that happens, besides the condition of QRect(attr.x,attr.y,attr.width,attr.height).contains(pos) we also need to query the server for its region rectangles and make sure the cursor is inside one of those rectangles. If that does not happen we have to return 0 so the hierarchical xcb_query_tree_children xcb_query_tree_childrenntinues Change-Id: I67327672e3d854d064190b55a07bd56ade4dfddb Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Uli Schlachter <psychon@znc.in> 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-1/+1
| | | | | | | Avoids conflict with macro on Mac OS. Change-Id: I1b597205c32531e054832fcb396622b47b18040a Reviewed-by: Rohan McGovern <rohan.mcgovern@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>
* Remove debug outputLars Knoll2011-09-281-1/+0
| | | | | | | Change-Id: I1d1884956a02bc58e760f0893ec4762e3c2f3f4d Reviewed-on: http://codereview.qt-project.org/5560 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
* Fix mouse coordinate translation when searching for a drop targetLars Knoll2011-09-281-11/+5
| | | | | | | | | | | Correctly transform the coordinates when mapping from parent to child in the window hierarchy. Also avoid a second roundtrip to the xserver querying information that we already have. Change-Id: Ia13f1c7ee20c60df283562daa4869d6db30a37e9 Reviewed-on: http://codereview.qt-project.org/5558 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Fixes to the Xdnd code in xcbLars Knoll2011-09-211-61/+62
| | | | | | | | | | Make sure we move the drag pixmap when required, and readd some commented out code from Qt 4.x. Change-Id: Ib4302b394f4ac7b966d0146267651b9c3860c62b Reviewed-on: http://codereview.qt-project.org/5262 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Refactor QMouseEvent to contain the position inside the windowLars Knoll2011-09-011-2/+4
| | | | | | | | | | | | | | Rename the default accessors for positions to localPos, windowPos and screenPos, to be explicit about their use. Introduce a QT_NO_INTEGER_EVENT_COORDINATES define so one can make sure to always use the float based coordinates. Fixup all Qt code to use the correct constructor that specifies all three coordinates. Change-Id: If4bb93b8d1e2eb2440260d99680c468706cfe68f Reviewed-on: http://codereview.qt.nokia.com/4058 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* remove unused codeLars Knoll2011-06-071-118/+0
|
* cleanups codeLars Knoll2011-06-071-58/+54
| | | | | | | 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-73/+2
| | | | | | | | | 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-688/+503
| | | | | | | | | 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