summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb
Commit message (Collapse)AuthorAgeFilesLines
* xcb: share code for QRegion -> xcb_rectangle_t[] conversionMarc Mutz2017-12-063-14/+13
| | | | | | | | | | ... between QXcbWindow and QxcbShmImage. Replaces one QRegion::rects() call (to be deprecated), fixes potential overflows that QXcbShmImage did not handle, but QXcbWindow did, and saves ~1KiB of text size. Change-Id: I55d37021164feefe0cb3e60bd6d22b1976a6467b Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* xcb: use a more efficient unique_ptr instantiationMarc Mutz2017-12-061-6/+8
| | | | | | | | | | Wrap std::free() in a function object, to avoid having to carry around state (the function pointer) inside unique_ptr objects. This shrinks unique_ptrs back to sizeof(void*). Change-Id: I32a711192c5485dc04e3b36a1ddabf02d1e9d4f9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* xcb: remove redundant QT_XCB_DEBUG_XINPUT* envvarsGatis Paeglis2017-12-061-6/+0
| | | | | | | | | | | | | In Qt 5.4 these envvars were replaced with categorized logging 59ba84d31cf17d86e615e2958fece6f6e0bbefe2. This is not a public API, the log output is useful mostly for developers and it can still be used via QT_LOGGING_RULES, so there is no good reason to keep the old envvars around. By using QT_LOGGING_RULES, we can access even more xinput2 logs than is available via QT_XCB_DEBUG_XINPUT*. Change-Id: I2b12b8696043bc8bf8310f49f0cdc2ba1b8708ba Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* platform plugins: port away from QRegion::rects()Marc Mutz2017-12-061-1/+1
| | | | | | | Use begin()/end()/rectCount() instead. Change-Id: I5c642c4a2c64da65d3f37159396c86073818ca95 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* macx-clang: Opt-in xcb QPA support with XQuartzGabriel de Dietrich2017-12-011-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | Enable xcb QPA plugin when XQuartz is available. This is done in a single build, alongside the Cocoa version. We delegate part of the configuration stage to pkg-config, so this becomes a requirement. Ensure that PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig:/opt/X11/share/pkgconfig is in your environment, or pkg-config is properly set up. Tested with the following configure options: configure \ -pkg-config \ -fontconfig -system-freetype \ -system-xcb -xkb -no-opengl \ -qt-xkbcommon -qt-xkbcommon-x11 Change-Id: I2eb5a0491172368afc4c629c540cbef08580348d Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Merge "Merge remote-tracking branch 'origin/5.10' into dev" into ↵Thiago Macieira2017-11-301-1/+1
|\ | | | | | | refs/staging/dev
| * Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-11-231-1/+1
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/network/access/qhttp2protocolhandler_p.h src/network/kernel/kernel.pri src/network/ssl/qsslkey_qt.cpp src/plugins/platforms/cocoa/qcocoascreen.mm src/plugins/platforms/windows/accessible/iaccessible2.cpp src/plugins/platforms/windows/accessible/iaccessible2.h src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.h src/widgets/widgets/qmenu_p.h tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp tests/auto/other/qaccessibility/tst_qaccessibility.cpp tests/auto/testlib/selftests/expected_cmptest.lightxml tests/auto/testlib/selftests/expected_cmptest.teamcity tests/auto/testlib/selftests/expected_cmptest.txt tests/auto/testlib/selftests/expected_cmptest.xml Done-with: Edward Welbourne <edward.welbourne@qt.io> Change-Id: I4217cc7d840cbae3e3dd28574741544469c4c6b9
| | * Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-11-091-1/+1
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/kernel/qwindow.cpp src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/windows/qwindowssystemtrayicon.cpp src/plugins/platforms/xcb/qxcbconnection_xi2.cpp tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp tests/auto/widgets/kernel/qaction/tst_qaction.cpp Change-Id: Ifa515dc0ece7eb1471b00c1214149629a7e6a233
| | | * Xinput: Avoid misdetecting certain trackballs as tabletsEirik Aavitsland2017-11-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The algorithm triggers on the word "cursor" in the device name, which would also happen for devices from the manufacturer Cursor Controls. Task-number: QTBUG-48034 Change-Id: I9645c0d0bc1fa951d0ea00480572fd0df0220eb5 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | | xcb: Use fallbacks for Xcursor namesAlexander Volkov2017-11-231-40/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some cursor themes may not contain cursors with common names, then fallback names should be used. The fallbacks in this change were taken from the wayland plugin. Change-Id: I7fcc47a71cafe41c88a21a7168acd3a274b71693 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* | | | xcb: Speed-up image scrollingBłażej Szczygieł2017-11-232-47/+161
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prevent image scrolling on client-side whenever possible - do it on server-side. When using shared memory use server-side pixmap for scrolled contents. Put new image which will be scrolled to the server-side pixmap and do scroll on it. Then do a server-side copy of a scrolled area from pixmap to he window. Also put non-scrolled image directly to the window. When not using shared memory also don't do redundand client-side image scrolling. When using OpenGL compositing first copy scrolled image area from/to server-side pixmap. Task-number: QTBUG-64414 Change-Id: Ibf5f8cfb40cd4fb3e4a75a1b92eecb625f4fd74f Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | | Merge remote-tracking branch 'origin/5.10' into devAllan Sandfeld Jensen2017-10-242-2/+4
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/windows/qwindowsmousehandler.cpp src/plugins/platforms/xcb/qxcbimage.cpp tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp tests/manual/qtabletevent/regular_widgets/main.cpp Done-with: Friedemann Kleint<Friedemann.Kleint@qt.io> Done-with: Mårten Nordheim<marten.nordheim@qt.io> Change-Id: I5b2499513a92c590ed0756f7d2e93c35a64b7f30
| * | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-10-231-1/+3
| |\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/direct2d/direct2d.pro src/plugins/platforms/ios/qiosclipboard.mm src/plugins/platforms/windows/windows.pro Change-Id: Idffa03b3990bd642784f528821c5446b2e1008ef
| | * xcb: Convert synthetic mouse enter event position to native pixelsBłażej Szczygieł2017-10-201-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mouse position is converted from native pixels later, so we must provide native pixels for "QWindowSystemInterface::handleEnterEvent". Amends 7091be1b7999d93fe2126042161dcd1d8fd20026 Task-number: QTBUG-63865 Change-Id: I813c171f2fc1d321af702ac30eb5f2e4232e97c4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-10-161-3/+14
| |\| | | | | | | | | | Change-Id: I3cf73c53cf131d0babfb558c2507bed0e0fc5f08
| | * XCB platform: Fix crash on X servers with BGR888 displayEirik Aavitsland2017-10-061-3/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the native visual was BGR888, the XCB plugin would assert as soon as it needed to find the corresponding QImage format. Fix by adding the required mapping in qt_xcb_imageFormatForVisual(). Task-number: QTBUG-62840 Change-Id: Idd9eb01a60f605ad004d5b0c3025ded63ed64271 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | | Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-10-173-4/+3
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/network/fortuneclient/client.cpp examples/network/fortuneserver/server.cpp src/platformsupport/platformcompositor/qopenglcompositorbackingstore_p.h src/plugins/platforms/cocoa/qcocoabackingstore.h src/plugins/platforms/cocoa/qcocoaintegration.h src/plugins/platforms/cocoa/qcocoascreen.h src/plugins/platforms/ios/qiosbackingstore.h src/plugins/sqldrivers/oci/qsql_oci.cpp src/widgets/kernel/qwidgetwindow.cpp Change-Id: Ia6dd2c52d4a691b671cf9a2ffca70deccece8f10
| * | Merge "Merge remote-tracking branch 'origin/5.9' into 5.10" into ↵Liang Qi2017-10-051-1/+0
| |\ \ | | | | | | | | | | | | refs/staging/5.10
| | * | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-10-041-1/+0
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qconfig-bootstrapped.h src/corelib/global/qglobal.h src/corelib/tools/qcryptographichash.cpp src/corelib/tools/qcryptographichash.h src/corelib/tools/qmessageauthenticationcode.cpp src/plugins/platforms/windows/qwindowswindow.h tests/auto/gui/kernel/qwindow/BLACKLIST tests/auto/widgets/itemviews/qitemdelegate/BLACKLIST Change-Id: Ib68112de985a3d714c2071f47c10e907e4f0229a
| | | * XCB: also test for Xinerama's presenceThiago Macieira2017-09-211-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's included unconditionally from qxcbconnection.cpp and qxcbscreen.h. Task-number: QTBUG-53537 Change-Id: I6e1fe42ae4b742a7b811fffd14e5d374155660f3 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
| * | | Let QPlatformBackingStore handle its own QOpenGLContextTor Arne Vestbø2017-10-052-3/+3
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The resources allocated by QPlatformBackingStore are owned by the class, and should be allocated in a context the class also owns. This removes the asymmetry of having to pass in a context to composeAndFlush, while having to make the same context current before destroying the platform backingstore. The context owned by QPlatformBackingStore is shared with the associated window though a new QWindowPrivate::shareContext() API. The result is that on e.g. iOS, the backingstore does not need to tie the resource allocation of QPlatformBackingStore to the global share context, but can instead tie them to the per-window context, and hence clean them up after each window is closed. Task-number: QTBUG-56653 Change-Id: Ic1bcae50dafeeafaa8d16a7febd83b840ec6367a Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | | qpa: enhance mouse event with type and button dataGatis Paeglis2017-10-104-21/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... and deprecate QWSI APIs that accepts mouse event without mouse button/ type data. In the early days of Qt5 it was decided to centralize mouse button/type handling in QGuiApplication (because of limitation of some now unknown platform). This has proven to be problematic as mouse handling details differ across platforms (e.g on X11 we do not receive mouse release event when closing popup windows or ordinary windows that are closed from the mouse press event). Instead of hacking around platform specific behaviors in Qt Gui, we should move this task back to platform plugins (similar to how this was done in Qt4 with native APIs sending mouse details directly to QApplication). There are even cases where it simply is not possible to deduce (from QGuiApplication) which button caused the event (e.g. when more than one button is involved and some event goes missing). Besisdes, throwing away information which is already available at QPA level (for free) and trying to deduce it again at Qt Gui level seems impractical, fagile (as probably noticed by people fixing all the unexpected issues) and adds unnecessary complexity. Note: Removing the deprecated QWSI APIs from offscreen plugin depends on fixing autotests that rely on QOffscreenCursor::setPos() logic. For the convenience of testing use QT_QPA_DISABLE_ENHANCED_MOUSE to restore to the old code path where QGuiApplication does the mouse state deducing. Other platforms have similar issues. I do not have all supported platform available on my desk, so other platform maintainers will need to take care of porting those platforms to the new APIs. And mainly, I don't want to deal with all the hacks that other platforms have added to workaround this broken mouse logic. In Qt6 we need to remove deprecated code path from QGuiApplication. This patch: - Extends QWindowSystemInterfacePrivate::MouseEvent ctor with QEvent::Type and Qt::MouseButton. We use this extra data when processing mouse events in QGuiApplication. This actually is similar to KeyEvent, where we do pass the type (press or release) to QtGui. - Refactors QGuiApplicationPrivate::processMouseEvent and qtestlib to use the new APIs. Task-number: QTBUG-59277 Task-number: QTBUG-62329 Task-number: QTBUG-63467 Change-Id: If94fd46a7cccfea8264dcb1368804c73334558b8 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | | xcb: tidy up QXcbWindow::handleClientMessageEventGatis Paeglis2017-10-101-8/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Store "event->data.data32[0]" in a variable with a meaningful name. This improves code readility. - Use categorized logging. - Wrap lines where it makes sense (Qt Coding Style discorages more than 100 chars per line). Change-Id: I163abab8380b459fd349227f22dc417a444aefa7 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | xcb: Unify visual to QImage::Format logicAllan Sandfeld Jensen2017-10-076-146/+114
| | | | | | | | | | | | | | | | | | | | | | | | Make a common function to replace the two existing ones that convert from XCB visuals to QImage format. Change-Id: I2ae08ef4df96df950910a45e71c9d9cd98375b2e Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* | | Handle endian mismatch between X11 client and serverAllan Sandfeld Jensen2017-10-024-25/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the server and client has different endian we need to swizzle the image pixels, we can do that by swizzling the masks and try to match the new configuration. This is a rather rare setup so we don't try to match every combination. This patch fixes the colors when running Qt in a bigendian QEMU chroot. Change-Id: Ie83f9607563cba137b2e1a63e996a05d43ff603e Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* | | Replace Q_NULLPTR with nullptr where possibleKevin Funk2017-09-1922-89/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remaining uses of Q_NULLPTR are in: src/corelib/global/qcompilerdetection.h (definition and documentation of Q_NULLPTR) tests/manual/qcursor/qcursorhighdpi/main.cpp (a test executable compilable both under Qt4 and Qt5) Change-Id: If6b074d91486e9b784138f4514f5c6d072acda9a Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | 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