summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
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>
* Return specific types for frequently used Java objectsVolker Hilsheimer2022-05-172-6/+7
| | | | | | | | | | | | | | | | | | This allows us to specialize JNI type signature templates for e.g. the context object, which in Java signatures is "android/content/Context". Introduce a Q_DECLARE_JNI_TYPE macro that takes care of the plumbing. The types declared this way live in the QtJniTypes namespace, and transparently convert from and to jobject. Since jobject is a typedef to _jobject* we cannot create a subclass. Use a "Object" superclass that we can provide a QJniObject constructor for so that we don't require the QJniObject declaration to be able to use the macro. The APIs in the QNativeInterface namespace doesn't provide source or binary compatibility guarantees, so we can change the return types. Change-Id: I4cf9fa734ec9a5550b6fddeb14ef0ffd72663f29 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Windows QPA: Fix text input with Input Method EditorsAndré de la Rocha2022-05-161-15/+1
| | | | | | | | | | | | | | | Removes a workaround that was added to force the Windows On-Screen Keyboard to automatically appear on Windows tablets, since it is no longer needed in currently supported Windows releases and was interfering with text input using Input Method Editors. Also remove logic for programmatically disabling the OSK, since it is no longer needed here as well, and is already supported in the UI Automation code elsewhere in the Windows QPA. Pick-to: 6.2 6.3 Fixes: QTBUG-98003 Change-Id: I6c4781852a5e9f96330d54a24ee3893dcd43a28c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Windows: Make QScreen::name() more user-friendly, take 2Yuhang Zhao2022-05-162-13/+45
| | | | | | | | | | | | | | | | | | | | | | | | The first attempt introduced in e9fd1c6aab28f had an unwanted side-effect which makes the screen name non-unique and made the screen manager think multiple different monitors with the same name is one same monitor. This behavior is of course wrong and unwanted but it was missed due to there's no unit test for this property and I was not familiar enough with QPA stuff. As a result the change was reverted in 851dc581cf9a76. However, the original change is still a good improvement, so we bring it back, but fixed the side-effect mentioned above, by letting the screen manager compare the device name instead of monitor name. If multiple monitors have the same name, a numeric suffix will be appended to the monitor name to let people still be able to distinguish between them. Change-Id: Ic03105d0825abbb3d21cb51d1da3ab2cbb4ca913 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-16706-26546/+1500
| | | | | | | | | | | | | 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>
* Correctly read and write CF_DIB bmp dataViktor Arvidsson2022-05-161-0/+12
| | | | | | | | | | | | | | | | | | | | When decoding CF_DIB data through the bmp handler we have to do some assumptions on where the pixel data starts since there's no file header to get the offset value from. We have to do this because theres some optional data after the info header that needs to be skipped over in some cases. These optional color mask values are now also written when putting a CF_DIB into the clipboard for maximum compatibility with other apps on Windows. This fixes the issue where pasted dibs would be offset by 3 pixels on Windows. Fixes: QTBUG-100351 Pick-to: 6.2 6.3 Change-Id: Icafaf82e0aa3476794b671c638455402a0d5206f Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Android A11Y: handle LocationChanged event only for focused elementIvan Solovev2022-05-165-7/+8
| | | | | | | | | | | | | | | | | | LocationChanged event unconditionally triggered invalidateVirtualViewId call. That call results in TYPE_WINDOW_CONTENT_CHANGED Android event, which causes a lot of background processing. That is not correct, because LocationChanged event is generated by every accessible element, not only the one that has A11Y focus. This patch checks event->uniqueId(), and processes only events that come from the focused accessible element. Done-with: Mike Achtelik <mike.achtelik@gmail.com> Task-number: QTBUG-102594 Pick-to: 6.3 6.2 5.15 Change-Id: I6b941733c9d215fed5ee5a7aeeb5be234add9ebe Reviewed-by: Mike Achtelik <mike.achtelik@gmail.com> Reviewed-by: Jan Arve Sæther <jan-arve.saether@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>
* qtloader.js: remove "getProcAddress" error filteringMorten Sørvig2022-05-131-6/+0
| | | | | | | | | Emscripten no longer prints an error for each getProcAddress lookup failure and this code can be removed. Change-Id: I082f420772677196c8eb82c49546825c750377ae Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: David Skoland <david.skoland@qt.io>
* qtloader.js: forward stdErr to console.warn()Morten Sørvig2022-05-131-1/+1
| | | | | | | | | This is the correct mapping, and as a bonus the Chrome browser provides a stack trace on all output from console.warn(). Change-Id: I4a1b95475679d6b54a0690f51c23683514fe7985 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: David Skoland <david.skoland@qt.io>
* wasm: fix specialHtmlTargets codeMorten Sørvig2022-05-121-3/+2
| | | | | | | | Remove .as_handle() call, which was left over from the previous EM_ASM-based code; see 0ec75f4b9. Change-Id: I220304074f4d17e706726dab086c0330edc9ef25 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* wasm: remove window from requestUpdate queue on removeWindow()Morten Sørvig2022-05-121-0/+1
| | | | | | | | | | Don't deliver update requests to windows which have been deleted or are not on screen. Change-Id: Ia2972e8dbef46eaf91a45a84962353917d436da6 Reviewed-by: Aleksandr Reviakin <aleksandr.reviakin@qt.io> Reviewed-by: Lorn Potter <lorn.potter@gmail.com> Reviewed-by: David Skoland <david.skoland@qt.io>
* wasm: always call destroy() before deleting a screenMorten Sørvig2022-05-123-7/+6
| | | | | | | | | | | | | | | | | | | QWasmCompositor currently has the requirement that destroying it requires freeing a GL texture, which requires a valid GL context, which requires a valid screen, in order to get to the native context on the canvas. For this reason QWasmScreen has a destroy() function which is called before deleting the QScreen and QPlatformScreen. Make sure we call destroy() also when deleting all screens in the QWasmIntegration destructor. Move the common logic into a new deleteScreen() function which replaces destroy(). Change-Id: I628f13c868808db539effff9b29ecbefac23abc9 Reviewed-by: Aleksandr Reviakin <aleksandr.reviakin@qt.io> Reviewed-by: Lorn Potter <lorn.potter@gmail.com> Reviewed-by: David Skoland <david.skoland@qt.io>
* QIOSTextResponder: recreate responder upon resetRichard Moe Gustavsen2022-05-101-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apple introduced UITextInteraction in iOS 13, which caused issues with our text handling, and resulted in e00d888daefb. This, again, seems to be the reason why UIKit in some cases simply removes the input delegate from our text responder. This typically happens after a QPlatformInputContext::reset(), and then when the next character is typed on the input panel (and hence, leaves no informative stack trace). The result of removing the input delegate, which is the interface that let's Qt communicate IM changes back to UIKit, leads Qt and the UIKit out of IM sync. E.g for a japanese keyboard, after a QPlatformInputContext::reset(), the Qt input field would remove the marked text, but UIKit would still show japanese characters based on what used to be marked text. To work around this issue, this patch will therefore recreate the text responder when Qt tells us to reset. This will cause the first responder to change, which will apparently also reset the UIKit IM state. Fixes: QTBUG-102960 Pick-to: 6.3 6.2 5.15 Change-Id: I00901e980874fae819cc7d89a68fa34ae44808c2 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Windows QPA: Send screen change before geometry changeMorten Sørvig2022-05-101-3/+3
| | | | | | | | | | | | | | | | | | Fix bug where the device independent QWindow size was set incorrectly, due to usage of incorrect screen and scale factor. This could happen when a window's screen was set to QGuiApplication::primaryScreen() as a fallback, before QWindowsWindow::initialize() would determine the correct screen. By sending the screen change first we make sure that that QWindowSystemInterface::handleGeeometryChange() uses the correct screen for the window. Change-Id: I5520ae67a4db60903d38db856fc314c75a3c0219 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Piotr Srebrny <piotr.srebrny@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* wasm: add support for drag into browser windowLorn Potter2022-05-107-2/+349
| | | | | | | | | Drag and drop into the browser will work. Drag and drop out of the browser will not. Fixes: QTBUG-102242 Change-Id: Id9981ab6f9514535e1409bec18068790833a67a6 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Windows QPA: Fix crash in some rare casesYuhang Zhao2022-05-101-1/+2
| | | | | | | | | | | | | | For the WM_SETTINGCHANGE message, lParam sometimes may be NULL [1] and that will lead to crash without extra safe guard. Amends commit qtbase/1ed449e168af133184633d174fd7339a13d1d595 [1] https://docs.microsoft.com/en-us/windows/win32/winmsg/wm-settingchange Change-Id: Ibd1e94b4c1d7882db0719c31a66a5fcc9299c3bd Reviewed-by: Nodir Temirkhodjaev <nodir.temir@gmail.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix window states and transitions in wasmDavid Skoland2022-05-062-27/+53
| | | | | | | | | | | | | | | | | Window states and their transitions do not currently work correctly in wasm (eg. showFullScreen -> showNormal). In order to fix this, we need to conform to Qt's way of handling windows and their geometry, which involves deferring much of the actual geometry changes to when it actually becomes visible, or else the QWidget code interferes with what we're trying to do. Change-Id: I8c7da0be76760363e444dc5dc676036e70863f6e Fixes: QTBUG-102190 Pick-to: 6.3 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* macOS: Forward hover-events for embedded windowsStefan Wastl2022-05-061-4/+4
| | | | | | | | | | | | If a QWindow is embedded into a native view it's effectively the root window, similar to a top level QWindow, and we need to forward hover events on behalf of itself and all child windows. Fixes: QTBUG-103084 Pick-to: 6.3 Change-Id: I1e94b9447fb561c1b02db87738de235c5d12b3a4 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: <stefan.wastl@native-instruments.de>
* 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>
* wasm: destroy compositor and screen in orderMorten Sørvig2022-05-061-2/+5
| | | | | | | | | | | | | | The QWasmCompositor destructor deregisters event handlers, which means it needs to look up the the canvas element, which again means that this needs to happen before we clear the canvas from specialHTMLTargets. Also, calling destroy() is not needed since the QWasmCompositor destructor makes this call. Change-Id: I3004b94d0459c28642d3bd8bf9fe794c9b658477 Reviewed-by: Aleksandr Reviakin <aleksandr.reviakin@qt.io> Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* Revert "Windows QPA: Remove dependency on swprintf_s() pulled in via ↵Kai Köhne2022-05-061-20/+1
| | | | | | | | | | | | | | | | | _com_error::ErrorMessage()." This reverts commit 043529c9dc609f3dc4bc6c79b7bc4d33ca3a3ba3, that was introduced to keep compatibility with Windows XP. This is not necessary anymore, as support for Windows XP got dropped. The now removed code also had an issue in the format of the fifth argument of FormatMessage, that is supposed to be a pointer to a pointer for FORMAT_MESSAGE_ALLOCATE_BUFFER. Pick-to: 6.2 6.3 Change-Id: Ib75b6a53a778801388d71388701340d3b79dacce Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Ihor Dutchak <ihor.youw@gmail.com>
* includemocs (updated script)Marc Mutz2022-05-0511-0/+21
| | | | | | | | | 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>
* Windows: Fix pop-up windows being incorrectly moved to primary displayAndré de la Rocha2022-05-051-1/+1
| | | | | | | | | | | | Amends a previous workaround used with AMD graphic adapters, which under some circumstances could incorrectly move pop-up windows and cause issues with menus. Fixes: QTBUG-97533 Pick-to: 6.2 6.3 Change-Id: Icc83198913b0e78ae3d7c0679e46f8b46b7015bf Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Mark mouseEvent in wasm compositor as unusedDavid Skoland2022-05-041-0/+1
| | | | | | | | If this is not there, compiling fails for all-warnings-are-errors, which seems to be enabled by default. Change-Id: Id4cafaa635be201b649012ce8fc75f7cb5fb88a3 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* Plugins: replace remaining uses of QLatin1String with QLatin1StringViewSona Kurazyan2022-05-0418-29/+29
| | | | | | | 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-0471-212/+351
| | | | | | | | | 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>
* Namespace a few missing Objective-C categories and their methodsMichael Spork2022-05-031-0/+4
| | | | | | | Fixes: QTBUG-100059 Pick-to: 6.2 6.3 Change-Id: I7579c9ee027de6a133a8b5d95d8e56829e089dab Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Plugins: stop using QLatin1Char constructor for creating char literalsSona Kurazyan2022-05-0214-20/+21
| | | | | | | | | | | 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>
* macOS: Tie QCocoaWindowManager lifetime to QCocoaIntegrationTor Arne Vestbø2022-05-024-17/+12
| | | | | | | | | | | | To avoid any static initialization fiasco when Qt is being used in a plugin. Fixes: QTBUG-101150 Pick-to: 6.2 6.3 Change-Id: I68fa03f982d0c07e4b725ed5f4a1f738e0220438 Reviewed-by: <stefan.wastl@native-instruments.de> Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Remove noop calls to QPlatformInputContext base classTor Arne Vestbø2022-04-293-5/+0
| | | | | | | | | | | | | | Like most QPlatformFoo base classes the default implementations are empty, or have default behavior that should be completely replaced by subclasses. By making it consistent across all the platform plugins when we call base class methods, we avoid confusion of whether a base class call is needed or not. Change-Id: Idd8e4a6fa0e24a1dffd21b63471c9b1c2348691f Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* macOS: Remove un-needed auto-release pools in QCocoaInputContextTor Arne Vestbø2022-04-291-2/+0
| | | | | | | | | These functions do not push much pressure on memory to warrant separate pool, and are otherwise called as part of the normal runloop which has its own pool. Change-Id: If84a899edc4e8cefbf58ecb55d46848ccd69b33b Reviewed-by: Timur Pocheptsov <timur.pocheptsov@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>
* QIOSTextResponder: restore reset/commit logicRichard Moe Gustavsen2022-04-282-0/+14
| | | | | | | | | | | After 2211092aa5, parts of the reset/commit logic was left out by a mistake. This patch will add the missing lines back into the text responder. Task-number: QTBUG-102960 Pick-to: 6.3 Change-Id: Ib339eae2af69ce088e251fe8571bed97bbd64fc3 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QLinuxFbIntegrationPlugin: includemocsMarc Mutz2022-04-282-0/+4
| | | | | | | | | | | Including moc files directly into their classes' TU tends to improve codegen and enables extended compiler warnings, e.g. about unused private functions or fields. Pick-to: 6.3 6.2 5.15 Task-number: QTBUG-102886 Change-Id: I585374e1e4e304f6c078744b36e0a021a938390d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QVncIntegrationPlugin: includemocsMarc Mutz2022-04-283-0/+6
| | | | | | | | | | | Including moc files directly into their classes' TU tends to improve codegen and enables extended compiler warnings, e.g. about unused private functions or fields. Pick-to: 6.3 6.2 5.15 Task-number: QTBUG-102886 Change-Id: I540916c8dc93d3b13bbf6d2ca9e1a1d1a7685621 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* wasm: fix window leave and enter eventsLorn Potter2022-04-282-2/+60
| | | | | | | | | | | | Leave and enter events are not happening when the mouse enters or leaves the browser window/canvas. Done-with: Alexandra Cherdantseva <neluhus.vagus@gmail.com> Change-Id: I702584980c6bea6a36143281de658e566e4c155b Pick-to: 6.3 Fixes: QTBUG-100950 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Revive eglfs' raster window supportLaszlo Agocs2022-04-273-11/+20
| | | | | | | | | | | | | | | | | | | A number of consequences of the new rhi-based backingstore composition were not handled. Most importantly, the fact that RasterGLSurface is not a thing anymore in practice causes challenges because we can no longer decide just based on the surfaceType what a QWindow with OpenGLSurface would be. (a plain GL window or a GL window with a backing store?) Also, the backingstore needs to be able to initialize its backing QRhi by itself, because with eglfs going through OpenGL is the only way. Amends 68a4c5da9a080101cccd8a3b2edb1c908da0ca8e Fixes: QTBUG-102750 Change-Id: Ia1ca59d01e3012264a76b50e591612fdcc2a0bd6 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* eglfs_x11: Fix running flag linkageLaszlo Agocs2022-04-271-1/+1
| | | | | | | | Pick-to: 6.3 6.2 5.15 Fixes: QTBUG-102821 Change-Id: I49db74c0d554bdf870a4521ab91d154b8a80c375 Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Windows QPA: Only refresh the window theme if it really changesYuhang Zhao2022-04-261-11/+14
| | | | | | | | | | | | | | | WM_SETTINGCHANGE may be triggered in many different reasons, we don't have to verify whether the system changes the global theme or not in all cases. Although not officially documented, there's a widely known and used technique to detect whether the user actually changes the personalize settings or not, that is when wParam is 0 and lParam is "ImmersiveColorSet", this combination indicates system's personalize settings has been changed. We can get rid of most unneeded verify of system theme by only execute the logic in this specific case. Change-Id: Iaf934c29975b3b2090fd692776f80b1125d3ddb3 Reviewed-by: Oliver Wolff <oliver.wolff@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>
* macOS: Use originating view as drag source when dragging multiple itemsStefan Wastl2022-04-261-5/+3
| | | | | | | | | | | | | We're already tracking the last view along with the last event, so use that instead of always assuming the drag started from the window's content view. Fixes: QTBUG-102584 Pick-to: 6.2 6.3 Change-Id: Ibe8506b0f91ecdfe6e7fe91e17c129b4d7552880 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: <stefan.wastl@native-instruments.de>
* wasm: don't show the resize cursor for fullscreen windowsMorten Sørvig2022-04-251-1/+5
| | | | | | | | | | The compositor should not show the resize cursor for fullscreen and maximized windows, since windows in those states aren't resizable. Pick-to: 6.3 Change-Id: I58762b7729a02f9a3c78edafe5d9d5b364fb552f Reviewed-by: David Skoland <david.skoland@qt.io> Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* wasm: initialize htmlCursorName to "default"Morten Sørvig2022-04-251-1/+1
| | | | | | | | | | | | | | | The canvas cursor should always be restored to "default" if no cursor is set, otherwise we get the I-beam cursor since the canvas is contenteditable. The code which handles setting and restoring the override cursors handles this correctly, however we also need to set the default htmlCursorName for cases where setOverrideWasmCursor() is not called. Pick-to: 6.3 Change-Id: I23be7847d3a30ab78e3a8c9ec402285246bfefec Reviewed-by: David Skoland <david.skoland@qt.io> Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* Windows QPA: fix the FullScreen standard keyYuhang Zhao2022-04-231-1/+0
| | | | | | | | | | | | | If you try to use the QKeySequence::FullScreen as a shortcut for your Qt applications, you'll find it's not working. This is due to this key combination is being skipped by Qt and it's being passed to Windows's default handling procedure. This is wrong because Windows doesn't provide any default action for this shortcut so nothing will happen. Change-Id: Id73b7275764fe63c119a6d673a665b0090944fef Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Windows QPA: Enhance theme change notifyYuhang Zhao2022-04-231-5/+12
| | | | | | | | DWM colorization color change should also be considered as a theme change event. Change-Id: I55562b9d43988aafc8a60a6264fe16dccbefff92 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>