summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb
Commit message (Collapse)AuthorAgeFilesLines
* qtlite: Fix build libs with -no-feature-regularexpressionMikhail Svetkin2019-01-271-1/+5
| | | | | Change-Id: I427ff1f8f4986fbf466aba60a9d3de614c1e006f Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* xcb: Avoid repaint lags with DnDAlexander Volkov2019-01-253-2/+19
| | | | | | | | | | | | | | | | | | | | | | | The lags can be seen when dragged data is requested for a MIME type. This leads to calling QXcbClipboard::waitForClipboardEvent() which runs a loop in the GUI thread and processes events from QXcbEventQueue. The loop ends when a corresponding event is received, otherwise it makes a delay of 50 ms before the next iteration. Sync with QXcbEventQueue thread by QWaitCondition instead of using the delay. This way the loop will end as soon as possible and Expose events will be processed with minimal delay. Task-number: QTBUG-44849 Fixes: QTBUG-55442 Fixes: QTBUG-62344 Fixes: QTBUG-73253 Change-Id: Ie18d63b51a7260c83d53ffe1169b25e5135dd73b Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io> Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* xcb: fix initialization of XRandr and XRenderAndreas2019-01-131-4/+4
| | | | | | Fixes: QTBUG-72957 Change-Id: Ia698eef5dae4e2d35ca2e565fbdc23da40c83d8a Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* Merge remote-tracking branch 'origin/5.12' into 5.12.1Liang Qi2019-01-088-54/+13
|\ | | | | | | | | | | | | Conflicts: src/widgets/kernel/qtooltip.cpp Change-Id: Ic2f9a425359050eb56b3a4e5162cf5e3447058c8
| * XCB: Use application name for X11 selection owner nameMax Mazurov2019-01-071-1/+2
| | | | | | | | | | | | | | | | | | This makes it possible for clipboard managers (or other scripts) to distinguish different Qt applications and act differently. Change-Id: I5bc5a1914b51127b24a81142ca9dbdb196ffd0d8 Fixes: QTBUG-72806 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
| * configure: add XCB GL integration featuresGatis Paeglis2019-01-031-2/+2
| | | | | | | | | | | | | | | | | | This way Qt builders can see if everything has been configured properly for XCB GL integrations at configure time, instead of at the end of the build process. Change-Id: I00740cc2edd7f6ecfcda0ddfb22649d1b4db4aa2 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
| * configure: make xcb-render a hard dependency for xcb pluginGatis Paeglis2019-01-036-38/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Its been available by default since at least libxcb 1.5, and in Qt 5.12 we have even increased the minimal required libxcb version to 1.9. Having configure switches for extensions is a legacy from Qt 4. There are still few exceptions in Qt5, where the reason is that we have to support Linux distributions that don't ship recent enough libxcb. Task-number: QTBUG-30939 Change-Id: I0a02d93b6411119ec018b0cb8fe5c63beeab62ee Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| * configure: properly atomize render vs. renderutilGatis Paeglis2019-01-033-13/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | xcb-render is a C interface for X11 extension. xcb-render-util is a utility library that complements xcb-render by providing convenience functions and interfaces which make the raw X protocol more usable. Bumped xcb-render-util version to avoid having include hacks. We were bundling 8 years old release 0.3.8 (Apr, 2011). 0.3.9 is the latest release and it was relesed 4,5 years ago (Jun, 2014). All CI machines have 0.3.9. The only thing that have changed in xcb-render-util sources since 2011 is that we don't need to have various hacks to include xcb_renderutil.h in C++ files. Upgrading bundled XCB libs was also requested in QTBUG-71109. Task-number: QTBUG-71109 Change-Id: Ib261f7584ad81be95660123b007e2200a3042f4c Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
| * configure: properly atomize xcb-syslibsOswald Buddenhagen2018-12-171-2/+3
| | | | | | | | | | | | | | | | | | | | as it is now cheap to test for individual libraries and headers, split the xcb_syslibs monster-library into its parts. the compile test remains a single blob, though, as that didn't get any cheaper. whether it's worth keeping it in the first place is debatable. Change-Id: Id7cae7925bb4d77069437512abecf14feea749f2 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* | Fix build with Clang 3.8Thiago Macieira2018-12-191-0/+4
|/ | | | | | | | | | | | | | Commit 128a6eec065dfe683e6d776183d63908ca02e8fb replaced the static, unsorted list with a sorting implementation via templates. qmakearray_p.h:109:8: fatal error: recursive template instantiation exceeded maximum depth of 256 qmakearray_p.h:111:39: note: during template argument deduction for class template partial specialization 'QuickSortFilter<Predicate, QuickSortData<type-parameter-0-1, type-parameter-0-2...> >' [with Predicate = LessThan, Head = Xkb2Qt<269025163, 16777462>, Tail = ...] Fixes: QTBUG-72579 Change-Id: I548dbfddb69b4fd6a0a3fffd15717ac2bf2d7361 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io> Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
* xcb: remove old work-around for building with util-wmGatis Paeglis2018-11-301-54/+29
| | | | | | | | | | | | | | | | | | Commits that added this code: 7ce8491280990350162933a0716d1b014f65aeb6 and f005dee1b3692a09e47782dcff9b5b07aa659b51 I guess this was a work-around, before we started bundling XCB libs a year later in 21bd66e1ea06e466754ab06ee2c5f8b737bb4bd7 0.3.8 was released in 2011-04-26 and we are bundling 0.3.9, so it is safe to remove the include work-around as well. Change-Id: I5794f40d86e10ebdad984aa4b61311979aaadcf3 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* xcb: fix issue with dialogs hidden by other windowsGatis Paeglis2018-11-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This was a regression from Qt4, due to not setting the window group leader in WM_HINTS property. Qt4 did set this property. It was not obvious that something was missing because of the similarly named WM_CLIENT_LEADER property, which we do set. Testing revealed that setting WM_CLIENT_LEADER is sufficient on some DEs, e.g. KDE, Unity, but did not have the desired effect on e.g Gnome and XFCE. EWMH/ICCCM specs are known to be ambiguous, WM_CLIENT_LEADER is only mentioned in the section on the session management, so it is not surprising that there is this inconsistency between various WMs. This patch merely restores a lost WM hint. This solves the reported issues on major desktops. If we support calling show() on a dialog before its parent has been shown is still an open question, which should be handled in QTBUG-72040. Task-number: QTBUG-56829 Fixes: QTBUG-46626 Fixes: QTBUG-70756 Task-number: QTBUG-72040 Change-Id: Id2c575850e5f4f5af3e57963c577d33572e30b6e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* src/3rdparty: remove xkbcommonGatis Paeglis2018-11-301-10/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The only reason why we bundled this library ~6 years ago was because it was not available on distributions that we supported at the time, but library was a hard dependency for XCB plugin. See: 2122e731abdb619249df89642c0800640b2fa428 Later more and more projects started to depend on it (compose input context plugin, libinput, mir, wayland). The configuration had become too complex, because some projects used bundled and some used the version from the system. Having libxkbcommon in 3rdparty sources is not necessary anymore, after RHEL 6.6 was removed from the list of supported platforms for Qt 5.12. Ubuntu 16.04 - 0.5.0 Ubuntu 18.04 - 0.8.0 openSUSE 42.3 - 0.6.1 RHEL-7.4 - 0.7.1 This will also simplify further development, e.g. QTBUG-42181 Bumped the minimal required version 0.4.1 -> 0.5.0. The patch also contains a code marked with "TRANSITION HACK", which is temporary needed so we can update the dependent wayland module. [ChangeLog][Third-Party Code] Removed xkbcommon from bundled sources. This library is present on all supported platforms. The minimal required version now is 0.5.0. Task-number: QTBUG-65503 Change-Id: Iec50829bb6f8fbb19f3c4e4ad62e332beb837de5 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* xcb: Use std::move and pass argument by rvalue referenceMikhail Svetkin2018-11-292-2/+2
| | | | | | | | It will avoid a creation of temporary object and avoid copying. Change-Id: Ifae5f6f9e36bcb07f4bacc31f151f8adcfa621a3 Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru> Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* xcb: free leaking clipboard eventsKirill Burtsev2018-11-281-3/+4
| | | | | | | The leak has been there since the beginnings of Qt 5.0. Change-Id: I238181dcc63cb4cf8a60b5c565b184d8278d0315 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* xcb: Fix leaking events on destroyKirill Burtsev2018-11-281-1/+4
| | | | | | | This patch amends 243c3044b647357ca6df79ac1497ae43de957d31 Change-Id: Ieeebb1e2b94d7c191bf80a1f439c826c406a0c08 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* Remove need for glXGetProcAddressARBMichal Klocek2018-11-221-42/+1
| | | | | | | | We do already require glXGetProcAddress in line 241. Fixes: QTBUG-71488 Change-Id: Id0f3bc256a71097241b99d2dcba927c1165e980e Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* Merge remote-tracking branch 'origin/5.11' into 5.12Liang Qi2018-11-191-2/+0
|\ | | | | | | | | | | | | Conflicts: src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm Change-Id: I66a08c770767a93cd26535689e3e7806486aab06
| * Purge some unused code for the OpenGL library nameEdward Welbourne2018-11-121-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We had a global static, a setter for it (that's nowhere used within Qt code) and a getter for it whose only use was commented out. Neither was declared in any header; the getter's commented-out client had a local extern declaration at the point of (non-)use. Found while reviewing a change to the next few lines of code after the commented-out use of the getter. Change-Id: I393d56219cb7dd7cf836ca80e1bdd605a2914003 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* | Fix image grab when XCB is rgb-swappingAllan Sandfeld Jensen2018-11-111-0/+3
| | | | | | | | | | | | | | | | | | | | The rgbSwap produces an image that fits the X-server, but not one that fits our internal image definitions, so instead return our internal image. Task-number: QTBUG-56806 Change-Id: I25aedf7279bcd86792213b11dbd07a77b49538de Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into 5.12Liang Qi2018-11-091-1/+1
|\| | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf qmake/Makefile.unix src/gui/text/qtextdocument.cpp src/gui/text/qtextdocument.h Change-Id: Iba26da0ecbf2aa4ff4b956391cfb373f977f88c9
| * Modernize the "textcodec" featureLiang Qi2018-11-071-1/+1
| | | | | | | | | | | | | | | | | | Also clean up QTextCodec usage in qmake build and some includes of qtextcodec.h. Change-Id: I0475b82690024054add4e85a8724c8ea3adcf62a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | xcb: fix regression with open/close hand cursorsGatis Paeglis2018-11-071-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Linux the correspondence between cursor functions and names of cursors has never been standardized. Projects have either assembled their own cursor function-to-name lookup table or borrowed the table from other projects. The origins of our table is described in QTBUG-71423. On Ubuntu the default theme is called Adwaita. Before bd72950fbedc457fb997e99beff4767505ff5d8f, we would not find a cursor for 'openhand' and would fall-back to QXcbCursor:: createNonStandardCursor(). Which was sub-optimal, because the cursors created by the fall-back path don't look like the themed ones. But the situation was worse after bd72950fb (hence the regression) - the 'openhand' fall-back name 'fleur' is a symbolic link to 'grabbing', so we would get into a situation where Qt::OpenHandCursor displays the same as Qt::ClosedHandCursor. This patch adds a correct fall-back name for 'openhand' on Adwaita, which is 'grab'. 'grab' actually is a symbolic link to 'hand1', but 'hand1' with other theams is a pointing hand cursor, that is why we use the symbolic link's name in this case. The lookup table still appears to be incomplete when comparing e.g with KWin. Eventually we need to revise the table and put in a common place so it can be shared between X11 and Wayland, but is out-of-scope for this patch (see QTBUG-71423). Fixes: QTBUG-71296 Task-number: QTBUG-71423 Change-Id: I247ed4b346c2cd3fe1c7fd0440d3763e0033346b Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | White-list more recent Mesa version for multi-threadingAllan Sandfeld Jensen2018-11-061-35/+25
| | | | | | | | | | | | | | | | | | | | The issue we had has been fixed for years, but was unfortunately in libxcb which we can't check at runtime. Instead assume very recent Mesa drivers works. Change-Id: I5fdd726b480b77edbedc0f369ae82ab4acbb77c9 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | Merge remote-tracking branch 'origin/5.12.0' into 5.12Liang Qi2018-11-053-8/+3
|\ \ | | | | | | | | | Change-Id: I12f26470e01a8582d0f02f51e20d5b742bd95d6f
| * | Merge remote-tracking branch 'origin/5.11' into 5.12.0Liang Qi2018-11-052-8/+1
| |\| | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/cocoa/qcocoaglcontext.mm src/plugins/platforms/xcb/qxcbscreen.h Change-Id: If9b4c67288396ff7346088ce591c7a3588b51979
| | * xcb: Don't get initial screen rotationBłażej Szczygieł2018-10-292-8/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "xcb_randr_get_screen_info" can be slow and in some configurations can cause short mouse cursor freezes (which will happen on Qt application startup). Initial screen rotation was used only to not handle possible redundant screen change event. Fixes: QTBUG-70760 Change-Id: I9f01325a045d2c82c4dd2fce91a18a34e54a4bcd Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
| * | Merge 5.12 into 5.12.0Oswald Buddenhagen2018-10-304-7/+8
| |\ \ | | | | | | | | | | | | Change-Id: I31f8eff4fdfe56cbb7f1450be8d351991966c6d8
| * | | Fix out of bounds memory access when setting motif window hint propertiesSimon Hausmann2018-10-251-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit b4bd5f9df3e69da707513ba544537c80a8564fb4 removed two members from the mwm hints structure but told xcb_change_property that the structure has still five members when it had been reduced to three. This lead to xcb_change_property accessing memory out of bounds. As identified by Gatis, the safest option to avoid the access is to add the two members again. Other window managers may be expecting their presence in the window property. Change-Id: Id4f0c9536cd317c35f2c6ebd1ac9ccc6f72de6a5 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io> Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
* | | | Remove unused variableLars Knoll2018-11-021-3/+0
| | | | | | | | | | | | | | | | | | | | Change-Id: I241969d10502e944f7a73971771730d43dd2784f Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* | | | xcb: cleanup _NET_WM_STATE handlingGatis Paeglis2018-11-012-93/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use function name overloading for all of _NET_WM_STATE setters for a mapped window, instead of few similar sounding functions, where all do the same thing. For an unmapped window rename updateNetWmStateBeforeMap() -> setNetWmStateOnUnmappedWindow(). Merge setNetWmStates(NetWmStates) into setNetWmStateOnUnmappedWindow() and add a comment explaining why it does what it does, as it was not obvious. Internally there are 2 variants: a) When a window is already mapped, to change the window state we send XCB_CLIENT_MESSAGE(_NET_WM_STATE) messages to the root window as per EWMH spec. The Window Manager MUST keep this property updated to reflect the current state of the window. If this variant of the overload is called while a window is not mapped yet, it does nothing. WM would ignore this message anyway. The state change is not lost, it will be set later and that is where the second variant comes in. b) On an unmapped window we can set _NET_WM_STATE by using setNetWmStateOnUnmappedWindow(). This function will read QWindow properties and set all of them via one xcb_change_property(_NET_WM_STATE) call. We do this inside QXcbWindow::show(), where we know that QWindow state properties won't change anymore until it gets mapped. Once it is mapped, we use the other variant. This patch doesn't change any functionality, just makes the code easier to follow. Change-Id: I4f4703a35de083fcfd398112eabd0a5aec358e51 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | | xcb: move clipboard code out of QXcbConnection::processXcbEventsGatis Paeglis2018-10-314-127/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... to QXcbConnection::handleXcbEvent(), which is where it belongs. This patch amends bc6f5b3ff61f4b1dea14084349702f2895feda66 (Sep, 2013). And some other design cleanups. Change-Id: Iefa0793c58de16a59d2294f38311e1e8dfa3035b Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | | | xcb: remove leftover functionGatis Paeglis2018-10-311-1/+0
| |/ / |/| | | | | | | | | | | | | | | | | It was forgotten in 4050ee6ac7da0e5e7414c699c3cd4e26193c653d Change-Id: Icace56161b8ae372dba105f82da0d1c1b69542c1 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* | | xcb: fix unresponsive mouse clicks after VT switchGatis Paeglis2018-10-254-7/+8
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | This patch amends d67214302f269242ae3d8d2b962fd91ec42c979e. The issue was caused by mistakenly interchanging m_hasXRender <-> m_hasXRandr. Also renamed selectXRandrEvents() -> xrandrSelectEvents() to be more consistent with xi2Select*() API. And moved the xrandrSelectEvents() to QXcbConnection ctor for the same reason. Fixes: QTBUG-71305 Change-Id: I26f9bac3ae1f997f53134eb97f3569fb6d3c13fe Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Restore "Do not create instance of QPlatformIntegration for invalid displays"Gatis Paeglis2018-10-183-12/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is amended version of 67cc8fea106c35c7ca75bf476667d07b3bbf3257, which was temporary reverted to simplify integration of conflicting patches. What was amended: - Dropped the factory interface. It is sufficiently clean to check for QXcbConnection::isConnected(). Task-number: QTBUG-68859 Change-Id: I810897b3ea20e356fc4d62e6f01231fd287962dc Reviewed-by: Johan Helsing <johan.helsing@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | xcb: use 128 as a reference DPI for small screensMathieu Velten2018-10-171-1/+5
| | | | | | | | | | | | | | | | | | | | | | This is a better version of 23b139038a1dc9a769a358ab112453abcdd39290 which was reverted. Task-number: QTBUG-68620 Task-number: QTBUG-53022 Task-number: QTBUG-57211 Change-Id: I0b37fc261945c542bbfb30cecfe4b0a97c655e3c Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | xcb: cleanup _MOTIF_WM_HINTS handlingGatis Paeglis2018-10-174-139/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The existing code was difficult to follow, it contained some code duplication, inconsistencies and legacy code (mwm/dtwm support). Most of this code was copied over from Qt 4 as is, with some unexplainable (accidental?) modifications. Most of Motif code was never ported over to Qt5. In addition to the properties and protocols described in ICCCM, Motif uses properties and protocols of its own. In Qt4 we had an implementation of Motif DnD protocol. This was never ported over and mentions of this support was removed on Oct 2012, 4c41cb48d0356a28190c300fd4cc5e03f824b870. Nobody has complained for all these years, so it is safe to remove the remaining leftovers. Motif style support also was removed around the same time 4c41cb48d0356a28190c300fd4cc5e03f824b870. Keeping only those Motif hints that do not have any replacement in modern window manager specifications - decorations hints. MWM_INPUT_*MODEL* in modern specs was replaced by _NET_WM_STATE_MODAL The existing code was setting _MOTIF_WM_HINTS from 2 places - from QWindow setter (::setWindowFlags) and again before mapping the window (::show). We don't need the logic from updateMotifWmHintsBeforeMap(). That function read the current value of _MOTIF_WM_HINTS and merged in few additional hints, hints that are not relevant based on all the reasons from above. Change-Id: I9cb10bcad9bfac8762e3909895c2e9de613e622c Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | xcb: qxcbconnection_screensGatis Paeglis2018-10-174-382/+426
| | | | | | | | | | | | | | | | | | | | Moved all screen handling method implementations into qxcbconnection_screens, the same way we are doing with xinput2 code in qxcbconnection_xi.cpp. The goal was to reduce the size of qxcbconnection.h/cpp. Change-Id: I9bad55ca4b0874171b7313d923b13c66034c3b3e Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | xcb: qxcbconnection_basicGatis Paeglis2018-10-1714-1027/+1317
| | | | | | | | | | | | | | | | | | | | | | | | A basic base class that creates a connection and initializes extensions. The goal was to reduce the size of qxcbconnection.h/cpp. Made QXcbAtom into a class that handles atom initialization and exposes the relevant APIs. Before this patch, all of that logic was inside of qxcbconnection.h/cpp. Change-Id: Ia893c3b31e2343dfbe62fe2aa6bfd0017abf46ea Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into 5.12Liang Qi2018-10-171-2/+4
|\| | | | | | | | | | | | | | | Conflicts: src/plugins/platformthemes/platformthemes.pro src/printsupport/kernel/qplatformprintdevice.cpp Change-Id: Iac01729ad954bb1c7af5867d982eb243b2139ee6
| * Only use a translucent background if there is support for alphaAndy Shaw2018-10-121-2/+4
| | | | | | | | | | | | Change-Id: Ia8d9e543fac4b6e790fa38cf04c5a782d72d72df Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* | xcb: respect QEventLoop::ExcludeUserInputEvents in native event handlersGatis Paeglis2018-10-166-11/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was a regression from Qt 4. Before this patch, we supported filtering events only at QWindowSystemInterface level, but to properly support filtering in QAbstractEventDispatcher::filterNativeEvent, we have to filter the events earlier. Now it is possible to enable/disable this feature for platforms that support native event filtering. The mapping of which events are user input events were taken from QWindowSystemInterfacePrivate::EventType. Task-number: QTBUG-69687 Change-Id: I9a5fb9f999451c47abcdc83fdcc129b5eeb55447 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | xcb: rework connection error handlingGatis Paeglis2018-10-162-9/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch reworks 0b1ce5db9e04b4c28713e87306fcea020c3e428b. Just by looking at the source code it was unclear why is this signal-and-slot connection necessary. It doesn't do anything on normal exit - at the time we call dtor of this class, QCoreApplication::instance() already is nullptr, which means that no further event processing happens and we never get this signal. Without digging into git history it may appear that the goal was to process the remaining events on application exit, which would be a questionable code by itself. Change-Id: I202d11584901e3b52254d8e3c347aece17844b72 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | xcb: cleanup WM_HINTS handlingGatis Paeglis2018-10-151-23/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - The only place where window flag Qt::WindowDoesNotAcceptFocus changes is inside QXcbWindow::setWindowFlags and from there we call updateDoesNotAcceptFocus(). The current code was redundantly calling xcb_wm_hints_set_input in various places. - Similar as above: call xcb_wm_hints_set_normal/iconic only where it can change. This hint depends on window state, so update it only from setWindowState(). Removed unnecessary call to setTransparentForMouseEvents(), which is already called few lines above from setWindowFlags(). Change-Id: I8da919b135a4dfda0c8c1dad51d85d3e706153ab Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | xcb: utilize thread-safety of QAbstractEventDispatcher::wakeUpGatis Paeglis2018-10-153-14/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QAbstractEventDispatcher::wakeUp is a thread-safe method, using a queued connection to invoke it is wasteful. This type of connection involves allocating temporary QMetaCallEvent on a heap and locking of destination thread's post-event queue. In most use cases this is ok, and really convenient when target method is not thread-safe. But in this case the existing solution was suboptimal, especially because the events we are reading can be high frequency. The solution that we use here is lock-free. There can be only one time when it might need to wait for the lock, which is upon exiting the application. If we have entered the critical section in QXcbEventReader::run(), then the registered post routine (qAddPostRoutine) will block the QCoreApplication's dtor (this is where dispatcher is set to 0) until we exit the critical section. We also know when not to enter the critical section, in case dtor is already running. With this approach we might need to compete for the lock at most once, instead of whole application lifetime, which was the case with the existing code. Change-Id: If6737329c972347b0050d67658e28dbaa6f552e8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | xcb: call processXcbEvents() on every event loop iterationGatis Paeglis2018-10-157-11/+289
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is necessary for QTBUG-69687. The original code processes the xcb event queue only when new events have arrived, but if we want to do an event filtering that buffers some events and processes them later based on set/unset flags (e.g. QEventLoop::ExcludeUserInputEvents), we need to call processXcbEvents() on every event loop iteration, not only when new events have arrived from X server. The required functionality is implemented by having custom event dispatchers, instead of using the generic ones from QtGenericUnixDispatcher:: createUnixEventDispatcher() / eventdispatcher_support-private. This also enables for further customizations, as might be necessary by QTBUG-70095. Task-number: QTBUG-69687 Change-Id: I1f8b2400d26cccf17279d57bb4b678e40c615f33 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* | xcb: localize handling of Qt::AA_Compress* flagsGatis Paeglis2018-10-141-2/+4
| | | | | | | | | | | | | | Handle both of them inside the QXcbConnection::compressEvent(). Change-Id: Ibe7184ba5c5b636013145e887c817dca701345ad Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | xcb: lock-free event processingGatis Paeglis2018-10-1412-359/+589
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For details how this works refer to the documentation in the patch. The follow-up patches will switch to calling processXcbEvents() on every event loop iteration. With the existing code that would mean frequent locking of shared data (event queue). Acquiring a lock is fast, but lock contention isn't. To avoid potential problems, reimplement xcb event processing to be lock-free. Besides theoretical performance benefits, this definitally improves code readability in qxcbconnection.cpp. Thanks to Mikhail Svetkin for questioning the design of the existing code. Done-with: Mikhail Svetkin <mikhail.svetkin@qt.io> Change-Id: I935f2b6ca802580f5c80205aef7b2f9afc172d26 Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Revert "XCB: Do not create instance of QPlatformIntegration for invalid ↵Gatis Paeglis2018-10-145-73/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | displays" This reverts commit 67cc8fea106c35c7ca75bf476667d07b3bbf3257. I forgot about this patch and now it makes rebasing the local changes too time-consuming. Besides, 67cc8fea10 broke a build for -no-xcb-xlib. I will restore this patch, with adaptations to the new QXcb*Connection hierarchy. Task-number: QTBUG-68859 Change-Id: I938f32b5da22ce18f95d761f9b34e77fff923e24 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* | xcb: remove runtime check for xcb_poll_for_queued_eventGatis Paeglis2018-10-123-56/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | xcb_poll_for_queued_event() was introduced in libxcb 1.8. The minimal required libxcb version was bumped up to 1.9 in 1f5d791708d5d256a76872f254251dac66e82cdb. Before this version bump we needed the runtime check to support older versions of libxcb. Updated connections in the event reader to use the new signal and slot syntax. Removed threadedEventHandling() method because now it is always 'true'. Change-Id: I0bce61fd478a871d35e676239ee5280c4f40be8a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>