summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb
Commit message (Collapse)AuthorAgeFilesLines
* Replace Q_DECL_OVERRIDE with override where possibleKevin Funk2017-09-192-35/+35
| | | | | | | | | | | | | | | | Remaining uses of Q_DECL_OVERRIDE are in: src/corelib/global/qcompilerdetection.h src/corelib/global/qglobal.cpp doc/global/qt-cpp-defines.qdocconf (definition and documentation of Q_DECL_OVERRIDE) tests/manual/qcursor/qcursorhighdpi/main.cpp (a test executable compilable both under Qt4 and Qt5) Change-Id: Ib9b05d829add69e98a86238274b6a1fcb19b49ba Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-08-313-8/+30
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/examples.pro qmake/library/qmakebuiltins.cpp src/corelib/global/qglobal.cpp Re-apply b525ec2 to qrandom.cpp(code movement in 030782e) src/corelib/global/qnamespace.qdoc src/corelib/global/qrandom.cpp src/gui/kernel/qwindow.cpp Re-apply a3d59c7 to QWindowPrivate::setVisible() (code movement in d7a9e08) src/network/ssl/qsslkey_openssl.cpp src/plugins/platforms/android/androidjniinput.cpp src/plugins/platforms/xcb/qxcbconnection.cpp src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/widgets/widgets/qmenu.cpp tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp Change-Id: If7ab427804408877a93cbe02079fca58e568bfd3
| * Add missing #ifdef for isTouchScreen() implementationAndy Shaw2017-08-251-0/+2
| | | | | | | | | | | | | | | | | | The definition of isTouchScreen() is protected with XCB_USE_XINPUT22 so the implementation needs to have this too. Task-number: QTBUG-62226 Change-Id: Icc3de01a6cb1299b43e56fc9f77833764131ca4b Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
| * XCB: Don't core-dump if we can't connect to the X displayNameThiago Macieira2017-08-163-8/+30
| | | | | | | | | | | | | | Exit with error, but don't crash. Change-Id: Ie05c6480d8a44fda817ffffd14d9dfd8c951beef Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | xcb: add support for peeking into the XCB event queueGatis Paeglis2017-08-114-4/+149
| | | | | | | | | | | | | | | | This will be used by the Qt X11 Extras module. Task-number: QTBUG-50358 Change-Id: Ie095cd211c393ea6d78660b4d53cac28b435a3b2 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | xcb: re-factor QXcbConnection::printXcbEventGatis Paeglis2017-08-102-55/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - To use categorized logging. - Print also non-core event types. - Added QLoggingCategory as one of the parameters because I will need it in a subsequent patch. - A call to this function in QXcbConnection::handleXcbEvent I left disabled from builds by default as the "handled" variable is broken. Change-Id: I15cd71c40b5772a4352a69cdc24a0ae026626060 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | xcb: use XInput2 for mouse starting from 2.0 not 2.2Gatis Paeglis2017-08-097-114/+165
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 53d289ec4c0f512a3475da4bbf1f940cd6838ac fixed the issue of not getting touch events when grabbing via the plain xcb functions. And due to wanting to support a setup where mouse events are delivered via core events it was chosen to use mouse via XI2 only when really necessary. Thus starting only from 2.2, the version from which the mouse+touch grabbing becomes the issue (XI2 introduced touch support from 2.2). The same patch states that using QT_XCB_NO_XI2_MOUSE restores to the old behavior (grabbing via core) with broken touch grabbing. Broken only with 2.2+, not 2.0 and 2.1 since those versions of protocol do not know about touch. All of this implies the following: 1) The user code that already depends on QT_XCB_NO_XI2_MOUSE, won't see any behavioural difference if we will use XInput starting from 2.0 for mouse. Mouse grabbing will continue to be done via core (xcb_grab_pointer) as mentioned above and thus touch grabbing will continue to be broken with 2.2+. 2) The code that has never cared how we get the native events (core vs xinput2), won't see any behavioural difference. In this case grabbing will always be done via XI2 (XIGrabDevice) grab when XI2.0+ is available. Since there is no difference in the outcome, we migth as well use XI2 for mouse from 2.0, not 2.2. Extension events are always better choice than core. Besides the broken touch grabbing issue with QT_XCB_NO_XI2_MOUSE, there are other issues with that code path, for details see internal documentation of xi2SelectDeviceEventsCompatibility(), where the conclusion is: *** If your code relies on QT_XCB_NO_XI2_MOUSE, then your code needs fixing. *** This patch also cleans up how we select XInput2 events, by separating the QT_XCB_NO_XI2_MOUSE code path. This has two benefits - improved code readability and will make the deprecation of QT_XCB_NO_XI2_MOUSE easier. The patch removes some sparse comments as the behavior is now documented in one place, see xi2SelectDeviceEventsCompatibility(). [ChangeLog][Platform Specific Changes][Linux] The QT_XCB_NO_XI2_MOUSE environment variable is deprecated and will be removed in Qt 6. If your application relies on behavior set by QT_XCB_NO_XI2_MOUSE, it should be updated accordingly. [ChangeLog][Platform Specific Changes][Linux] Pointer event delivery on X11 is now done starting from XInput version 2.0 (when available) instead of 2.2. XInput support can be disabled by setting QT_XCB_NO_XI2=1 environment variable. Note that using QT_XCB_NO_XI2 would also disable tablet and touch support. Change-Id: I661b36d6710b9f6ec71fecc8287ba479432bff4c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | xcb: cleanup leftovers in QXcbScreen::updateGeometryGatis Paeglis2017-08-082-7/+6
| | | | | | | | | | | | | | | | | | | | That code was added by ae5f2a66720a4bb22c120bd7d1564652cac00367 and later incompletely removed by c173a5071906867de9da26ee8f49224b23c2ef1d. This patch amends c173a5071906867de9da26ee8f49224b23c2ef1d. Change-Id: Ibfd39aaf9b49424fc54d878dc588454eb841ed97 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | xcb: tidy-up has_<extension> variable handlingGatis Paeglis2017-08-082-8/+9
| | | | | | | | | | Change-Id: I666c9d415e366d6b06b05e70e01456c47ac35b4a Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devThiago Macieira2017-08-081-4/+4
|\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/widgets/kernel/qwidget.cpp This merge also extends the expected output of the pairdiagnostics teamcity output (added in dev in commit c608ffc56ab37f9a9d5b9c34543126adb89e2b08) after the recent addition of the flowId attribute to the teamcity output (commit 8f036562119dd35ce51dc9230304d893b906bd37 in 5.9). Change-Id: I3868166e5efc45538544fffd14d8aba438f9173c
| * XCB GLX: request OpenGL 4.6 / OpenGL ES 3.2 if possibleGiuseppe D'Angelo2017-08-041-4/+4
| | | | | | | | | | | | | | | | | | Code was lagging a bit behind published standards. Change-Id: I0fe07c0162a54d9eed8b539887496b9313b37aa4 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Support all QImage formats in native pixmap conversionEirik Aavitsland2017-08-031-2/+5
| | | | | | | | | | | | | | | | | | | | The conversion fallback did not catch all the more recently added QImage formats, leading to corrupt pixmaps or crashes. Also alpha channels were needlessly thrown away if present. Change-Id: I38588035aa9bf37b77398489981df65201cf0340 Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Change EDID parsing qCWarnings to qCDebugsLaszlo Agocs2017-08-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | Avoid polluting the output by default. Unfortunately there are various systems (modern Fedora with XWayland, VMWare) where parsing will fail for some not yet known reason. Showing warnings on each and every Qt application startup is not desirable, especially since not having the EDID data available is far from being critical. Change-Id: Ibaca7db4d897e705819f7c359f8de41b9be862a6 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* | xcb: don't rely on _NET_WORKAREA for available geometry on multi-head systemsGatis Paeglis2017-08-022-1/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On X11, QScreen::availableGeometry() is broken with multi-head systems, and there doesn't seem to be a real fix for this due to limitation in the protocol and therefore support in WMs (more details in the patch). In Gnome this issue is more visible because on this DE the _NET_WORKAREA rectangle represents the intersection of the available geometries on all monitors. This results in a big area of "dead space" on the secondary screen, when primary screen is positioned lower in the virtual space. If menu is opened by clicking in this dead space, the menu is awfully misplaced (qmenu uses availableGeometry() to calculate the position of menu). On Ubuntu with Unity (same is true for KDE Neon+Kwin and LUbuntu+Openbox), _NET_WORKAREA returns a bounding rectangle containing all monitors. Which does not cause the menu misplacement as "dead space" is outside clickable area. But this does not mean that the QScreen::availableGeometry() reported values are correct. With the same setup as described above, QScreen::availableGeometry() thinks that we have a tool panel on the right screen, when in reality it is on the left screen. AwesomeWM for example does not set _NET_WORKAREA at all, which means QScreen::availableGeometry() == QScreen::geometry(). I am not aware that it would cause any issues for popup/menu window positioning in Qt (Qt positions these windows manually by bypassing WM (via Qt::BypassWindowManagerHint) and using availableGeometry for calculations. With this patch, we would take the same code path as if _NET_WORKAREA was not set (where we know that_NET_WORKAREA is cleary wrong). The solution here is to recognize _NET_WORKAREA as true available geometry only in specific cases (cases where the meaning is cleary defined by the specification) and adjust the documentation accordingly. Not knowing the true available geometry on X11 is mitigated by WMs. Window manager can position windows as it wants. WMs are smart enough not to place windows on top of reserved areas at edges (even if user has explicitly requested this via setGeometry based on inaccurate information from availableGeometry()). [ChangeLog][Platform Specific Changes][Linux] The _NET_WORKAREA atom is used for calculating QScreen::availableGeometry() only on systems with one monitor. In all other cases QScreen::availableGeometry() is equal to QScreen::geometry(). To restore the legacy behavior with untrustworthy values in QScreen::availableGeometry() set QT_RELY_ON_NET_WORKAREA_ATOM=1 environment variable. Task-number: QTBUG-60513 Task-number: QTBUG-29278 Task-number: QTBUG-43768 Task-number: QTBUG-18380 Change-Id: I7e0f62f81d1444991b8a6c007c2527d8f96088c2 Reviewed-by: Uli Schlachter <psychon@znc.in> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devOswald Buddenhagen2017-08-023-12/+22
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/xcb/qxcbconnection.h src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp src/plugins/styles/mac/qmacstyle_mac.mm src/widgets/widgets/qdockarealayout.cpp src/widgets/widgets/qmainwindow.cpp src/widgets/widgets/qmainwindowlayout.cpp src/widgets/widgets/qmainwindowlayout_p.h tests/auto/corelib/tools/qlocale/tst_qlocale.cpp tests/auto/other/macnativeevents/BLACKLIST tests/auto/widgets/widgets/qmenu/BLACKLIST Change-Id: Ic8e724b80a65e7b1af25511b0e674d209265e567
| * Fix composition on xcb with misconfigured ibusAllan Sandfeld Jensen2017-07-311-1/+4
| | | | | | | | | | | | | | | | | | | | If ibus has been set, but either isn't installed or doesn't launch, all composition fails on xcb. This ensures we fallback to "compose" which is needed for working composition on XCB. Change-Id: Ic2061c330bcb907759a13920c3eede14f3036563 Reviewed-by: René J.V. Bertin <rjvbertin@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * xcb: fix freeze when (un)plugging input devicesGatis Paeglis2017-07-192-11/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | .. in an application that has many native windows. We don't need to select XI_HierarchyChangedMask and XI_DeviceChangedMask for every window. It is enough to register one window for these events to update state of our X11 client (application). Furthermore, XIAllDevices and XIAllMasterDevices always apply, even if the device has been added after the client has selected for events. So there is no need to call XISelectEvents on XIAllDevices/XIAllMasterDevices again, if we are not updating event masks. With this patch and the test application from QTBUG-57013, removing/attaching a device takes few hundred milliseconds instead of 23-24 seconds. Task-number: QTBUG-57013 Change-Id: Ieb0b5ee25feef2922f901165825cb4a1289fc852 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | xcb: use default member initialization in structGatis Paeglis2017-07-222-4/+1
| | | | | | | | | | | | | | | | | | | | ... for better localization. This is not possible in C, but in C++ a struct has the same features as a class. Thus, use default member initialization feature (available since C++11). Change-Id: I91522c3a4fe4270c37bb6e85fddeb5970a847352 Reviewed-by: Alexander Volkov <a.volkov@rusbitech.ru> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | xcb: fix build failure when XCB_USE_XINPUT22 is not definedGatis Paeglis2017-07-183-23/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... and group XI22 methods together under one ifdef clause. The error message was: qxcbconnection_xi2.cpp:1025:42: error: no ‘bool QXcbConnection::isTouchScreen(int)’ member function declared in class ‘QXcbConnection’ bool QXcbConnection::isTouchScreen(int id) XInput 2.2 was released many years ago, this build failure could in practice happen only on some really old platform. Change-Id: I3c1741cbdffe15c0f5149c6d76592a743d1d8a91 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | xcb: allow to change XInput device properties at runtimeGatis Paeglis2017-07-182-146/+175
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | xinput list-props <device-id> xinput set-prop <device-id> <atom-id> n n n Example: xinput list-props 9 .. Evdev Scrolling Distance (274): 1, 1, 1 .. xinput set-prop 9 274 8 1 1 [ChangeLog][Platform Specific Changes][Linux] XInput device property changes are now detected at runtime (no application restart required). Change-Id: I4d2455eef70857bc2e35c27011a3808a78fa960f Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | xcb: fix spelling error in xi2HandleHierarchyEvent()Gatis Paeglis2017-07-172-3/+3
| | | | | | | | | | Change-Id: I17bdd856bb23734f683b066759ab44493a8d60b7 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | xcb: don't allow isAtLeastXI2{1,2} in builds without Xinput2Gatis Paeglis2017-07-142-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | .. thus making it purely into a _runtime_ check of XInput 2 version. If Qt was build with -no-xinput2, it does not make sense to compile in code that always returns "false". Simply exclude code that is not relevant for -no-xinput2 builds with XCB_USE_XINPUT2 ifdefs. In addition, this improves readability of the code. Now, trying to use ::isAtLeastXI21() in a -no-xinput2 build will result in the following build error: error: ‘class QXcbConnection’ has no member named ‘isAtLeastXI21’ Change-Id: If242510d43d71829b327edc1f76322f3a0db0e08 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | xcb: rely on QRegion::operator| to handle empty regionsGatis Paeglis2017-07-141-5/+1
| | | | | | | | | | | | | | There is no need to check for it explicitly. Change-Id: I66958bf1ff4539ee75fec635c96f056524da8ddb Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devGabriel de Dietrich2017-07-131-7/+0
|\| | | | | | | | | | | | | Conflicts: src/widgets/widgets/qmainwindowlayout.cpp Change-Id: I306b4f5ad11bceb336c9091241b468d455fe6bb6
| * xcb: cleanup gl_integrations_plugin_base.priGatis Paeglis2017-07-071-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The original version (8758f532ae6209bcf9447e27edc4fd412c0f173d) of this file was full of things that are irrelevant for XCB GL plugins. Most of this has been cleaned out as side effect of porting to the new configure system. This patch cleans up the remaining pieces. It does not matter for XCB GL plugins if Qt was configured with -qt-xcb or -system-xcb as those are dependencies of xcb_qpa_lib-private and are not used directly by these plugins. The only XCB dependencies that are directly used by these plugins are libxcb-glx and libxcb, which are managed directly in xcb_glx.pro: qtConfig(xcb-glx): QMAKE_USE += xcb_glx Change-Id: I2175185902bb028de142c8ff6e0b0a3b76a09703 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | xcb: fix logic in QXcbConnection::initializeXInput2()Gatis Paeglis2017-07-133-21/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Things that were broken: - The return values of XIQueryVersion interpreted wrongly. BadRequest means no XI2 support on the server. Nesting more XIQueryVersion calls to check for lower minor version of XI2 in this case does not make sense. On Success, server's supported X Input version is returned. Server's supported version can be lower than the version we have announced to support. In this case Qt client will be limited by X server's supported version (which is ok, as we do check the available version at runtime via QXcbConnection::isAtLeastXI2*). - The code was _always_ announcing to X server that we support XI 2.2, by ignoring what actually is supported in the specific build (see XCB_USE_XINPUT ifdefs). - qCDebug messages and logging categories were wrong too. Change-Id: Ia84457f125474aa851b7a91ed19fc5b904ac359e Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | xcb: cleanup updating of scrolling device valuatorsGatis Paeglis2017-07-133-57/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This includes: - Better sharing of common code. - Less argument passing. - Improved code readability: It is somewhat confusing to read when QXcbWindow::handleEnterNotifyEvent calls connection()->handleEnterEvent(). - Better organizing of ifdefs. Change-Id: I4405390cada13b51db78f9fd30e26bb1793395ff Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | xcb: don't keep objects for disconnected touch devicesGatis Paeglis2017-07-133-190/+176
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... as XI2 reuses device ids and we might end up with some bogus objects in m_touchDevices (the same touch device after reconnecting might have a new device id). With this patch, m_touchDevices is handled similarly to tablets and scolling devices. This patch also removes unnecessary calls to X (XIQueryDevice). We already have device information available for all devices when populating m_touchDevices list, so calling XIQueryDevice again for every device id (which we haven't already concluded to be a tablet device) is a redundant round trip to X. For consistency with other device types, extend touch device data structure to store the necessary device details, instead of holding pointers to XIDeviceInfo. And allocate touch device objects on stack instead of heap, also for the consistency reasons (this way we won't need to special case m_touchDevices when running some management task on _all_ devices, e.g. removing a device with id=n when it was disconnected). Change-Id: I9f6edfaf24da911dd21ec45cd48dfdd6d0dcdf8b Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Fix deprecation warningsAllan Sandfeld Jensen2017-07-111-2/+2
| | | | | | | | | | | | | | Switch to QImage::sizeInBytes for huge QImage support. Change-Id: I0145f204dd2db6670e199c320fff9064b4a97ef4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Allow QImage with more than 2GByte of image dataAllan Sandfeld Jensen2017-07-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Changes internal data-size and pointer calculations to qssize_t. Adds new sizeInBytes() accessor to read byte size, and marks the old one deprecated. Task-number: QTBUG-50912 Change-Id: Idf0c2010542b0ec1c9abef8afd02d6db07f43e6d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Ensure all platforms send geometry events if request was not fulfilledTor Arne Vestbø2017-07-071-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The logic of deciding whether or not to send resize and move events has been centralized in QGuiApplication. This ensures that if a window with geometry 100,100+200x200 is moved and resized to e.g. 0,0+100x100, but the window manager denies the request (because the window would e.g. overlap with system UI), and issues a geometry update with the original geometry, 100,100+200x200, we will still treat that as warrant of a move/resize event to the application, so the application knows that its position and size is as before. [ChangeLog][Qt Gui][QPA] QWindowSystemInterfacePrivate::handleGeometryChange no longer takes the old geometry as an argument. Task-number: QTBUG-57608 Change-Id: I1d471cc7a257fef958bdb1e56184fa95489403a3 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Relieve platform plugins of having to persist geometry on WM callbacksTor Arne Vestbø2017-07-071-4/+0
| | | | | | | | | | | | | | | | | | We can offload this to QGuiApplication, just like the geometry of the QWindow is set. This ensures that all platforms behave the same, and that the documentation of QPlatformWindow::setGeometry is adhered. Change-Id: I19dbc32cb4fb146d716ec289c28030a547d3afaa Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-07-068-66/+43
|\| | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I43531e087bb810889d5c1fbfcdffb29b78804839
| * xcb: Use QT_CONFIG macro to check for xcb-sm, xcb-render, and xcb-glxAlexander Volkov2017-07-038-66/+43
| | | | | | | | | | | | | | | | | | | | | | And remove the corresponding defines. Note that XCB_USE_GLX and XCB_HAS_XCB_GLX were used as synonyms because QGLXBufferSwapComplete was wrapped in #if defined(XCB_USE_GLX) and at the same time it was used only when XCB_HAS_XCB_GLX was defined. Change-Id: I6c04b0ccfd5369b78b3e8af2ec39d38ae5c311dc Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-07-0418-94/+70
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qprocess_unix.cpp src/plugins/platforms/xcb/qxcbconnection.cpp src/plugins/platforms/xcb/qxcbwindow.cpp src/widgets/util/util.pri tests/auto/corelib/thread/qthread/qthread.pro tests/auto/corelib/thread/qthread/tst_qthread.cpp Change-Id: I5c45ab54d46d3c75a5c6c116777ebf5bc47a871b
| * xcb: Replace XCB_USE_XINPUT define by QT_CONFIG macroAlexander Volkov2017-06-296-33/+19
| | | | | | | | | | | | | | | | .. and remove it from qxcbconnection_xi2.cpp as this file is build _only_ when xinput2 is available. Change-Id: I66d6a299c120fc034f8519cd188e1b845d5bd1bc Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
| * Convert features.tabletevent to QT_CONFIGStephan Binner2017-06-283-19/+19
| | | | | | | | | | Change-Id: Ibd7ed7f269a64afddadee70979b20f1c58398378 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| * xcb: Use QT_CONFIG macro to check for xcb-xlibAlexander Volkov2017-06-2815-42/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... and remove the XCB_USE_XLIB define. This patch also removes the unnecessary checks for xcb-xlib in: - qxcbglxintegration.cpp as this files is build _only_ when xcb-xlib is present. From gl_integrations.pro: qtConfig(xcb-xlib):qtConfig(opengl):!qtConfig(opengles2) { SUBDIRS += xcb_glx } This also would have been the right place where to define XCB_USE_XLIB, instead of unconditional line in xcb_glx.pro: DEFINES += XCB_USE_GLX XCB_USE_XLIB - qxcbnativeinterface.cpp as this cpp file does not use any Xlib APIs directly, there is no need to include Xlib.h. Change-Id: I531b5f1e79606fcfd1c63810cf51b7d5e9dc58a7 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
| * xcb: rename arg in QXcbBackingStore ctorGatis Paeglis2017-06-281-1/+1
| | | | | | | | | | | | | | | | ... as it is a window, not widget. This matches the name from cpp file: QXcbBackingStore::QXcbBackingStore(QWindow *window). Change-Id: Ib9f69cbe80ea645bbce0e4f5ef24a8df8808b823 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
| * xcb: Increment iterator inside bgr888 region loopBłażej Szczygieł2017-06-281-1/+1
| | | | | | | | | | | | | | Amends 9c1d3bc253abd4418f3050d19ec5f05bef3ada97. Change-Id: I912096794d274617e5b290dfb42685088cd49b23 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Remove requirement to call QWindow::setMask after creating windowTor Arne Vestbø2017-06-281-0/+3
| | | | | | | | | | | | | | | | | | | | | | Like other QWindow properties we can just store it, and the platform window should pick it up on creation like other properties. [ChangeLog][QtGui][QWindow] setMask() no longer requires the window to be created to have an effect; it can be set at any time. Change-Id: I55b616363801b770bd61bda5325b443013b99866 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* | Clean-up in QXcbScreen::getOutputProperty()Gatis Paeglis2017-06-281-6/+3
| | | | | | | | | | | | | | | | | | Use the Q_XCB_REPLY() macro and let its unique_ptr<> take care of free()ing the reply. Change-Id: I32eb9c56ea0ba5632bf6ab39c77567d10f442995 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* | Fix sporadic crash in QXcbScreen::getOutputProperty()Edward Welbourne2017-06-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Although [0] claims "This request does never generate any errors", it seems I sometimes get back a NULL pointer from xcb_randr_get_output_property_reply(), leading to a segfault (in the qdatetimeedit auto-test). So check reply isn't NULL before dereferencing it. [0] https://www.systutorials.com/docs/linux/man/3-xcb_randr_get_output_property_reply/ Change-Id: Iadae835bb3017bf9bb40f180b75b0c391384f99b Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* | xcb: remove DISPLAY_FROM_XCB macroGatis Paeglis2017-06-277-21/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... as it does not add much value and is not widely used. and cleanup code: - where we repeatedly (for no good reason) call DISPLAY_FROM_XCB, instead of storing display as a (member) variable. - inconsistency where we (in the same function) alternatingly use DISPLAY_FROM_XCB and variable holding pointer to Display (when both refer to the same display). In other places this patch replaces macros with code they would translate to (or with minor adjustments to keep sensible line length). Change-Id: Ieb2a3e055892dcf31f132891f83ed4a665e3fa6e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-06-193-23/+23
|\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qprocess_unix.cpp src/corelib/io/qprocess_win.cpp src/plugins/platforms/android/qandroidplatformintegration.h src/plugins/platforms/windows/qwindowscontext.cpp src/plugins/platforms/windows/windows.pri src/tools/uic/cpp/cppwriteinitialization.cpp src/widgets/doc/src/widgets-and-layouts/gallery.qdoc Change-Id: I8d0834c77f350ea7540140c2c7f372814afc2d0f
| * xcb: Remove XIproto.h include from qxcbxsettings.cppAlexander Volkov2017-06-161-12/+3
| | | | | | | | | | | | | | | | | | | | | | It indirectly includes X.h with LSBFirst and MSBFirst macros. Use XCB_IMAGE_ORDER_LSB_FIRST and XCB_IMAGE_ORDER_MSB_FIRST macros instead and remove unneeded XCB_USE_XLIB guards. Change-Id: Ic24c9605d0a627253f2793f9feab6c6e19dcda08 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io> (cherry picked from commit 538b9f504c0de11c473a40aed66df9900ac1c6c4) Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| * xcb: Don't destroy foreign windowsTor Arne Vestbø2017-06-073-23/+23
| | | | | | | | | | | | | | | | | | We can't rely on virtual dispatch in the destructor. Task-number: QTBUG-61140 Change-Id: Ib1026caf126095778c24254775cb5a0bfecf3a38 Reviewed-by: Fabian Vogt Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* | xcb,evdevmouse: don't use qpa compatibility functionsGatis Paeglis2017-06-081-8/+12
| | | | | | | | | | | | Change-Id: If3f474dcb6ee117c6dd26cd56fd4ad8d39e60e1f Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-06-072-2/+11
|\| | | | | | | | | | | | | Conflicts: src/widgets/widgets/qmenu.cpp Change-Id: I6d3baf56eb24501cddb129a3cb6b958ccc25a308
| * Make sure QWindow screen is set before calling QPlatformWindow::createÀlex Fiestas2017-05-292-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QWindow uses device independent geometry while QXcb and QPlatform classes do not. When QXcbWindow::create is called we have no guarantee that the correct screen has been set in QWindow so the code attempts to check if "currentScreen" matches "actualscreen". To perform that operation though we need to convert the units from "Device independent" to "native pixels" that we do by calling QPlatformWindow::windowGeometry which calls QHighDpiScaling::toNativePixels which requires the correct screen to be already set. So basically we have a cyclic dependency, to get the correct screen we require the correct screen to be already set. To fix this we can: 1-Remove the dependency (Look for the actual screen using device independent pixels) This will imply adding code in QXcb to use QPlatformScreen::deviceIndependentGeometry to lookup the screen up 2-Make sure the Screen is set before calling QXcbWindow::create This patch implements the first approach that allows us to keep the changes within the QXcb backend which seems to be the only one affected. Task-number: QTBUG-53813 Change-Id: I6dc955d63e17c3b3421f3a1a9e0d841e508b2e5c Reviewed-by: David Edmundson <davidedmundson@kde.org> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>