summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb
Commit message (Collapse)AuthorAgeFilesLines
* xcb: Use the state of the key event to process itAlbert Astals Cid2016-09-182-28/+46
| | | | | | | | | | Instead of the global state Task-number: QTBUG-48795 Change-Id: Ic2c545718adb68df41730e5a3bf25adb374ffce3 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* XCB Drop from external app: fix keyboard modifier stateFrederik Gladhorn2016-09-161-0/+3
| | | | | | | | | | | | Fix inspired by Qt 4 sources. When we get drop events that are not coming from the same application, it's unlikely that the keyboard modifiers are in a sensible state (the usual XCB events are not sent during drag and drop), so set the keyboard modifier state explicitly. Task-number: QTBUG-49645 Change-Id: I9360f2b7ffeaa5243a4dfe7ccf96df134c5d2156 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* xcb: Don't send "Qt::WindowNoState" event when hiding minimized windowBłażej Szczygieł2016-09-151-2/+7
| | | | | | | | | | | | | This prevents getting "QWidget::showEvent()" when hiding minimized widget on some WMs like Marco or Xfwm4. If QWindow is minimized and it gets the new "XCB_WM_STATE_WITHDRAWN" event from XCB, then don't change the QWindow state. Task-number: QTBUG-55942 Change-Id: I90cfc2bf55e507864ad8f26c8f569ea562c27314 Reviewed-by: Uli Schlachter <psychon@znc.in> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* fix build with qt-xcb and another installed qt in a system locationOswald Buddenhagen2016-08-252-0/+4
| | | | | | | amends fc1092cf, necessary because of (the earlier) a28364bc1. Change-Id: I5c86bcb27854994e59228fd205c799396464554d Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Fix QWidget::setWindowRole()Alexander Volkov2016-08-193-0/+26
| | | | | | | | | | | Introduce QXcbWindowFunctions::setWmWindowRole() and call it either from the implementation of QWidget::setWindowRole() or after the creation of the corresponding QWidgetWindow. Change-Id: I143450f4673dd707bb491c1d0f0e8b61d564283d Task-number: QTBUG-45484 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Ivan Čukić <ivan.cukic@kde.org>
* Disable switchable widget compositing when using XCB in Parallels VMAndy Nichols2016-08-174-1/+25
| | | | | | | | | | | | | | The Parallels 3D hardware acceleration does not seem to play nice with Qt Creator when switching between tabs that have OpenGL Qt Quick Content and those that have just raster widget content. QWidgetBackingstore has the ability to switch how content is flushed depending on if the SwitchableWidgetComposition capability is available. Previously for XCB it was always enabled, but should be disabled when using the GLX integration for the Parallels VM. Change-Id: I42e41456e0873f6780f5d0333dbfaaf8fcce4a5e Task-number: QTCREATORBUG-16742 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* xcb: Add qt.qpa.input.events and guard mouse event logs tooLaszlo Agocs2016-08-154-21/+30
| | | | | | | | | | | | | Make mouse behave like touch and scrolling does: only do high frequency qCDebugs when the category is enabled. Switch over mouse, touch and scroll event logging to a new sub-category: qt.qpa.input.events. This way qt.qpa.input in itself behaves sanely on xcb, similarly to f.ex. eglfs, giving only the basic, but important info. Change-Id: I8dd588e72ae9d1c66096489fa3c5291f6d318ca0 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* xcb: Don't activate bypassed windows on mouse pressBłażej Szczygieł2016-07-281-1/+4
| | | | | | | | | | | | | | | | | | | | | | | Windows with "Qt::BypassWindowManagerHint" flag can't be activated by mouse. They can be activated only from code calling "activateWindow()" or "requestActivate()" methods. The patch applies also for "Qt::ToolTip" and "Qt::Popup" windows which have implicit "Qt::BypassWindowManagerHint" flag. The patch fixes some major issues: - don't activate tooltips on mouse press - this causes that Qt "thinks" that original windows loses its focus causing e.g. that text cursor stops blinking, - don't activate X11 tray icon - this causes that the active window looses its focus by clicking tray icon. The patch restores the Qt4 behavior. Task-number: QTBUG-53993 Change-Id: I80b226f2f5ea0ebbfe8922c90d9da9f4132e8cce Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* XCB: Update the high DPI scaling in more conditionsThiago Macieira2016-07-061-1/+1
| | | | | | | | | I don't think fae8ee8b428ae7a406199e504b2d0eedd5059dbd was enough. I've started getting small fonts in Qt Creator under some other circumstances. Change-Id: I1cc7601489634e96833cfffd1456caea823aa84a Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* xcb: Send also "text/plain" when a "text/uri-list" is dropped.Urs Fleisch2016-07-021-1/+8
| | | | | | | | | | | | This will allow dropping of files from Qt applications to applications like Skype, which only accept "text/plain", but not "text/uri-list" or "text/x-moz-url". Task-number: QTBUG-53238 Change-Id: I01bca5c8e20647cedfc9323f542ab07f0cc48658 Reviewed-by: Dmitry Shachnev <mitya57@gmail.com> Reviewed-by: Błażej Szczygieł <spaz16@wp.pl> Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* Fix shortcut handling for level three and above shortcutsBernhard Scheirle2016-06-301-2/+13
| | | | | | | | | | | | | | | | | | | | | | Calling `xkb_state_update_mask` with correctly set `depressed_mods` allows xkb to return keys on level three or above (and not the equivalent level one key). To preserve level two shortcuts (return equivalent level one key) `depressed_mods` gets only set, if the pressed key is on level three or above. Example shortcuts which now will work: Shortcut German Layout (de) [AltGr is a level three switch] Ctrl+@ Ctrl+AltGr+Q Shift+1 Shift+1 (as before) Shortcut German Neo Layout (de neo) [1] [AltGr is a level five switch] Left AltGr+S [1] http://neo-layout.org Task-number: QTBUG-53121 Change-Id: I637a01edc9f2f92a5d3e7a24f5051fb1d3ac2f7f Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* correctly link xcb-static libOswald Buddenhagen2016-06-172-2/+2
| | | | | | | | | this apparently makes no difference except for not creating bogus .prl files - presumably, the correct path is coming from somewhere else already. Change-Id: Ia3f3c44e506ba14b533ff097f05acecf1e86cfb3 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* xcb: Fix transient parent and "Qt::Window" flagBłażej Szczygieł2016-06-081-6/+10
| | | | | | | | | | | | | | Don't set transient parent property when Qt::Window flag is set. Delete transient parent property if a window doesn't have a transient parent. Force setting standard window flags for Qt::Window only if there are no other flags. Amends 98c10a02c5b77e023471ad6993dc66b013889cfb Task-number: QTBUG-52550 Change-Id: I68ee715b632487e9dd0e7ffbbfc0c2cdd0f0e151 Reviewed-by: Dmitry Shachnev <mitya57@gmail.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* xcb: Disable GLX pbuffers with Chromium in VMsLaszlo Agocs2016-06-081-2/+4
| | | | | | | | Change-Id: I474e4a4ce424a92b46381eb26aeda811ed059819 Task-number: QTCREATORBUG-16252 Task-number: QTCREATORBUG-14937 Reviewed-by: Błażej Szczygieł <spaz16@wp.pl> Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* Update the high scaling settings after an XCB screen is addedThiago Macieira2016-05-301-0/+2
| | | | | | | | | | | | | Without this, the newly-added screen will still have the scaleFactorProperty unset, which means QScreen::devicePixelRatio will return 1.0. That differs from what happens if the screen had been detected when the application started. This is part of the fix for the bug report, but insufficient. Task-number: QTBUG-53500 Change-Id: Id3aab65533904562a6cbfffd14502365d86bd36d Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* xcb: Fix dropping URL on Firefox window.Urs Fleisch2016-05-181-9/+10
| | | | | | | | | | | | | | | | | When a URL is dropped on a Firefox window, the "text/x-moz-url" data takes precedence over the "text/uri-list". The "text/x-moz-url" is interpreted as UTF16, however, the data from Qt 5 applications is not in the correct format. The code to create correct UTF16 data exists, but it is not called for two reasons: The atomName will never be "text/x-moz-url" because it is changed to "text/uri-list" by mimeAtomToString() and the InternalMimeData::hasFormatHelper() case is already handled above and the else part will never be considered. This patch fixes the check and brings it into the right order. Task-number: QTBUG-49947 Change-Id: I5ebd31914cc6c1417c513c1ff09e0e858a16915d Reviewed-by: Dmitry Shachnev <mitya57@gmail.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* xcb: Fix drop of text/uri-list and text/html.Urs Fleisch2016-05-181-11/+31
| | | | | | | | | | | | | When dropping URLs from Firefox or Chrome, the contents are encoded as UTF16, but not correctly decoded. Moreover, the special handling of "text/x-moz-url" drops does not work because this format is converted to "text/uri-list" before. This fixes the handling for URL list and also for UTF16 "text/html". Task-number: QTBUG-47981 Change-Id: I1153f21ede07b2bfe4d104e0fe8bc8487ec5c165 Reviewed-by: Błażej Szczygieł <spaz16@wp.pl> Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* xcb: Properly interpret data.l[0] field of XdndStatus messageAlexander Volkov2016-05-121-1/+1
| | | | | | | | | | | | | | The standard https://freedesktop.org/wiki/Specifications/XDND/ states: "In order for the proxy window to behave correctly, the appropriate field of the client messages, window or data.l[0], must contain the ID of the window in which the mouse is located, not the proxy window that is receiving the messages." So compare it with the current target window instead of the current proxy window. Change-Id: Ie31fd3aeadebcf5a9be7b9a9194f35a4ec7bdebb Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* xcb: Properly unset mousePressWindow()Błażej Szczygieł2016-05-091-2/+7
| | | | | | | | | | | | In some cases the mouse release event won't arrive, i.e. when window is minimized on button press. Check for mouse buttons state on mouse move event and properly unset the mousePressWindow to avoid blocking enter/leave events in this case. Amends: c511466d747d99ee76465cfe90ce594fa1f27469 Change-Id: I543a75104f528df1bf644bace13f78a6af017455 Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* QXcbDrag: forward mouse release event to initiator windowAlberto Mardegan2016-05-092-0/+16
| | | | | | | | | | | | | The mouse release event which ends the drag and drop operation must be forwarded to the window where the drag started, and not to the QShapedPixmapWindow, which is not supposed to handle input events. Task-number: QTBUG-52541 Change-Id: I24a7c7b331a06342ac28b420ff9467aa05fe00dd Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Błażej Szczygieł <spaz16@wp.pl> Reviewed-by: Dmitry Shachnev <mitya57@gmail.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* Revert "egl: Reshuffle headers to help less fortunate systems with X11"Liang Qi2016-05-042-2/+2
| | | | | | | | | This reverts commit ecf127505effbbf4dbfd1e7cb9561de5dae51bf2. ecf12750 breaks the build of qtwayland. Change-Id: If8bf04f035aa47e4e867d201ec7d95b0d3e18317 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* xcb: don't compress tablet motion eventsShawn Rutledge2016-05-043-8/+21
| | | | | | | | | | | | | | | 7edd10e6c added this compression feature, but it's not a good idea for drawing-tablet applications, because smooth drawing depends on receiving every movement of the stylus. Also show the device ID in qt.qpa.input.devices category logging. [ChangeLog][X11] The new X event compression feature that was added in 5.6.0 no longer applies to motion events from drawing tablets. Task-number: QTBUG-44964 Change-Id: Icd2ca8ca77d8f80c2f39160c74208db10e382501 Reviewed-by: Gatis Paeglis <gatis.paeglis@theqtcompany.com>
* egl: Reshuffle headers to help less fortunate systems with X11Laszlo Agocs2016-05-032-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | EGL headers including X headers has traditionally been problematic due to getting macros for Status, None, etc. In most cases this is not an issue anymore because on embedded one will almost always use a driver targeting the framebuffer or DRM/KMS and therefore the EGL headers do not pull in X dependencies. Furthermore, Mesa supports MESA_EGL_NO_X11_HEADERS which we set, avoiding the problem altogether with Mesa regardless of targeting X11 or KMS. However, other drivers do not have this option. On i.MX6 for instance, targeting X11 is problematic due to not having EGL_API_FB defined, which in turn means the EGL headers pulls in X headers in order to be able to define the native display and window types as Display and Window. Try to play nice with this use case by reshuffling the includes and undefining the problematic names. Task-number: QTBUG-52928 Change-Id: I059f26b340b6e442e7296055915d18f5a1ce7a7f Reviewed-by: Louai Al-Khanji <louai.al-khanji@qt.io>
* xcb: Fix drag and drop to Emacs.Urs Fleisch2016-05-021-2/+2
| | | | | | | | | | | | Unfortunately, the improved patch for QTBUG-45812 fixed things for Chromium, but did no longer work for Emacs. This fixes commit [269fdb] to make it work for both Emacs and Chromium. Task-number: QTBUG-45812 Change-Id: I2fca708503f27679681bc6959de1ad94943a063e Reviewed-by: Dmitry Shachnev <mitya57@gmail.com> Reviewed-by: Błażej Szczygieł <spaz16@wp.pl> Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* xcb: Fix drag and drop to applications like Emacs and Chromium.Urs Fleisch2016-04-251-11/+44
| | | | | | | | | | | | Drops without matching time stamp do not work. I have fixed the issue by reanimating the findXdndAwareParent() function (adapted to XCB) and using it to find a matching transaction if all else fails. Task-number: QTBUG-45812 Change-Id: Ibca15bbab02ccf2f25280418e9edf36972ebf9a0 Reviewed-by: Błażej Szczygieł <spaz16@wp.pl> Reviewed-by: Dmitry Shachnev <mitya57@gmail.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* xcb: Properly process enter/leave eventsBłażej Szczygieł2016-04-223-15/+64
| | | | | | | | | | | | | | | | | | Ignore enter/leave events when there is a window under mouse button. Unset window under mouse button if other window is grabbed. Smarter ignoring (un)grab ancestor enter/leave event. Ignore ungrab inferior leave event. Amends: b9f76db30d261421e4da58f29053181af04ceb4d Task-number: QTBUG-46576 Task-number: QTBUG-51573 Task-number: QTBUG-52332 Task-number: QTBUG-52488 Change-Id: I8d926309aa60bb8929728691c31ecf93d1e299ad Reviewed-by: Dmitry Shachnev <mitya57@gmail.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* Xcb: Fix compilation with -no-c++11Kai Koehne2016-04-171-1/+1
| | | | | | | | | nullptr (introduced in commit d7db6c6c194) is a C++11 keyword. Change-Id: Id6aa639f5d2ddbe8b228f8648754c2b24ef53799 Reviewed-by: David Rosca <nowrep@gmail.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com> Reviewed-by: Uli Schlachter <psychon@znc.in>
* xcb: Fix interpretation of the size from RRCrtcChangeNotifyAlexander Volkov2016-04-131-0/+3
| | | | | | | | | | | | | | | The size in RRCrtcChangeNotify is a size of the mode and it is not rotated. At the same time when we call RRGetCrtcInfo, it returns a rotated size, which is then passed to QXcbScreen::updateGeometry(const QRect &geom, uint8_t rotation). So to pass the expected size to QXcbScreen::updateGeometry() after receiving RRCrtcChangeNotify, we should rotate the size according the screen rotation. Change-Id: If5b5b52403b077d3cd64b9a05d938bb9ac00b1e0 Reviewed-by: Daniel Vrátil <daniel.vratil@kdab.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Fix assert with Meta modifierJoni Poikelin2016-04-051-2/+1
| | | | | | | | | Meta modifier is not found in some configurations which triggers an assert. Instead of assert, ignore the modifier if it is not found. Task-number: QTBUG-52298 Change-Id: I258cee4014a30162afebb423eadaf07ef0ed6a1f Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* xcb: Merge _NET_WM_STATE hints instead of overwritingDavid Rosca2016-03-181-8/+24
| | | | | | | | | | | This makes possible to set custom _NET_WM_STATE hints before showing the window. Change-Id: I86ad3863f7a8b3bb610a31b9af4b02c9d38eb111 Task-number: QTBUG-26978 Reviewed-by: Ilya Kotov Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com> Reviewed-by: Uli Schlachter <psychon@znc.in>
* xcb: Initialize all xcb_client_message_event_t members before useShawn Rutledge2016-03-154-1/+13
| | | | | Change-Id: I01e4b69b138fd19fc7e67751d93adebc1326b2f9 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* xcb: mark mouse events from tablet devices as synthesizedShawn Rutledge2016-03-094-22/+32
| | | | | | Task-number: QTBUG-51617 Change-Id: Ic1d258c56165947ff821b1bf4d044bcf29b41a3b Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* consistently put {qt,qml}_{module,plugin} at the end of project filesOswald Buddenhagen2016-03-074-17/+13
| | | | | | | | this fixes static builds by ensuring that all dependencies are exported. Task-number: QTBUG-51071 Change-Id: Icbce502dcbcb4d4b4d922c42679f44e2cc930bf3 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Silence the warning: Unhandled client message: "_GTK_LOAD_ICONTHEMES"Thiago Macieira2016-03-053-3/+7
| | | | | | | | Qt Creator keeps printing that warning. Change-Id: I0c94a5c2846b48c8aea7ffff1435775f04234656 Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Expose the number of X screen through the QXcbScreenFunctionsAlexander Volkov2016-03-053-0/+14
| | | | | | | | | | | X screen corresponds to Qt virtual desktop, and RandR output corresponds to QScreen. There can be more than one X screen, so we need a way to get the number of X screen for QScreen, in particular for the right implementation of some methods in QX11Info. Change-Id: Ib5e38703bf11ae08bb283f26a7b7b15f1a5e8671 Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* xcb: resourceType names must have only small lettersBłażej Szczygieł2016-03-041-1/+1
| | | | | Change-Id: I563ae26c9e7e6111399fd0b9af7bfb3ff750b34a Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* xcb: Deliver mouse enter event to window when closing modal windowBłażej Szczygieł2016-02-241-0/+48
| | | | | | | | | | | | When a modal window is closed and the mouse is not under the modal window - find a proper window and send a fake enter event. Added auto test for checking enter event on window when modal window is closed. Task-number: QTBUG-35109 Change-Id: I370b52d386503820ac9de21e6d05fd019ca456ec Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* xcb: include <cmath>Shawn Rutledge2016-02-191-0/+1
| | | | | | | Fix trouble compiling with gcc 4.4.7 on Centos 6 Change-Id: Id81bd570e896507a07388257c4f75f80b4b468fd Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* xcb: properly initialize size in millimeters if XRandR is not supportedShawn Rutledge2016-02-191-0/+3
| | | | | | | | | | | | | | QXcbScreen did not set the m_sizeMillimeters if the xcb connection does not support XRandR. This caused physicalSize() to return an invalid QSize. This change fixes a regression compared to Qt 5.4 discovered by a broken unit test for KWin on KDE's CI system, which uses Xvfb and by that no XRandR support. Task-number: QTBUG-49885 Change-Id: Ie472a194ba410f0748ccfda8aa467727fafa10a3 Reviewed-by: Błażej Szczygieł <spaz16@wp.pl> Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* xcb: Properly initialize available geometry when XRandR is missingAlexander Volkov2016-02-191-1/+1
| | | | | | | | Take an intersection of the screen geometry and the work area. Change-Id: Ia61d090ac103cb4d13d656ec09037f642b255a79 Reviewed-by: Błażej Szczygieł <spaz16@wp.pl> Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* xcb: Fix drag and drop between xcb screensBłażej Szczygieł2016-02-181-0/+4
| | | | | | | | | | | Set the proper screen before creating a shaped pixmap window in QBasicDrag::startDrag(). Grab mouse again when D&D window is recreated. Task-number: QTBUG-51215 Change-Id: I5cb47d3b11672b56d17b32072d84a722bdcdcd9a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.6.0' into 5.6Liang Qi2016-02-151-1/+1
|\ | | | | | | Change-Id: I0b190005377a23a91da3563428e223b8a3b18333
| * Do not change depth for the backingstore's underlying imageLaszlo Agocs2016-02-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The depth cannot change. This means that RGB16 cannot be upgraded to 8565 for example as that would be a 24 bit format whereas the backingstores and the underlying platform may expect a 16 bit format. Task-number: QTBUG-50869 Change-Id: I648b39287d43a80fae8097a33bbf3b8bbdcb8816 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* | Reduce allocations by using reserve()Sérgio Martins2016-02-071-1/+3
| | | | | | | | | | Change-Id: If34fa53402985f6b3c5e7217bce4a1177af835b6 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | xcb: Fix not delivering focusIn event on hide/showAlexander Bersenev2016-02-061-4/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Consider a window which was hidden and shown with hide() and show() methods and mouse pointer was in window when hide() was called. At first, window got focusOutEvent and then Qt library sends X server a message to unmap the window. Then X server will send client two messages: 1) FocusOut(10) detail=Nonlinear(0x03) 2) FocusIn(9) detail=Pointer(0x05) QXcbWindow has a logic for not seting active window to 0 if there is a FocusIn coming (see QXcbWindow::doFocusOut). So QGuiApplicationPrivate::focus_window still points to the current window. Then when show() is called, qt compares previous focus with new focus and, since they are equal, doesn't do anything. Event focusInEvent isn't delivered to the window. Here are two links why X server sends FocusIn just after FocusOut: http://lists.freedesktop.org/archives/xorg/2008-December/041684.html https://tronche.com/gui/x/xlib/events/input-focus/normal-and-grabbed.html Proposed fix ignores FocusIn events with detail==Pointer. The text of explaining comment is taken from the Chromium project: https://chromium.googlesource.com/chromium/src/+/master/ui/views/widget/desktop_aura/x11_desktop_handler.cc from X11DesktopHandler::ProcessXEvent function. [ChangeLog][module][Linux/XCB] Fix not delivering focusIn event on hide/show with XCB Task-number: QTBUG-49071 Change-Id: I433c8b638834c25f113cc134ee4185778c44f540 Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Lisandro Damián Nicanor Pérez Meyer <perezmeyer@gmail.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* | xcb: Correct enter/leave event handling when mouse button is pressedBłażej Szczygieł2016-02-061-3/+10
| | | | | | | | | | | | | | | | | | | | This patch fixes cursor shape when mouse leaves the window and enters the window again with pressed mouse button - ignore the mouse enter and leave event when any of mouse buttons is pressed. Task-number: QTBUG-46576 Change-Id: Id6ce50cd0d66da51a251d4811bc42cd31606de29 Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* | xcb: XInput2 fixes, enter/leave event fixesBłażej Szczygieł2016-02-067-95/+183
| | | | | | | | | | | | | | | | | | | | | | | | | | Added enter/leave event handling in XInput2 to avoid problems with those events when the mouse is grabbed. This commit amends: 53d289ec4c0f512a3475da4bbf1f940cd6838ace This commit amends: ed2e15780385f7cf0a0d3aedc9cb2059d470bd58 Task-number: QTBUG-50340 Change-Id: I7a120b46daa4f8fa4c218346273ae90b6abfa156 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* | xcb: Take into account the orientation of touch pointsAlexander Volkov2016-02-033-5/+40
|/ | | | | | | | | | | Add support for ABS_MT_ORIENTATION value. Linux kernel multi-touch protocol allows it to be in a wide range: https://www.kernel.org/doc/Documentation/input/multi-touch-protocol.txt, but we need only to know whether the touch point rect is rotated by 90 degress. So adjust the angle to the closest axis. Change-Id: Ie20725dc4bef509e2f9b19571efc69502d00c019 Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* xcb: Ignore Mouse Enter:ungrab, Leave:grab events.Gatis Paeglis2016-02-011-2/+3
| | | | | | | | | | | | | | | | | These are "special" XCB_NOTIFY_MODE_(UN)GRAB Enter/Leave events and we do not have handlers for them in Qt, so lets just ignore events with this mode. Patch fixes Qt+ArchLinux+Awesome WM issues, where Qt applications were receiving Enter/Leave events for mouse clicks in the application window. This patch does not affect "normal" XCB_NOTIFY_MODE_NORMAL Enter/Leave event handling. Task-number: QTBUG-45818 Change-Id: Ib70fdd9ed9200364a9753904f8e63d1ed9e2072f Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* Don't use QStringLiteral in comparisonsAnton Kudryavtsev2016-01-281-1/+1
| | | | | | | | | | | | | | | For QLatin1String, operator== is overloaded, so comparing to a latin-1 (C) string literal is efficient, since strlen() is comparatively fast. OTOH, QStringLiteral, when not using RVO, litters the code with QString dtor calls, which are not inline. Worse, absent lambdas, it even allocates memory. So, just compare using QLatin1String instead. Change-Id: I761b2b26ab5b416bc695f524a9ee607dacf0a7b2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>