summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Add support for EGL_EXT_platform_xcbIlya Fedin2021-10-061-1/+6
| | | | | | | | This allows to create EGL context without involving Xlib. This extension was created a year ago and is present in Mesa since 21.0 Change-Id: Id9bcbffe8c46cb00d9cc0a9a425c1706d1b52b28 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* xcb: Flush scrolled region of backingstore to client when requesting imageTor Arne Vestbø2021-10-051-1/+6
| | | | | | | | | | | | We were doing this for composeAndFlush already, which accesses the image via graphicsBuffer(). Task-number: QTBUG-64504 Task-number: QTBUG-64414 Pick-to: 6.2 Change-Id: I51cc002db8a15991f8a8aa32e849c07318e6e74c Reviewed-by: Błażej Szczygieł <mumei6102@gmail.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* xcb: convert last screen to fake when no screenLiang Qi2021-09-183-17/+57
| | | | | | | | | | | | | | | | | available for xrandr 1.5 like we did before for xrandr 1.4 (since a094af001795c9651b299d700a992150d1aba33a). Tested with following combination: * qtbase -DECM_ENABLE_SANITIZERS=address cmake build * examples/widgets/widgets/wiggly with ASAN_OPTIONS=verify_asan_link_order=0 env * xrandr --output LastScreen --off and --auto. Fixes: QTBUG-96247 Task-number: QTBUG-42985 Change-Id: Idd95d1a3aa057d23e3adb6635dd1acbb2c853497 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Revert "Qt xcb: remove false detects of Qt::GroupSwitchModifier"Liang Qi2021-09-171-3/+3
| | | | | | | | | | | | | | | | | This reverts commit 25a7034d78aeb12726a1052d64c0aa3314a1f69d. The change makes the 5th modifier key broken, which is more serious than Backspace key doesn't work in CapsLock on. And we don't have a better solution for both of them now, perhaps it's better to keep the old behavior in 6.2 LTS. Task-number: QTBUG-49771 Fixes: QTBUG-95108 Fixes: QTBUG-95289 Pick-to: 6.2 6.2.0 5.15 Change-Id: Ie5d0aafa562b5097e089cafc83ae227c75c6d752 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* xcb: update connection time when possibleLiang Qi2021-09-062-3/+19
| | | | | | | | | At least we try to do it with all events triggered by user. Pick-to: 5.15 6.1 6.2 Change-Id: I28b399a2517600f7da2c91a50fecdf58b9d81fb6 Reviewed-by: JiDe Zhang <zhangjide@uniontech.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* xcb: support xrandr(1.5) monitor setupLiang Qi2021-09-017-119/+429
| | | | | | | | | | | | | | | | | | | | | | | | More information about monitor in xrandr 1.5, see https://keithp.com/blogs/MST-monitors/ Since this change, screen is logical instead of physical. If xrandr 1.5 and later is installed, Qt screen info will get from xrandr monitor object instead of xrandr output if only have 1.2 to 1.4. Users can manipulate monitor as they want, for example, a combination for two physical screens, half of one screen and etc. Didn't have chance to access MST monitors, but it should work if xrandr monitor object was created automatically. [ChangeLog][xcb] Qt screen info will get from xrandr monitor object if 1.5 is installed. Fixes: QTBUG-65457 Change-Id: Iad339cc0d4293b2403b4ef6bf6eb770feb3e685f Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* xcb: implement missing bits from ICCCM 4.1.4 WM_STATE handlingGatis Paeglis2021-08-102-12/+119
| | | | | | | | | | | | | | | | | | | | ICCCM 4.1.4 says: Clients that want to re-use a client window (e.g. by mapping it again) after withdrawing it must wait for the withdrawal to be complete before proceeding. The preferred method for doing this is for clients to wait for a windown manager to update or remove the WM_STATE property. This patch implements the required logic. Qt 4 had something similar. Without this patch we are calling various setter functions on a native window while it is in an undefined state. Fixes: QTBUG-69515 Pick-to: 6.2 5.15 Done-with: Liang Qi <liang.qi@qt.io> Change-Id: I377a66ad3d5e43f14465d0ea670b2f43f96ed7d3 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* xcb: add a timeout control when reading INCR propertyLiang Qi2021-08-101-2/+6
| | | | | | | | | | | | | | | | | | | For the first call of QXcbClipboard::clipboardReadProperty() inside of clipboardReadIncrementalProperty() in getSelection(), it will get a XCB_NONE reply before the contents arrived via property change. Then we give a chance to read more. Manually tested with following setups: * examples/widgets/mainwindows/application with gvim(gtk3) * examples/widgets/widgets/imageviewer with GIMP 2.10.18(based on gtk2) and GIMP 2.99.6(based on gtk3 via flatpak) Fixes: QTBUG-56595 Pick-to: 5.12 5.15 6.1 6.2 Done-With: JiDe Zhang <zhangjide@uniontech.com> Change-Id: Ib45f08464d39ad79137b1da99808c89b7dca2d08 Reviewed-by: JiDe Zhang <zhangjide@uniontech.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* CMake: Rename qt6_add_plugin TYPE option to PLUGIN_TYPEAlexandru Croitor2021-08-063-3/+3
| | | | | | | | | | | | | The intention is to remove TYPE as a keyword completely before 6.2.0 release, but in case if that's not possible due to the large amount of repositories and examples, just print a deprecation warning for now and handle both TYPE and PLUGIN_TYPE. Task-number: QTBUG-95170 Pick-to: 6.2 Change-Id: If0c18345483b9254b0fc21120229fcc2a2fbfbf5 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Add native interface for X11 application, exposing display and connectionTor Arne Vestbø2021-08-062-11/+15
| | | | | | | | | | | | | | | | | | | | | The major use-case of the now private QX11Info from Qt X11 Extras was getting hold of the Xlib display and XCB connection, for example in KDE: https://lxr.kde.org/search?%21v=kf5-qt5&_filestring=&_string=QX11Info A new native interface for QGuiApplication has now been added that exposes these two properties, e.g.: if (auto *x11App = app.nativeInterface<QX11Application>()) qDebug() << x11App->display() << x11App->connection(); To avoid type clashes one of the enum values of QXcbNativeInterface's ResourceType had to be renamed. Pick-to: 6.2 Task-number: QTBUG-93633 Change-Id: I2e366a2bb88bd3965ac6172ad000ae32209f43e7 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* xcb: fix cursorTheme update issueTang Haixiang2021-06-241-2/+6
| | | | | | | | | | | | | | | Clear the cache when cursor theme changed. Idealy we should subscribe root window's RESOURCE_MANAGER property to update cursor theme via Xcursor. KDE already has a daemon KDE GTK Configurator to sync KDE settings to GTK. Then we can register the fallback there both for KDE and GTK changes. See also https://invent.kde.org/plasma/kde-gtk-config Fixes: QTBUG-94538 Pick-to: 6.2 6.1 6.0 5.15 Change-Id: Ia4de30930a0dc1dc306c61e1553970c3dab67bd6 Reviewed-by: Liang Qi <liang.qi@qt.io>
* xcb: fix QWindow::startSystemMove()/Resize() triggered by touchLiang Qi2021-06-164-7/+19
| | | | | | | | | | Abort the system move/resise at XCB_INPUT_TOUCH_END. Limit the behavior only on supported platforms, such as KDE and OpenBox. Change-Id: I53c86979ca56f4de8c5cf2807f781abdad6987b2 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* xcb: fix QWindow::startSystemMove()/Resize() triggered by mouseLiang Qi2021-06-164-8/+60
| | | | | | | | | | | | | | | | We can't get mouse release event from master pointers after QXcbWindow::doStartSystemMoveResize() which calls xcb_ungrab_pointer(), it looks like most X11 WMs work as that. So we try to get mouse release event from slave pointers. Based on https://specifications.freedesktop.org/wm-spec/1.4/ar01s04.html , we need to send _NET_WM_MOVERESIZE_CANCEL when we get mouse release event. Task-number: QTBUG-91077 Change-Id: I01e74a01c87b381ee7cd6f20d51a1fa61c0e98fc Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Port some fallthrough comments to Q_FALLTHROUGHGiuseppe D'Angelo2021-06-131-1/+1
| | | | | Change-Id: I70dd492d5c8d198589bfd642db63182cf17b133f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* xcb: Fix touch grab handling on pre-XI 2.2Povilas Kanapickas2021-06-011-4/+6
| | | | | | | | This is only a theoretical bug fix because systems that don't support XI 2.2 are ten years old by now. Change-Id: Ia3770a6ca626b60d0f1e4cd2fdc611adf99cbf25 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Add the 'Private' suffix to the internal module namesAlexey Edelev2021-05-311-17/+17
| | | | | | | | Rename internal modules to adjust their names to the internal module policy. Also modify mappings of the qmake file converters. Change-Id: I69aee1e8136c2379608d9d22d718f8c8a5f73124 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Qt xcb: remove false detects of Qt::GroupSwitchModifierAleksei Nikiforov2021-05-261-3/+3
| | | | | | | | | | | | | | | | | In some cases, if X11 is configured with CapsLock as keyboard language switch key, and CapsLock is toggled via Shift+CapsLock key combination, toggled CapsLock is falsely detected as Qt::GroupSwitchModifier for subsequent key events. This change fixes this false detect, but doesn't fix detection of Qt::GroupSwitchModifier which is likely still broken. Fixes: QTBUG-49771 Pick-to: 5.15 6.0 6.1 Change-Id: I485e2d4f3c654707c62adaba367c1b8afb3fc36c Reviewed-by: Liang Qi <liang.qi@qt.io>
* QXcb: don't dereference pointer before checkingVolker Hilsheimer2021-05-201-1/+2
| | | | | | | | | | | | | | The virtualDesktop pointer is expected to be populated by queryPointer, but that method handles the case that there either is no reply, or that the reply doesn't match, in which case the pointer remains nullptr. Don't dereference it afterwards without checking. Addresses code checker warning a179d1087759bb6ca9c3380257bd70d6 Pick-to: 6.1 5.15 Change-Id: I5877f26fd3b49327c0de3f2c918bb606bee8ac57 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* xcb: Update _NET_SUPPORTED when the window manager changes itTang Haixiang2021-05-071-0/+2
| | | | | | | | | | In some cases, the application may start before the window manager, and in some window managers _NET_SUPPORTED may be changed. These situations will cause the _NET_SUPPORTED value obtained by Qt to be inconsistent with the window manager. Fixes: QTBUG-91396 Change-Id: I63c6934ad2538cdb9f05926b3748216bd0dcf04e Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Remove Qt6 ifdef switches from pluginsAllan Sandfeld Jensen2021-05-073-16/+0
| | | | | | | Removing dead code Change-Id: I368fcec95d230e1face18062ff19704608354654 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Call updateHighDpiScaling() on screenAdded()Morten Johan Sørvig2021-04-281-1/+0
| | | | | | | | | | | | | | | | | | | | | | QHighDpiScaling has two init/update functions: - initHighDpiScaling(): called once during QGuiApplication construction - updateHighDpiScaling(): called whenever (relevant) screen configuration changes Currently the calls to updateHighDpiScaling() are made from multiple places including platform code. Simplify by calling it from two locations: - QWindowSystemInterface::handleScreenAdded() - QGuiApplicationPrivate::processScreenLogicalDotsPerInchChange() Replace comment about early calls to qt_defaultDpi with a test which calls qt_defaultDpiX/Y with no screens attached. (Looking at the qt_defaultDpiX() implementation, it is unlikely that there will be a problem as long as updateHighDpiScaling() is called before QGuiApplication::primaryScreen() starts returning a non-null value.) Change-Id: I447db42894617495843a5cb531a1322b000fed62 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* xcb: Add more debug info for XCB_INPUT eventLiang Qi2021-04-261-1/+44
| | | | | | Pick-to: 6.1 6.0 5.15 Change-Id: I99bba80659a103aa79426ae94cd04db2c5d851d6 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix build when xcb_glx_plugin config is disabledEirik Aavitsland2021-04-202-0/+6
| | | | | | | | | | | After 7266bd459e7cf8d4f4e3ad67b4ff23dea4fbfd0e QGLXIntegration and QGLXContext are not defined if xcb_glx_plugin is disabled. That will happen e.g. when gles is requested instead of desktop GL. Protect the usage of those symbols in the xcb plugin accordingly. Change-Id: I4bea60787fd3175450de05a8e522ef9c8b438ee7 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Read DPI from X Settings initially as wellIlya Fedin2021-04-202-7/+18
| | | | | | | | | | | | | | | | | | | | | | Currently, Xft.dpi from X Resources is read initially, while changes are monitored for Xft/DPI from X Settings. These protocols are different and can have different values. E.g. MATE sets X Resources' Xft.dpi to 96.30859375, while X Settings' Xft/DPI is set to 197240 at 2x scale. This results in a very weird bug when Qt can't determine 2x scale initially, but if scale is changed at run time, Qt changes scale to the right value. The difference could be checked via xrdb -query and dump_xsettings (the second is from xsettingsd project). [ChangeLog] Qt now reads Xft/DPI from X settings at startup, and will prefer this value over Xft.dpi from X resources. Pick-to: 6.0 6.1 5.15 Change-Id: If6adac0c88198579332ddebc673f1524f324c0e4 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Use QOpenGLContext::openGLModuleType() instead of QT_CONFIG(opengles2)JiDe Zhang2021-03-261-5/+2
| | | | | | | | | In the QOpenGLContext::openGLModuleType(), it will correctly judge QT_CONFIG(opengles2), there is no need to use QT_CONFIG(opengles2) alone in QGLXContext. Change-Id: I012703b6a81b88fa4b8aa53cc1077c8b42d34ed5 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Fix compilation with experimental x11 paint engine featureEskil Abrahamsen Blomfeldt2021-03-251-5/+7
| | | | | | | | | | | | | | | | Adding support for vertical subpixel positions in d79a9b1a4f694a227ce62ccab9b44685a9755916 changed some private APIs which were used from the xcb-native-painting feature. This fixes this (it does not implement vertical subpixels but simply sets the vertical subpixel position to 0). It also adds a missing "override" which triggered the warnings-are-errors when compiling for me. Fixes: QTBUG-92011 Pick-to: 6.1 Change-Id: If214a0d19a41e623ca9ef8e6215bc145f9846ae9 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* xcb: use QXcbScrollingDevice for a touchpadShawn Rutledge2021-03-082-10/+26
| | | | | | | | | | | | | When using XQuartz on macOS, the virtual pointer device is detected as a touchpad, not a mouse; but QXcbConnection::xi2HandleScrollEvent() expects the device to be an instance of QXcbScrollingDevice for storage of some state. A touchpad that has the scrolling capability must be that type, not a plain QPointingDevice. Fixes: QTBUG-91402 Pick-to: 6.1 Change-Id: I1b82766d4a3f87f656e56c0d8904def26fb0979a Reviewed-by: Liang Qi <liang.qi@qt.io>
* fix: Print a warning message if the Xcb EGL initialize failedJiDe Zhang2021-03-031-1/+5
| | | | | | | | | | Before, No matter what the value of "success" is, Will print the "Xcb EGL gl-integration successfully initialized". If egl initialization fails, this line of printing will be very confusing. Change-Id: I6a06e2c14372913823c56ffe2fd8b831e084c719 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* cmake: Don't give plugins PUBLIC usage requirementsCraig Scott2021-02-243-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | The pro2cmake.py conversion script faithfully reproduced the .pro files for the plugins, which specified the libraries as public. But in CMake, the implications of this are that public usage requirements should then be propagated to consumers. We don't expect any consumers, since a plugin is created as a MODULE library in CMake, so for Windows we don't even have an import library to link with. The only exception to this is for static builds where plugins are created as STATIC libraries instead, but only in certain controlled situations do we then link to plugins. Even then, usage requirements are not expected to propagate to the consumers, so these relationships should always be specified as private. This change warns on any PUBLIC usage requirements specified for a plugin. This check is disabled by default to avoid spamming CI builds for repos that haven't been fixed yet. The check can be enabled by a CMake cache option, which is intended for developers to use locally when fixing this issue in other repos (all plugins in qtbase should not trigger this warning as a result of changes in this commit). Task-number: QTBUG-90819 Pick-to: 6.1 Change-Id: I09f2c8da77db1193ad3370f85d367dfc6ab7b9a6 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* xcb: unset old states and set new ones for windowLiang Qi2021-02-151-16/+33
| | | | | | | | | This partly reverts a02959bb5b43a3f9d881e5213ceedf535202b6a1. Pick-to: 6.1 6.0 5.15 5.12 Fixes: QTBUG-87078 Change-Id: I69e18ad3c0a8d142b2e1f5ab87990addc97d9df1 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>