summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb
Commit message (Collapse)AuthorAgeFilesLines
* xcb: create fake screen when XRandR 1.2 and later unavailableLiang Qi2022-05-202-0/+25
| | | | | | | | | Keep the old behavior from 6.0 to 6.2. Fixes: QTBUG-102637 Pick-to: 6.3 Change-Id: I2e596c7d5161a3dc7a8493358e272a481aee5308 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* xcb: only set primary for monitor on primary X screenLiang Qi2022-05-203-22/+36
| | | | | | | | | | | | | It's possible to have multiple X screens, and a primary monitor on each X screen. We should only use one on primary X screen as primary QScreen. The reference of QXcbScreen pointer should be used correctly. Fixes: QTBUG-102758 Pick-to: 6.3 Change-Id: I1eafd509c8c109606967a4abe9ad7e9d8c0dd464 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* xcb: Delete touch points without target windowsTang Haixiang2022-05-201-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | When XCB_INPUT_TOUCH_BEGIN closes a popup, we then receive XCB_INPUT_TOUCH_END, and cannot find a target window (because it's destroyed). If we don't deliver it, we need to at least clear the stored point from QPointingDevicePrivate::activePoints. Then when we deliver the next touch press, m_fakeMouseSourcePointId also needs to be reset. It's now even more paramount that autotests (and real-world touchscreens) must never omit any active touchpoint from a touch event. If a point doesn't move, it must be included in the QTouchEvent, with Stationary state. If not, QGuiApp::processTouchEvent() could generate multiple TouchBegin events in a row, which gets other bits of logic confused, here and there. Fixes: QTBUG-94557 Fixes: QTBUG-98519 Fixes: QTBUG-102751 Fixes: QTBUG-103706 Pick-to: 6.2 6.3 5.15 Change-Id: Ia95e410a2bb8bc7784aa5d296fac2b89e53a9f55 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-1690-3422/+182
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* XCB: fix leaked QXcbScrollingDevicePrivateLiang Qi2022-05-132-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | ==1585319== 1,112 (720 direct, 392 indirect) bytes in 2 blocks are definitely lost in loss record 110 of 123 ==1585319== at 0x483EF2F: operator new(unsigned long) (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==1585319== by 0x7D01D6C: QXcbConnection::xi2SetupSlavePointerDevice(void*, bool, QPointingDevice*)::{lambda()#1}::operator()() const (qxcbconnection_xi2.cpp:262) ==1585319== by 0x7D025C2: QXcbConnection::xi2SetupSlavePointerDevice(void*, bool, QPointingDevice*) (qxcbconnection_xi2.cpp:316) ==1585319== by 0x7D03D2D: QXcbConnection::xi2SetupDevices() (qxcbconnection_xi2.cpp:499) ==1585319== by 0x7CE81A3: QXcbConnection::QXcbConnection(QXcbNativeInterface*, bool, unsigned int, char const*) (qxcbconnection.cpp:105) ==1585319== by 0x7D27BEA: QXcbIntegration::QXcbIntegration(QList<QString> const&, int&, char**) (qxcbintegration.cpp:199) ==1585319== by 0x7C9D282: QXcbIntegrationPlugin::create(QString const&, QList<QString> const&, int&, char**) (qxcbmain.cpp:56) ==1585319== by 0x4B516DE: QPlatformIntegration* qLoadPlugin<QPlatformIntegration, QPlatformIntegrationPlugin, QList<QString> const&, int&, char**&>(QFactoryLoader const*, QString const&, QList<QString> const&, int&, char**&) (qfactoryloader_p.h:108) ==1585319== by 0x4B512A9: QPlatformIntegrationFactory::create(QString const&, QList<QString> const&, int&, char**, QString const&) (qplatformintegrationfactory.cpp:71) ==1585319== by 0x4B074EC: init_platform(QString const&, QString const&, QString const&, int&, char**) (qguiapplication.cpp:1209) ==1585319== by 0x4B0A646: QGuiApplicationPrivate::createPlatformIntegration() (qguiapplication.cpp:1491) ==1585319== by 0x4B0A7C9: QGuiApplicationPrivate::createEventDispatcher() (qguiapplication.cpp:1508) ==1585319== by 0x568853F: QCoreApplicationPrivate::init() (qcoreapplication.cpp:847) ==1585319== by 0x4B0A89F: QGuiApplicationPrivate::init() (qguiapplication.cpp:1532) ==1585319== by 0x4B05D16: QGuiApplication::QGuiApplication(int&, char**, int) (qguiapplication.cpp:653) ==1585319== by 0x451613: main (tst_qmetatype.cpp:2141) Fixes: QTBUG-95468 Pick-to: 6.3 6.2 Change-Id: I7e0b82c2d2fe464082d8fffd1696c0122c3b35b7 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Revert "xcb: stablilize xkb state when keymap updated"Liang Qi2022-05-063-22/+5
| | | | | | | | | | | | | | | | | | | | | This reverts commit 27c25fc909c19ddc4750f36d26b7c500db9eb0ab. Currently Qt only supports core device of keyboard, not every real keyboard. Create a new xkb state during xcb_xkb_new_keyboard_notify_event_t, it will lose the correct state before the event, for example, when using the second or later layout than the first one. The new xkb state will use the first layout. It's difficult to sync the xkb states. Fixes: QTBUG-102493 Fixes: QTBUG-102640 Task-number: QTBUG-95933 Pick-to: 6.3 6.2 5.15 Change-Id: Iaa5369ff9f5495e194577dcbb8f78303158c9a73 Reviewed-by: Lu YaNing <luyaning@uniontech.com> Reviewed-by: Zhang Hao <543985125@qq.com> Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Ilya Fedin <fedin-ilja2010@ya.ru>
* xcb: Remove unused codesJiDe Zhang2022-05-061-1/+0
| | | | | | | | | Removed the "QByteArray ba = connection()->atomName(monitorInfo->name);" from QXcbScreen::setMonitor. Pick-to: 6.3 Change-Id: I3b613510669ce9fa6f5e1a4c2491bffe4887ff88 Reviewed-by: Liang Qi <liang.qi@qt.io>
* includemocs (updated script)Marc Mutz2022-05-059-0/+17
| | | | | | | | | The updated script found some more. Task-number: QTBUG-102886 Pick-to: 6.3 6.2 5.15 Change-Id: Ic8062e8a441c4d1a3718598a21f7f2e050a17cae Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QXcbNativeInterface: remove unused field m_sysTraySelectionAtomMarc Mutz2022-05-051-2/+0
| | | | | | | | | | | | | | Says Clang: qxcbnativeinterface.h:141:16: error: private field 'm_sysTraySelectionAtom' is not used [-Werror,-Wunused-private-field] xcb_atom_t m_sysTraySelectionAtom = XCB_ATOM_NONE; ^ Detected by includemocs. Pick-to: 6.3 6.2 5.15 Change-Id: Ie08c2b268b508ed87e63010fc22311ab6c8d0e40 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Plugins: replace remaining uses of QLatin1String with QLatin1StringViewSona Kurazyan2022-05-043-6/+6
| | | | | | | Task-number: QTBUG-98434 Change-Id: If64c294033c114ae46dfc327c40da7f3c7a598f5 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Plugins: use _L1 for for creating Latin-1 string literalsSona Kurazyan2022-05-0410-49/+68
| | | | | | | | | As a drive-by, fix qsizetype -> int narrowing conversion warnings for the touched lines. Task-number: QTBUG-98434 Change-Id: I7fadd3cf27ad099028d70f05956303e3af62c0f5 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Plugins: stop using QLatin1Char constructor for creating char literalsSona Kurazyan2022-05-025-9/+8
| | | | | | | | | | | Required for porting away from QLatin1Char/QLatin1String in scope of QTBUG-98434. As a drive-by, fix qsizetype -> int narrowing conversion warnings for the touched lines. Change-Id: Id76add7e86b6dfb89f758a9efb0644067f0f44de Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Ignore window icon in XCB when its size exceeds maximum request lengthAxel Spoerl2022-04-291-0/+6
| | | | | | | | | | | | | | When setting a window icon with its data size exceeding the value returned by xcb_get_maximum_request_length(), the application fails with XCB error code 4 (Maximum allowed requested length exceeded). This patch adds a check if icon_data.size() exceeds xcb_get_maximum_request_length(). If that is the case the icon is being ignored and a warning is logged. Fixes: QTBUG-102628 Pick-to: 6.3 6.2 5.15 Change-Id: Id47a0833efd16cd29b030e8c880acb416cbc500b Reviewed-by: Liang Qi <liang.qi@qt.io>
* XCB: fix GCC 12 warning about uninitialized variable useThiago Macieira2022-04-251-1/+1
| | | | | | | | | | | | GCC is right that symbolsGroup2 could remain uninitialized for some conditions. So always initialize it. qxcbkeyboard.cpp:284:48: error: ‘symbolsGroup2’ may be used uninitialized [-Werror=maybe-uninitialized] Pick-to: 6.2 6.3 Change-Id: If05aeeb7176e4f13af9afffd16e84af7d7806b0d Reviewed-by: Zhang Hao <543985125@qq.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* xcb: recreate xcb window under some conditionsLiang Qi2022-04-192-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | Some netWmState needs to be set during unmap/hide(), which is too difficult to follow, and causes m_mapped status out of sync very easily sometimes, which we had tried in e946e6895a8517a887ac246905e0769edd766fcc . Destroy the xcb window and recreate new could make the thing much easier. This practice is also used in other platforms, such as cocoa plugin. In Qt 4, the platform window was destoryed and re-created in this situation on all platforms, which was not ported into Qt5. See also the code between setWinId(0) and createWinId() in QWidgetPrivate::setParent_sys() in qwidget_x11.cpp/qwidget_win.cpp/ qwidget_mac.mm. Fixes: QTBUG-69515 Fixes: QTBUG-73485 Fixes: QTBUG-81341 Pick-to: 6.3 6.2 5.15 Change-Id: If55c57a198bc785719b61b8748dabd8281c9639d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Revert "xcb: implement missing bits from ICCCM 4.1.4 WM_STATE handling"Liang Qi2022-04-192-119/+12
| | | | | | | | | | | | | | | | | | This reverts commit e946e6895a8517a887ac246905e0769edd766fcc. It clears the duplicate show() and hide() too aggressive in handleDeferredTasks() and can cause visible states out of sync between qt and system(x11) when user switches visible on and off very frequently. This change also reverts 28138aa80a14279a72af2818f5bbbaa670283964. Fixes: QTBUG-101347 Fixes: QTBUG-99810 Task-number: QTBUG-69515 Pick-to: 6.2 6.3 5.15 Change-Id: I419c324634be8ee6884e02032bb53a42738305ac Reviewed-by: Liang Qi <liang.qi@qt.io>
* xcb: get geometry correctly for rotation with RAndR 1.5Liang Qi2022-04-081-3/+0
| | | | | | | | xcb_randr_get_crtc_info() returns already rotated size. Pick-to: 6.3 Change-Id: I33eacf988b44cea77411ad79ae24fef7e8e1564e Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* xcb: compare with screen name instead of old monitor infoLiang Qi2022-04-081-3/+2
| | | | | | | | | because the old xcb_randr_monitor_info_t was invalid very often during update. Pick-to: 6.3 Change-Id: I8c0bda93bde4e816fc98cde1a7205c6369ab39e1 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Don't blit individual rects of region when when scrolling backingstoreTor Arne Vestbø2022-04-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | The QPlatformBackingStore::scroll() API takes a QRegion as input, but we have no guarantee that the individual source and destination rects of the region will not overlap each other when applying the scroll offset, so we can't naively iterate the rects and call qt_scrollRectInImage for each one. The reason this didn't cause any issues in practice was that the QWidget repaint manager was always passing in a single rect as the region. On the other hand, the client has requested a scroll of the given region, so it might assume any other part of the backing store is preserved as is. Scrolling the bounding rect of the region violates this assumption. Amends 19ef76b0606621f189d3bc56549d200f2f5ebb25. Pick-to: 6.2 6.3 Change-Id: I27934dd6685311c0b53ea2adb60fa5997e360f6c Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* xcb: Correctly set physical size for screen with RandR 1.5Liang Qi2022-04-042-10/+30
| | | | | | | | | This amends 9a4c98e55659b32db984612e6247ac193812a502. Fixes: QTBUG-101038 Pick-to: 6.3 Change-Id: Ie75953af475dc606b34c3e274438075f20bdd8ae Reviewed-by: Liang Qi <liang.qi@qt.io>
* Short live Q_CONSTINIT!Marc Mutz2022-03-261-2/+2
| | | | | | | | | | | | | | | | | | It expands to the first available of - constinit (C++20) - [[clang::require_constant_initialization]] (Clang) - __constinit (GCC >= 10) Use it around the code (on and near static QBasicAtomic; this patch makes no attempt to find all statics in qtbase). [ChangeLog][QtCore][QtGlobal] Added macro Q_CONSTINIT. Fixes: QTBUG-100484 Change-Id: I11e0363a7acb3464476859d12ec7f94319d82be7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* XCB: Do not depend on transitive includesFabian Kosmale2022-03-172-1/+3
| | | | | | | As a drive-by, follow the coding convention when including qobject.h Change-Id: I73066646d7f03ee0138e70567738e296b2183f63 Reviewed-by: Liang Qi <liang.qi@qt.io>
* Fix typoOliver Eftevaag2022-03-141-1/+1
| | | | | Change-Id: I4cc6c6867490c1e10ca6c4bf5620325826a687a3 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Compose render-to-texture widgets through QRhiLaszlo Agocs2022-03-113-13/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QPlatformTextureList holds a QRhiTexture instead of GLuint. A QPlatformBackingStore now optionally can own a QRhi and a QRhiSwapChain for the associated window. Non-GL rendering must use this QRhi everywhere, whereas GL (QOpenGLWidget) can choose to still rely on resource sharing between contexts. A widget tells that it wants QRhi and the desired configuration in a new virtual function in QWidgetPrivate returning a QPlatformBackingStoreRhiConfig. This is evaluated (among a top-level's all children) upon create() before creating the repaint manager and the QWidgetWindow. In QOpenGLWidget what do request is obvious: it will request an OpenGL-based QRhi. QQuickWidget (or a potential future QRhiWidget) will be more interesting: it needs to honor the standard Qt Quick env.vars. and QQuickWindow APIs (or, in whatever way the user configured the QRhiWidget), and so will set up the config struct accordingly. In addition, the rhiconfig and surface type is (re)evaluated when (re)parenting a widget to a new tlw. If needed, this will now trigger a destroy - create on the tlw. This should be be safe to do in setParent. When multiple child widgets report an enabled rhiconfig, the first one (the first child encountered) wins. So e.g. attempting to have a QOpenGLWidget and a Vulkan-based QQuickWidget in the same top-level window will fail one of the widgets (it likely won't render). RasterGLSurface is no longer used by widgets. Rather, the appropriate surface type is chosen. The rhi support in the backingstore is usable without widgets as well. To make rhiFlush() functional, one needs to call setRhiConfig() after creating the QBackingStore. (like QWidget does to top-level windows) Most of the QT_NO_OPENGL ifdefs are eliminated all over the place. Everything with QRhi is unconditional code at compile time, except the actual initialization. Having to plumb the widget tlw's shareContext (or, now, the QRhi) through QWindowPrivate is no longer needed. The old approach does not scale: to implement composeAndFlush (now rhiFlush) we need more than just a QRhi object, and this way we no longer pollute everything starting from the widget level (QWidget's topextra -> QWidgetWindow -> QWindowPrivate) just to send data around. The BackingStoreOpenGLSupport interface and the QtGui - QtOpenGL split is all gone. Instead, there is a QBackingStoreDefaultCompositor in QtGui which is what the default implementations of composeAndFlush and toTexture call. (overriding composeAndFlush and co. f.ex. in eglfs should continue working mostly as-is, apart from adapting to the texture list changes and getting the native OpenGL texture id out of the QRhiTexture) As QQuickWidget is way too complicated to just port as-is, an rhi manual test (rhiwidget) is introduced as a first step, in ordewr to exercise a simple, custom render-to-texture widget that does something using a (not necessarily OpenGL-backed) QRhi and acts as fully functional QWidget (modeled after QOpenGLWidget). This can also form the foundation of a potential future QRhiWidget. It is also possible to force the QRhi-based flushing always, regardless of the presence of render-to-texture widgets. To exercise this, set the env.var. QT_WIDGETS_RHI=1. This picks a platform-specific default, and can be overridden with QT_WIDGETS_RHI_BACKEND. (in sync with Qt Quick) This can eventually be extended to query the platform plugin as well to check if the platform plugin prefers to always do flushes with a 3D API. QOpenGLWidget should work like before from the user's perspective, while internally it has to do some things differently to play nice and prevent regressions with the new rendering architecture. To exercise this better, the qopenglwidget example gets a new tab-based view (that could perhaps replace the example's main window later on?). The openglwidget manual test is made compatible with Qt 6, and gets a counterpart in form of the dockedopenglwidget manual test, which is a modified version of the cube example that features dock widgets. This is relevant in particular because render-to-texture widgets within a QDockWidget has its own specific quirks, with logic taking this into account, hence testing is essential. For existing applications there are two important consequences with this patch in place: - Once the rhi-based composition is enabled, it stays active for the lifetime of the top-level window. - Dynamically creating and parenting the first render-to-texture widget to an already created tlw will destroy and recreate the tlw (and the underlying window). The visible effects of this depend on the platform. (e.g. the window may disappear and reappear on some, whereas with other windowing systems it is not noticeable at all - this is not really different from similar situtions with reparenting or when moving windows between screens, so should be acceptable in practice) - On iOS raster windows are flushed with Metal (and rhi) from now on (previously this was through OpenGL by making flush() call composeAndFlush(). Change-Id: Id05bd0f7a26fa845f8b7ad8eedda3b0e78ab7a4e Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* vulkan: Try loading libvulkan.so.1 firstLaszlo Agocs2022-03-111-1/+1
| | | | | | | Change-Id: I876899fbfc126136f2842e9361e21ac10af8f14b Pick-to: 6.3 Fixes: QTBUG-101592 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* xcb: fix a typo for WindowTypesLiang Qi2022-03-011-1/+1
| | | | | | | Pick-to: 6.3 6.2 5.15 Fixes: QTBUG-101306 Change-Id: If02fe4997d27b952886ce664133d1aafc2b41669 Reviewed-by: Liang Qi <liang.qi@qt.io>
* xcb: free a randr monitors pointer after usageLiang Qi2022-02-281-0/+1
| | | | | | | | | This amends 9a4c98e55659b32db984612e6247ac193812a502. Pick-to: 6.3 Fixes: QTBUG-101302 Change-Id: Ia7a2f82550843a90a5e101788e3835bf3332f697 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Protect headers against min/max macrosMarc Mutz2022-02-221-1/+1
| | | | | | | | | | | | ... using the usual pattern, which, being idiomatic, doesn't need a comment explaining it. Pick-to: 6.3 Change-Id: Id6b12450495a18f89e1f83f2018b6218b03ff6a7 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* xcb: Show valuator atom names properly in categorized loggingShawn Rutledge2022-02-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | During a touch update, this looked questionable since I don't have any barcode readers or buttonboxes attached: XI2 touch event type 19 seq 1481 detail 193 pos 116.3, 77.8 root pos 6476.3, 2941.8 on window 3e00006 valuator BARCODE value 47796.365791 from range 0.000000 -> 65535.000000 valuator BUTTONBOX value 59504.858830 from range 0.000000 -> 65535.000000 touchpoint 193 state QEventPoint::Updated pos norm QPointF(0.729326,0.907986) area QRectF(... After the fix it's like this: XI2 touch event type 19 seq 1235 detail 201 pos 154.0, 64.3 root pos 6168.0, 2794.3 on window 5000006 valuator Abs MT Position X value 45520.589958 from range 0.000000 -> 65535.000000 valuator Abs MT Position Y value 56519.790001 from range 0.000000 -> 65535.000000 touchpoint 201 state QEventPoint::Updated pos norm QPointF(0.6946,0.862437) area QRectF(... ValuatorClassInfo's QXcbAtom::Atom is a Qt enum, which has to be converted to xcb_atom_t before we can call xcb_get_atom_name_name. Originally in ce2fe90faad84a6e3a976a6f111a0fa4883937d9 vci was of type XIValuatorClassInfo; then 7499d4404f9eb7223674cd0523f35eff1be7c1c9 changed it to our ValuatorClassInfo struct, but didn't add the lookup indirection to this qCDebug. Pick-to: 5.15 6.2 6.3 Change-Id: Ib6107f17d6c6c209573e3df54149d6cfffc0b8b6 Reviewed-by: Liang Qi <liang.qi@qt.io>
* Let QXcbGlxWindow::createVisual fallback to QXcbWindow::createVisualIlya Fedin2022-01-281-3/+6
| | | | | | | | | | | | | | When flatpak refused to install org.freedesktop.Platform.GL.default for me, I got into a situation without GL drivers and Qt applications stopped getting transparency windows. They fallback to use root_visual and it doesn't provide sufaces with alpha, I tried to add fallback to QXcbWindow::createVisual just like QXcbEglWindow::createVisual does and voila, they got transparency. Pick-to: 6.3 6.2 5.15 Change-Id: I9f401643b3ef231048c6e9e250121c96514101f5 Reviewed-by: Liang Qi <liang.qi@qt.io>
* xcb: Correctly update primary screen status with RandR 1.5Zhang Hao2022-01-122-10/+3
| | | | | | | | | | This amends d8f37d94e537aaab4fa960b80aacabe79bcc14c4 . Fixes: QTBUG-99605 Pick-to: 6.3 Done-with: Liang Qi <liang.qi@qt.io> Change-Id: Ia4cf67d6ebeed36596c0342302aa0b4af01769bc Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Replace QString::utf16() with data() in memcpy() and QByteArray ctorØystein Heskestad2022-01-071-1/+1
| | | | | | | | | | | QString::utf16() needlessly detaches fromRawData() to ensure a terminating NUL. Use data() where we don't require said NUL, taking care not to call the mutable data() overload, which would detach, too. Task-number: QTBUG-98763 Change-Id: I7075a8f18ab1f82ebbcf8cfab1643e8ab7f38d51 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Remove XCB_EVENT_MASK_RESIZE_REDIRECT for Qt:WindowTransparentForInputInho Lee2021-12-031-1/+1
| | | | | | | | | | | | | In xcb plugin, XCB_EVENT_MASK_RESIZE_REDIRECT is set but it is not necessary. Mouse events are disabled by setTransparentForMouseEvents and there is no reason to have this event mask. Fixes: QTBUG-86372 Pick-to: 6.2 5.15 Change-Id: I2124b0684a0847d6705344bb5850bac178a292b6 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* xcb: stablilize xkb state when keymap updatedLiang Qi2021-11-263-5/+22
| | | | | | | | | | | | | | | | QXcbKeyboard only deals with core_device_id. With the reporter's test case: using xdotool to send a string, the deviceID is not changed, then we assume xkb_state_new() is more stable(or correct) than xkb_x11_state_new_from_device() in this case. See also https://www.x.org/releases/current/doc/man/man3/xcb_xkb_new_keyboard_notify_event_t.3.xhtml . Fixes: QTBUG-95933 Pick-to: 6.2 5.15 Change-Id: Ic595e1f1424fbc6814871a85ac159907f1aeb12a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Zhang Hao <zhanghao@uniontech.com> Reviewed-by: Liang Qi <liang.qi@qt.io>
* xcb: Return standalone image from QXcbBackingStore::toImage()Tor Arne Vestbø2021-11-191-1/+7
| | | | | | | | | Otherwise the original backingstore image will detach from the m_xcb_image data on the next backingstore paint or scroll. Pick-to: 6.2 Change-Id: I73f68d9c2e7c106951541831a5df8b97695f2001 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* xcb: Don't mark scrolled area as flushed when doing client side scrollTor Arne Vestbø2021-11-181-8/+9
| | | | | | | | | | | | | | The m_pendingFlush variable is used to track what is missing in the server side backingstore. If we're doing a client side scroll the pending area is still the same. If we were to always discard the scrolled area from m_pendingFlush we would get in trouble on the next non-client side scroll, as we think the content exists server-side. Pick-to: 6.2 Change-Id: Ie50a99a8e5d8a83d1299c53534a1c83c6bfb47bd Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* xcb: Ensure we have pixmap GC before trying to flush to it during scrollTor Arne Vestbø2021-11-181-2/+2
| | | | | | Pick-to: 6.2 Change-Id: Icc85b1eb830d8d9b1b2bfb8b9998470388522832 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* xcb: Prepare correct area when doing client side backingstore scrollTor Arne Vestbø2021-11-181-2/+4
| | | | | | | | The area we're going to fill is the one after applying the scroll delta. Pick-to: 6.2 Change-Id: I254830a15e5f4c93ba28ed8f0a9b35c40f1d1af2 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* xcb: Implement support for touchpad gesturesPovilas Kanapickas2021-11-156-4/+228
| | | | | | | | | | | | | | | | | | | | They map to the data exposed by libinput exactly the same way as touchpad gestures on Wayland. The implementation is functionally the same and follows the same patterns to preserve similar behavior across X11 and Wayland. For example, we use the last known pointer position as the position for gestures, even though on X11 this data is available as part of events. The new implementation is only enabled if the used xcb supports the required APIs. [ChangeLog][Platform Specific Changes][X11] Touchpads can now detect multi-finger gestures and send RotateNativeGesture, ZoomNativeGesture and PanNativeGesture events, since XInput 2.4 and X Server 21.1. Change-Id: If404dcf8385210deadeb7e7c6d29171e9abc9e50 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Q{XcbGl,EglFSDevice}IntegrationFactory: remove unused extra plugin pathThiago Macieira2021-11-102-17/+2
| | | | | | | | | | Cargo-cult copied this from somewhere, unnecessarily. This just made the code bigger for no reason. Task-number: QTBUG-97950 Pick-to: 6.2 Change-Id: Ice04365c72984d07a64dfffd16b48520d42c7043 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Revert "Add support for EGL_EXT_platform_xcb"Paul Olav Tvete2021-11-021-6/+1
| | | | | | | | | | | This reverts commit 816c5de460439faac0745cb364c374162b7fc651. Reason for revert: Causes crash on Nvidia when Qt is configured with -opengl es2 Fixes: QTBUG-97738 Change-Id: I9fe43146b922fc770890a144fdb1bd1c564635bb Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Fix show()/hide() for child windows on xcbLars Knoll2021-11-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Change e946e6895a8517a887ac246905e0769edd766fcc implements proper support for ICCM 4.1.4 window state handling. One issue it addressed is that a show() after a hide() needs to be delayed until the window manager/X-server has processed the previous event. This was handled with a deferred task list to send the map/unmap events. According to ICCM, we should wait for the _NET_WM_STATE notification before processing the deferred events. But this is only true for top level windows, as child windows are not handled by the window manager and will never receive any _NET_WM_STATE notifications. For those, we should use the unmap notify event, which means that the X-server has processed the unmap and handle deferred events once that notification has been received. This fixes an issue in Qt Multimedia, where QVideoWidget would not show the video anymore after a minimize of the player or when making the QVideoWidget fullscreen. This is because QVideoWidget uses an embedded QWindow to render video using HW acceleration. Fixes: QTBUG-97257 Pick-to: 6.2 5.15 Change-Id: I5c47eba3276a1f243bdafd5346f353c7843403bb Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* xcb: use QXcbConnection::selectionOwner() convenience APIGatis Paeglis2021-10-224-18/+7
| | | | | Change-Id: I4fbae152829206b15bf0430d3fb2c9e2b6026566 Reviewed-by: Liang Qi <liang.qi@qt.io>
* xcb: remove confusing indirections for qt selection ownerGatis Paeglis2021-10-226-76/+40
| | | | | | | | | | | | | | | | | | | | This makes it more obvious that clipboard and DnD use the same selection owner (QXcbConnection::qtSelectionOwner()). This way we can also drop some QT_NO_CLIPBOARD defines. These defines actually are broken, but that is out-of-scope for this patch. And renamed the functions according to Qt guidelines: getSelectionOwner() -> selectionOwner() getQtSelectionOwner() -> qtSelectionOwner() The previous naming probably was influenced by underlying C API - xcb_get_selection_owner(). Change-Id: I467f1a3dbe75b4e8fd41c7e66ca9b0e25ef1039c Reviewed-by: Liang Qi <liang.qi@qt.io>
* xcb: avoid to use invalid pointersLiang Qi2021-10-222-2/+14
| | | | | | | Pick-to: 6.2 5.15 5.12 Task-number: QTBUG-96399 Change-Id: I33909940b501cb13f78981c43f3aef9fc9d1d52d Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* xcb: Use byte buffer for event masksPovilas Kanapickas2021-10-161-23/+30
| | | | | | | | | | This prepares for use of masks larger than 32 bits which happens on XI 2.4. Additionally, since the XI protocol always sends the masks using little-endian, the XI protocol support on big-endian machines was currently broken. Change-Id: Id22131e075059cea783b5be0691a673a457c7364 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* xcb: Fix typos in source code commentsJonas Kvinge2021-10-146-6/+6
| | | | | Change-Id: I3a91f57d3c47d9e96215d5dc064664626a8f65e7 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* qxcbscreen: Fix typo in documentationJonas Kvinge2021-10-141-1/+1
| | | | | | Pick-to: 5.15 6.2 Change-Id: I92f7d707a1395594ad6d1fe841fa77d21ae7c8b1 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* CMake: remove support for building Qt with the old Intel compilerThiago Macieira2021-10-131-1/+1
| | | | | | | | | | | | | | | | | | This hasn't worked for some time. It's not in our CI and I don't think it was working at all. When I tried to build it, I ran into several problems with C++17 and an Internal Compiler Error I did not have any interest in working around. After discussing with the Intel compiler team, it was decided that fixing those issues in the old compiler is not going to happen. Instead, their recommendation is to adopt the new LLVM-based compiler, which the last commit added support for. This commit does not remove qmake support for the old ICC. It's possible someone is using qmake with a non-Qt6 project and ICC. Change-Id: Icb2516126f674e7b8bb3fffd16ad6350ddbd49e5 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* XCB: Silence clipboard warning "SelectionRequest too old"Friedemann Kleint2021-10-131-9/+10
| | | | | | | | | | | Use the predefined logging category for clipboard warnings and change the offending warning to qCDebug() so that it is silent by default. Pick-to: 6.2 5.15 Fixes: QTBUG-60257 Change-Id: Icf1bc84cd64207b94ef471f13090c43b45e20728 Reviewed-by: Liang Qi <liang.qi@qt.io>