summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
Commit message (Collapse)AuthorAgeFilesLines
* Support Qt::WindowCloseButtonHint in QWasmWindowMikolaj Boc32 hours3-0/+7
| | | | | | Change-Id: I1cd74e5c9e73c2585d3da3fa0ee4aafd24130019 Reviewed-by: Aleksandr Reviakin <aleksandr.reviakin@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Support Qt::WindowMaximizeButtonHint in QWasmWindowMikolaj Boc2 days2-1/+9
| | | | | | Change-Id: I1089ab4706c4342fa5976b1aff18d67d47769687 Reviewed-by: Aleksandr Reviakin <aleksandr.reviakin@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Support Qt::WindowTransparentForInput in QWasmWindowMikolaj Boc3 days2-0/+6
| | | | | | Change-Id: I31c72bcfff62efb28672d7740bf1096878c88cae Reviewed-by: Aleksandr Reviakin <aleksandr.reviakin@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Support Qt::NoDropShadowWindowHint in QWasmWindowMikolaj Boc3 days2-1/+5
| | | | | | Change-Id: I37b8b4c4d6b717d5fcd32b0793c2209850747085 Reviewed-by: Aleksandr Reviakin <aleksandr.reviakin@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* QXcbConnection::getTimestamp: do not return stale timestampRoland Pallai3 days3-4/+6
| | | | | | | | | | | | | | | | | | | The problem is `PropertyNotify` event generated by `xcb_delete_property()` at return could be reported as an actual timestamp at next call due to a missing `state` filter. Because `PropertyNotify` is generated even if an unchanged property value is set we can get rid of this delete event easily. This issue causes observable problems in kwin_x11 (KDE project) too. Fixes: QTBUG-56595 Pick-to: 5.15 6.2 6.4 6.5 Change-Id: Ice6cfa934e3769d86e9f7264e369dc5918c8542a Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: JiDe Zhang <zhangjide@uniontech.com>
* wasm: convert a11y coordinates to window coordinatesMorten Sørvig3 days1-1/+11
| | | | | | | | | | | The html accessibility elements are positioned relative to the window a11y container. Convert the global (screen) coordinates we get from QAccessibleIntreface::rect() to window coordinates. Pick-to: 6.5 Change-Id: Ifd4eb671def296b1eb418789b7ca85afa365e546 Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
* wasm: fix accessibility crash on null parentMorten Sørvig3 days2-10/+12
| | | | | | | | | | | The code was a assuming that an a11y interface always has a parent, which is not the case for the root interface. Also factor out to a getWindow() function, to prepare for re-use later on. Pick-to: 6.5 Change-Id: I52a841bf94c712deb9603e8b9c2c878820c5f117 Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
* wasm: set contenteditable on canvasMorten Sørvig3 days6-19/+21
| | | | | | | | | | | | | | | We don't want to make the top-level screen contenteditable, since that interferes with accessibility. Instead, make the canvas contenteditable and install clipboard event handlers there. Also move follow-up settings which counters some of the effects contenteditable (outline: none and inputmode: none), and move aria-hidden. Pick-to: 6.5 Change-Id: Ibe73d8d097acd948ba8920c781a2003db0a14f3d Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Remove unused code in qwasmcssstyleMikolaj Boc3 days1-26/+1
| | | | | | | | | | Since 32666691c21cc91a3d7c7585dad711dc9743fdce, icons have been set manually on img elements. The css code assigning the icons to elements is now unused - remove it. Change-Id: I394f08371c80f0e374a5cc7e39d17bb6091d18dc Reviewed-by: Aleksandr Reviakin <aleksandr.reviakin@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Support window masks on WASMMikolaj Boc4 days2-2/+23
| | | | | | | | | | QWasmWindow is now implementing the setMask method, which translates the received QRegion to a css clip path Fixes: QTBUG-73260 Change-Id: Ie934c1e6ab650426bfc32154bf9e49a4a2aeb45b Reviewed-by: Aleksandr Reviakin <aleksandr.reviakin@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* iOS: Fix build with -no-openglTor Arne Vestbø5 days6-5/+27
| | | | | | Pick-to: 6.5 Change-Id: I014fa1772f629ef4224ac98bfc30eb5a86f38fde Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove redundant qsharedpointer.h #includesAhmad Samir6 days1-1/+0
| | | | | | | In some cases added #include <QtCore/qshareddata.h>. Change-Id: Idc84c4ad6b0bd58e1a67af335dfcff67fdf80b2a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove dead code from QWasmCompositorMikolaj Boc7 days1-14/+0
| | | | | | | Some of the fields and functions are not used now. Remove those. Change-Id: I9313eee37374d82de2a1982a54843a70c58af426 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Replace cargo-cult winrt snippet with unified header-includeMårten Nordheim7 days1-9/+1
| | | | | | Pick-to: 6.5 Change-Id: Ide9ec7e4d6c31220fa445d8acb63f7eeca60ab7c Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Remove the unused QWasmWindow::m_pointerMoveCallbackMikolaj Boc7 days1-1/+0
| | | | | Change-Id: Ife43bb8d10b0d89f8364b5e2b4dd5349a7ad1110 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Free the GLX framebuffer configurationsInho Lee7 days1-1/+6
| | | | | | | | Adds missing XFree for a glXChooseFBConfig Pick-to: 6.5 6.4 6.2 5.15 Change-Id: I4c30341f90666170dac5d90b0c65d1deff4e0818 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Quasi-support for offscreen surface on WASMMikolaj Boc7 days5-28/+64
| | | | | | | | | | | | | | | | | | Since context sharing is not currently supported with WebGL, offscreen contexts have a limited usability on Qt for WASM. If a context is shared, use the same underlaying WebGL context so that the two can actually share resources. This is not full-blown context sharing by any means but it makes e.g. the Open GL widget work as the readback texture for it is 'shared' between the virtual Qt contexts. If no sharing is desired, we use an OffscreenCanvas and actually create a separate WebGL context. Fixes: QTBUG-107558 Pick-to: 6.5 Change-Id: If57e44739ddb57c167d5f8881a74d8dee52531f6 Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
* Revert "Windows: use MSG timestamps for input events"Oliver Wolff8 days4-34/+31
| | | | | | | | | | | | This reverts commit baa5888807d3db57603398ae7aa27866efdbd711. The change caused breakages in qtdeclarative's auto tests. Current assumption is that we need the system timestamps for other events as well. Reverting now to unblock CI. Fixes: QTBUG-110596 Change-Id: I9583627bc058ff0d6cadfa622eed119fb41ca4a1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Windows: fix warning on opening FileDialog after changing filtersVladimir Belyavsky12 days1-3/+4
| | | | | | | | | | | | | | | | | Destroy native file dialog on Windows as soon as it closes. Currently the instance of native file dialog on Windows may stay live even when a FileDialog control was closed and won't be opened anymore in the app session. At the same time, when the FileDialog is opened again, the instance of native file dialog is recreated so we don't need to keep previous instance, because this may lead to situation when QQuickFileDialog configures old instance of the native dialog, which is causing problems. Fixes: QTBUG-61042 Fixes: QTBUG-77211 Pick-to: 6.4 6.5 Change-Id: Ia537264e8494b83dec7d5139744838242b281f1f Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* xcb: Fix QXcbCursor for secondary screenPeter Varga12 days1-2/+2
| | | | | | | | | | | | | QXcbCursor is created for each screen in a multiscreen setup. Make sure xcb cursor context is created for all QXcbCursor instances otherwise xcb can't load cursor for non-primary screens. Amends commit 012132c60d625b2de0039bdda3c22a0a8fe2dfe5 Pick-to: 6.5 Fixes: QTBUG-110434 Change-Id: I85da73a1069b681437b29c3e272d85f5d2dde130 Reviewed-by: Liang Qi <liang.qi@qt.io>
* Set the cursor in QWasmWindowMikolaj Boc13 days4-91/+41
| | | | | | | Also, trim QWasmCursor as some of it was dead code. Change-Id: If6fee3390e4c2a2c66ceaef5917d7387f8dbd46c Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Introduce qt_winrtbase_p.hOliver Wolff2023-01-231-9/+2
| | | | | | | | | | | | | | Due to a bug in earlier Windows SDKs developers have copy paste a workaround whenever they are including winrt/base.h. In addition to that our usage winrt API also forces them to include qfactorycacheregistration_p.h whenever they include that file. To make things easier all that magic can now be done with one single include of qt_winrtbase_p.h. Pick-to: 6.4 Change-Id: Ic6a80d6d3723af381cf0ecc0f0ab43c2e6839a7d Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Windows QPA: also consider window flags when judging frameless or notYuhang Zhao2023-01-233-17/+43
| | | | | | | | | | | | It's possible that the window has the WS_THICKFRAME flag but the Qt::FramelessWindowHint is enabled at the same time. That usually indicates the user is customizing the window, but it will also confuse QPA's current logic. We can make the logic more roboust by reading the Qt window flags as well. Pick-to: 6.5 6.4 Change-Id: I9894e312a92ef7f5fc0aa93974f216b67fe2cf29 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Windows QPA: rework how we set dpi awarenessYuhang Zhao2023-01-234-80/+137
| | | | | | | | | | | | | | | | | | | Qt6's minimum supported platform is Win10 1809, so it should be quite safe to use DPI_AWARENESS_CONTEXT APIs because they were introduced in Win10 1607. This patch removes the use of the PROCESS_DPI_AWARENESS APIs because they are old (introduced in Win8.1) and most importantly, they can't handle the new PMv2 and GdiScaled awareness mode. This refactor also fixed a bug: previously Qt is using GetProcessDpiAwareness() to get the dpi awareness mode of the current process, however, that API can't return PMv2, which means even if we are in PMv2 mode, it will still return PMv1 (I've confirmed that locally), and thus Qt is mishandling such cases. Eg: when judging whether to enable non-client area dpi scaling or not. Change-Id: I8a8946ba63c863f8c19c27998af2bac97db37ec7 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Windows: use MSG timestamps for input eventsGiuseppe D'Angelo2023-01-234-31/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Input events have a timestamp. When dispatching an event through QPA, a platform plugin can either provide it, or QPA will use an internal QElapsedTimer to provide a timestamp. Windows input messages do come with a timestamp already, so we can use that instead of the QPA. The two methods are not equivalent. For instance: for various reasons, Qt does not honor Windows' "double clicked" message, but uses the delta between two mouse events to establish if the second click is actually a double click. Now suppose that the user double clicks on a widget. On the first click, the application does something that freezes it for a bit (e.g. some heavy repainting or whatever). Does the second click register as a double click or not? * If we're using Qt's own timer, the answer is NO; the event is pulled from the WM queue after the freeze, given a timestamp far away from the last click, and so it will be deemed another single click * If we use the OS' timestamps, then the second click will be seen as "close" to the first click, and correctly registered as second click. This reasoning can be extended to many other QPA events, but looks like the APIs for some are missing (e.g. enter events), so I'm not tackling them here. Task-number: QTBUG-109833 Change-Id: I149361a844feac86cafa885c109a1903b1e49545 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Yuhang Zhao <yuhangzhao@deepin.org> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Windows QPA: use make_unique instead of QSP+raw new+memsetGiuseppe D'Angelo2023-01-231-4/+4
| | | | | | | | | | A minimal change here would've been just to use value initialization instead of default initialization. But just go for the kill -- stop using QScopedPointer. Change-Id: Ie427a44d13987c2b4a2c881c350df04e935df9d8 Reviewed-by: Yuhang Zhao <yuhangzhao@deepin.org> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Handle the wheel event in the wasm windowMikolaj Boc2023-01-226-79/+94
| | | | | | | | | | | Align the wheel event handling with other events - move the handler to wasm window and create a C++ wrapper class for the js wheel event. Fixes: QTBUG-109622 Change-Id: I915e502de7c0784ec9a6745a90ddcda062e91b2b Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io> Reviewed-by: Lorn Potter <lorn.potter@gmail.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Remove the qwasmstylepixmaps_p.h dead codeMikolaj Boc2023-01-213-161/+0
| | | | | | | | The code is now unused as svg graphics have been introduced for window decorations. Change-Id: Iefe4543af2483fd9ff3eb6ce15b9905620927a9b Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* Handle the drop event in the wasm window elementMikolaj Boc2023-01-2010-137/+176
| | | | | | | | | | | | | | Drop events are now handled in the wasm window element, which allows the browser to select the drop target automatically. This also fixes the case where drop data transfer finishes reading when a window has already been closed and destroyed - the cancellation flag is now owned by window so it gets invalidated as soon as window is gone. The code has also been structured with a new DragEvent passthrough. Fixes: QTBUG-109581 Change-Id: Ie3eb7446e2181fd540517f39397e8b35f111d009 Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
* Android: use signature-less jni syntax for AndroidContentFileEngineAssam Boudjelthia2023-01-181-84/+92
| | | | | | | Task-number: QTBUG-98974 Pick-to: 6.5 6.4 Change-Id: I1e8e102282af2877bbbe6e8018b7649fac66804e Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* Streamline reading of js DataTransfer objectMikolaj Boc2023-01-187-293/+99
| | | | | | | | | | | | | | | | | | qwasmclipboard.cpp and qwasmdrag.cpp had the same logic that read the js DataTransfer object implemented twice with small differences. Use a single implementation in both. This also introduces a clearer memory ownership model in the reader code, and fixes a potential race condition by introducing a cancellation flag. Removed the useless QWasmDrag type which was in essence a SimpleDrag and made the m_drag in QWasmIntegration a smart pointer. Fixes: QTBUG-109626 Pick-to: 6.5 Change-Id: I5b76dd3b70ab2e5a8364d9a136c970ee8d4fae9c Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Android: pass EXTRA_INITIAL_URI to native FileDialogAssam Boudjelthia2023-01-182-6/+28
| | | | | | | | | Allow setting the initial directory where the file dialog will be opened. Pick-to: 6.5 6.4 6.2 5.15 Change-Id: I1395b367c74d28fb2890ac53a90456c3ac4c1b05 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Fix build with -no-feature-cssparserTasuku Suzuki2023-01-171-1/+0
| | | | | | Pick-to: 6.5 Change-Id: I146ac61f92acdcd22c46ca27a1fca48c47817e3c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Add QString<->emscripten::val conversion functionsMikolaj Boc2023-01-1310-77/+16
| | | | | | | | Following the QRect, add functions converting the QString to native emscripten::val and back: fromJsString, toJsString Change-Id: I2d0625ede3bbf7249e2e91b8de298b5b91df8ba2 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Add QEGLContext::invalidateContextThomas Senyk2023-01-122-4/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | QEGLContext::invalidateContext will mark that egl context is invalide and trigger SceneGraph to destroy it, create a new one and re-create and re-upload all resources (e.g. textures) associated with the current state of the SceneGraph In addition this change also improves QEglFSWindow::invalidateSurface() and QEglFSContext::eglSurfaceForPlatformSurface(..) Where QEglFSWindow::invalidateSurface() will now destroy the corresponding EGLSurface via eglDestroySurface, including "unbinding" it from the current thread via eglMakeCurrent and un-setting the screen's EGLSurface in case it's the same resource. QEglFSContext::eglSurfaceForPlatformSurface(..) will now call QEglFSWindow::resetSurface() in case of getting a EGL_NO_SURFACE from the QEglFSWindow (which happens if above invalidateSurface() was called before) - therefor re-creating the resource if it was destoyed via QEglFSWindow::invalidateSurface() Pick-to: 6.5 Change-Id: I37badd1fc11e993c395fb1502e9bd27ebe18b821 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* qxcbwindow.cpp: Fix sign-compare and another warningsLiang Qi2023-01-111-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | qsizetype(int32 on 32bit, int64 on 64bit) vs uint32. qxcbwindow.cpp: In member function 'virtual void QXcbWindow::setWindowIcon(const QIcon&)': qxcbwindow.cpp:1300:30: warning: comparison of integer expressions of different signedness: 'qsizetype' {aka 'int'} and 'uint32_t' {aka 'unsigned int'} [-Wsign-compare] 1300 | if (icon_data.size() > xcb_get_maximum_request_length(xcb_connection())) { | ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ qxcbwindow.cpp:1301:53: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 3 has type 'qsizetype' {aka 'int'} [-Wformat=] 1301 | qWarning("Ignoring window icon: Size %llu exceeds maximum xcb request length %u.", | ~~~^ | | | long long unsigned int | %u 1302 | icon_data.size(), xcb_get_maximum_request_length(xcb_connection())); | ~~~~~~~~~~~~~~~~ | | | qsizetype {aka int} This amends ebdaf8ef9cea6f3669fc73bc3395acf2e497f7fc. Fixes: QTBUG-109610 Pick-to: 6.5 6.4 6.2 5.15 Change-Id: I2c9b5ad27881658463dd0870639c42d3ea8e7aba Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* Enable shared library build of Qt for iOSTor Arne Vestbø2023-01-102-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | As of f68e2c92cc0ed2c1929140402c061359bc2363a5, and its follow up changes, we can now link individual plugins statically, even if the Qt build is generally a shared build. This allows us to build Qt for iOS as shared libraries, while still keeping the platform plugin as a static library, since this is harder to port over to a shared library. This gives the benefit of faster turnaround during development, as well as binary compatibility promises for the main Qt libraries, without having to go fully shared for all of Qt. Static builds are still the default, due to the downsides of larger application bundles and slower load times for shared builds. For now the user has to manually tick the "Embed & Sign" check box in Xcode for each Qt library, which is only available with Xcode projects generated by the qmake Xcode generator. Task-number: QTBUG-85974 Change-Id: Id2b7bd2823c8e7c79068dda95295b574ada8d7f2 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* wasm: move Q_AUTOTEST_EXPORT to correct locationMorten Sørvig2023-01-091-1/+1
| | | | | | | Should be placed between "class" and the class name. Change-Id: I418cdc2b200bf7b5147d4b4278f3d0b77786710d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix QErrorMessage test when using native dialogsTor Arne Vestbø2023-01-091-0/+2
| | | | | | | | | | | | | | | | | When the test is showing the error message over and over, it's not waiting for the native dialog to actually become visible, and as a result, hiding it has no effect and won't result in a call to processResponse, where we got rid of the native dialog. To fix this we explicitly release the native dialog when encountering this corner case. Add logic to QErrorMessage to test both native and non native dialogs. Pick-to: 6.5 Change-Id: I19ac3f463997aed1e66f646fdfcbb4d2459116d1 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* wasm: make qtloader print stack trace on exceptionMorten Sørvig2023-01-091-0/+2
| | | | | | | | | | | We were displaying the exception type by on the error page, however the exception contains a stack trace as well which we can print to the console. Pick-to: 6.4 6.5 Change-Id: Ia6c95c3f179eb68e57f9d6d2d8ad960591d0b365 Reviewed-by: Aleksandr Reviakin <aleksandr.reviakin@qt.io> Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* Dark windows: use background/foreground colors for tooltipsVolker Hilsheimer2023-01-071-7/+6
| | | | | | | | | | | | | | | That follows what File Explorer on Windows 11, or the system UI does for tooltips in modern UI elements (the tooltip for the "minimize" button in a titlebar still shows the yellow-colored tooltip). Using the accent color makes the tooltip pop a lot more, but doesn't look native. Also make the toolTipPalette helper function do something useful in dark mode. Pick-to: 6.5 Change-Id: I2b07abd72eee50508f19f46aaec3408183c27100 Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io>
* wasm: sync pointer button state on pointer downMorten Sørvig2023-01-061-0/+8
| | | | | | | | | | | | | We may get PointerDown events with "no buttons" as the button state in some cases such as for tap events on Apple trackpads. Make sure the mouse button which caused the pointer down event is in the mouse buttons set for the event. Fixes: QTBUG-108639 Pick-to: 6.4 6.5 Change-Id: I0a49abc398308bbfed657b99fc74f60c16e05a59 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* wasm: Fix secondary thread event processingMorten Sørvig2023-01-062-5/+0
| | | | | | | | | | | | | | | | Fix test failure in WasmEventDispatcherTest::postEventSecondaryThread() Revert to using qGlobalPostedEventsCount() for determining pending events state, but move the final check to after sending posted events. Also remove a superfluous check. This partially reverts/amends cc60d706. Task-number: QTBUG-109066 Pick-to: 6.5 Change-Id: If4f437ce9379282c3d60b0272845a975794883de Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io> Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* Fix cache maybe invalid while the signal is actived from queueJannis Xiong2023-01-063-1/+8
| | | | | | | | | with default QObject::connect signal may active from next message loop. invalide cache will hit while accessibility interface is called from windows. Invalide cache will lead to a crash Fixes: QTBUG-106653 Pick-to: 5.15 6.2 6.3 6.4 Change-Id: I5359672bcd60ed6cfb2edf238645225164cb1b88 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Android A11Y: Only access the main thread when it is not blockedJulian Greilich2023-01-051-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the qtMainLoopThread calls QSGThreadedRenderLoop::polishAndSync(), it waits for the QSGRenderThread. In the QSGRenderThread, QAndroidPlatformOpenGLWindow::eglSurface() calls QtAndroid::createSurface() and waits for the "android main thread" to return a valid surface. When the "android main thread" now calls "runInObjectContext" (e.g. by calling QtAndroidAccessibility::childIdListForAccessibleObject()) it waits for the qtMainLoopThread and the program is stuck in a deadlock. To prevent this, we protect all BlockedQueuedConnection from the "android main thread" to the qtMainLoopThread by acquiring the AndroidDeadlockProtector. When QAndroidPlatformOpenGLWindow::eglSurface() already acquired the AndroidDeadlockProtector we abort the current A11y call with an emtpy or default value. Note: b8a95275440b8a143ee648466fd8b5401ee1e839 already tried to fix this by checking "getSurfaceCount() != 0", but there are situations, where a new surface is being created while an old surface is still present. Task-number: QTBUG-105958 Pick-to: 6.5 6.4 6.3 6.2 5.15 Change-Id: Ie40e8654c99aace9e69b0b8412952fa22c89f071 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Tweak comment about QCocoaWindowYAMAMOTO Atsushi2023-01-051-3/+3
| | | | | | | | Remove duplicate 'for', and unify the article of NSWindow to "an". Change-Id: Iccf762ac54e90816f61634404fb88c9fdd1a43e1 Reviewed-by: Kai Köhne <kai.koehne@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* macOS: Include text in key events triggered by insertion key-bindingsTor Arne Vestbø2023-01-041-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | In 705665957baf16f9ec4d256dd4d2fad98788314b we started relying on the input method to decide whether a key event should include the resulting text or not, based on the assumption that text insertion would happen via the insertText:replacementRange: selector. But the NSStandardKeyBindingResponding protocol includes several other commands for inserting content, including insertTab:, insertBacktab:, and insertNewline:. https://developer.apple.com/documentation/appkit/nsstandardkeybindingresponding We explicitly handle the latter, but for any command we didn't handle, we concluded that the input method didn't want us to insert text, and sent the key event without text, which broke tab character insertion in text edits. As long as we're not handling these commands explicitly, we adjust the logic to treat any command starting with "insert" as an unhandled request to insert text, and forward it as a key event with the text included, as before 705665957baf16f9ec4d256dd4d2fad98788314b. Fixes: QTBUG-109754 Task-number: QTBUG-106393 Pick-to: 6.4 6.5 Change-Id: I4a164bc809c3606b43f267514a66ff017efeb4af Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* macOS: Limit cursor update workaround to Monterey and belowTor Arne Vestbø2023-01-031-16/+18
| | | | | | | The AppKit issue has been fixed in Ventura. Change-Id: Ic2c0a0ed4ad52ef2d52410ec2c8ba061907cbe8e Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* macOS: Send synthetic cursorUpdate events for utility windowsTor Arne Vestbø2023-01-031-3/+9
| | | | | | | | | | | | | In faffaa729282b435fb330e1c92523fc0df3fc051 we limited our cursor update workaround to key windows, but macOS also sends cursorUpdate events to non-key windows with the NSWindowStyleMaskUtilityWindow style mask, so we include this in our workaround logic from ae8e96d4c2fc43. We include NSWindowStyleMaskTitled in this check, as macOS seems to require a window to be titled to treat it as a utility window. Task-number: QTBUG-96374 Change-Id: I1c54da181acbe472c2f598fec37aeadada3956bb Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QWindowsKeyMapper: make the code locale-independentMarc Mutz2023-01-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | The C toupper function is locale-dependent. Given the right locale (Türkiye, e.g.), toupper(i) is either - İ (LATIN CAPITAL LETTER I WITH DOT ABOVE; if representable) or - i (unchanged; if it isn't) The latter is clearly wrong. The former might be what is wanted, but since most locales these days are UTF-8, Í will be unlikely to be representable in char. So I conclude that what's intended here is that i gets mapped to I, even in the Türkiye locale, so use the new QMiscUtils::toAsciiUpper() instead of <ctype.h> toupper(). Fixes: QTBUG-109520 Pick-to: 6.5 6.4 Change-Id: I6fee2fb15c2facae79f1727455180567698fed80 Reviewed-by: Samuel Ghinet <samuel.ghinet@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>