summaryrefslogtreecommitdiffstats
path: root/src/plugins
Commit message (Collapse)AuthorAgeFilesLines
* Android: Fix the offset of the EditPopupMenuPekka Gehör2022-06-291-3/+14
| | | | | | | | | | | Fix the offset of the EditPopupMenu on application window. Issue caused by a5bb7b3ca510c301baf84e1dd46d5aeeb4986eb2 Fixes: QTBUG-71900 Change-Id: Ib95e1544fe91c273bc5317bd338a50a74fb1090a Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit 526d62ee90d549177920eb567cb951c4b553c630) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix typo in codeDuan Ting2022-06-251-1/+1
| | | | | | | | | | Found by codespell Change-Id: I75f4b14f3eded035a0c904d8a7174cb6f5b7d9ef Reviewed-by: Wang Bo <wangbo@uniontech.com> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit cd268e9e1d57ca2159371f3c4f93a63d3fe66c4e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* wasm: do not allow blocked windows to be resizedLorn Potter2022-06-221-5/+10
| | | | | | | | Fixes: QTBUG-102869 Change-Id: I69a4afbb67618dce7bcc499208e7e608e9adf212 Reviewed-by: David Skoland <david.skoland@qt.io> (cherry picked from commit cf9cd8cc081397d08f48b6ae0d9380b11f4929dd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* wasm: improve the specialHtmlTargets testMorten Sørvig2022-06-221-4/+8
| | | | | | | | | | | | | It can actually be undefined, so test for that before checking the object type. This fixes the asyncify build. Change-Id: I5a6a0bc60c153290c35c20242400c59cd1312403 Reviewed-by: Aleksandr Reviakin <aleksandr.reviakin@qt.io> Reviewed-by: Lorn Potter <lorn.potter@gmail.com> (cherry picked from commit 492b338f570afce3fbadb518bb0b9ab7fdf67e03) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add ExpandCollapse UI Automation pattern to combo boxesAndré de la Rocha2022-06-222-7/+14
| | | | | | | | | | | | Also add support to expandable/expanded states to QAccessibleComboBox in widgets. QtDeclarative will still require updates so that QML combo boxes report the expanded/collapsed state and react to UIA actions. Task-number: QTBUG-103591 Change-Id: Iff8ba5e3143778ce17998dbe7f5f76cae658dc19 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit ecd41111a3a7100f20e72b811b1010bc45e94127) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* xcb: Port XSync call in QXcbWindow::create to xcbIlya Fedin2022-06-211-3/+1
| | | | | | | | | | QXcbConnection::sync is a full equivalent of calling XSync with false, they both are sending GetInputFocus request and getting its reply Change-Id: I4f91b9447a02def41a8693a54312856b56e74811 Reviewed-by: Liang Qi <liang.qi@qt.io> (cherry picked from commit 56a33edf2a156727043c47023f5503f88913b466) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* xcb: fix missing initialization of m_cursorNils Jeisecke2022-06-212-7/+6
| | | | | | | | | | | | | | | | | | | | | Regression introduced in 9a4c98e55659b32db984612e6247ac193812a502: m_cursor is not initialized and never set when monitorInfo is not available in QXcbScreen::setMonitor. This seems to happen when running in VNC, e.g. on a Raspberry Pi. This usually results in crashing the application pretty soon. Using a unique_ptr solves both the initialization and a possible leak when setMonitor is called multiple times. [ChangeLog][Linux/XCB] Fixed crash when no monitorInfo is available (e.g. VNC). Fixes: QTBUG-104443 Change-Id: If13493c177121a1994b5d00dfbd64f1da694df2e Reviewed-by: Liang Qi <liang.qi@qt.io> (cherry picked from commit 03e76ac23d3f9892c5853cab8760ca46c9117229) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* xcb: set primary screen more correctlyLiang Qi2022-06-212-4/+17
| | | | | | | | | | | | | | | | For example, when having virtual monitor which includes two real monitors, the primary information in xcb_randr_monitor_info_t is normally false, because user can only set it for output. Kudos to Jiang Wu for his first patch and details of the issue. Done-with: Jiang Wu <wujiang@kylinos.cn> Change-Id: I6af443ff69d347a6d86efc9c8ea7a5d18f4c3e24 Reviewed-by: JiDe Zhang <zhangjide@uniontech.com> Reviewed-by: Jiang Wu <wujiang@kylinos.cn> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit a79e2aafd63071da42212f6d30e64aef878154ab) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* xcb: clear m_singlescreen before updateJiang Wu2022-06-211-0/+1
| | | | | | | Change-Id: Iafff57be82b5beb1f5702c00e0b6d7d0dd3ccdc2 Reviewed-by: Liang Qi <liang.qi@qt.io> (cherry picked from commit fd9aeb1b38e1b42d497723457317ba1b0cfeef8e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Windows: Avoid accidentally copying QWindowsScreenManagerTor Arne Vestbø2022-06-203-3/+4
| | | | | | | Change-Id: I60b219e9a3ea62a96c369ee910eacf06d61f4f71 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 7d2488280ee46fd07f31c895b765ee4072fc1a5a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Port QXlibEglIntegration::getCompatibleVisualId to xcbIlya Fedin2022-06-204-20/+142
| | | | | | | | | | | In combination with EGL_EXT_platform_xcb support, this allows xcb_egl to be used without xlib. Without EGL_EXT_platform_xcb support, this still reduces amount of code using xlib. Change-Id: I29e2b29f7ef8ea34320887f62697f84232b86fba Reviewed-by: Liang Qi <liang.qi@qt.io> (cherry picked from commit c3e624eb50ff56dd0d172999a49c454f37ca62cd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix tst_AndroidAssets, broken by recent changes on assets load speedLouis du Verdier2022-06-201-4/+5
| | | | | | | | | | | | | | | | | | | | | | | Recent changes on load speed of individual assets made AndroidAbstractFileEngine use a cache for basic information in order to avoid to have to open assets every time a QFileInfo is created, which was very expensive for older phones. However, size() method was forgotten and continued to expect that the asset would be opened first, and therefore QFileInfo().size() would always return -1. This change fixes this by caching as well the information about the size of the asset, and also reverts a part in open() to close() first in case asset would already be opened, in order to keep previous behavior (even if this did not cause any known issue). Fixes: QTBUG-104412 Change-Id: I992f31b8f9e14dfec44cec78d0c1a2a3e18bdb7f Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit d7068eaad7c180c814a766c91cebee25f04513a6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Windows QPA: Fix indentionYuhang Zhao2022-06-201-42/+42
| | | | | | | | | | It seems this block of code was originally copied from elsewhere so the original indention is preserved. Change-Id: I53ab8e58b4304dfc768bd6472255a6c2d0471d5e Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 1e71071c92ee4520f392d3cec01131bb815117b1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Windows: Replace lcQpaWindows logging with lcQpaScreen in screen codeTor Arne Vestbø2022-06-181-5/+5
| | | | | | | Change-Id: I1d2fd586aac1163aa449f813ce3b7244c6ebaee0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit d350373133f169b44fd98faab6fe3f75abab6282) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Windows: Decouple screen change monitoring from top level QWindowsTor Arne Vestbø2022-06-187-14/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The WM_DISPLAYCHANGE message it sent when displays are added, removed, or update their properties such as the scale/DPI. We were processing this message as part of QWindowsContext::windowsProc(), which meant that we would only react to display changes if there was a QWindow on screen. Just creating a QGuiApplication was insufficient to pick up changes to screens after startup. In addition, despite being documented to post messages to child windows, WM_DISPLAYCHANGE only ends up in top level windows. Presumably it's the top level window's responsibility to post the message to child windows. As a result, if a QWindow was a native child window of a foreign window, such as in audio plugins being hosted in a DAW, we would again fail to pick up display changes. We solve both these cases by decoupling the WM_DISPLAYCHANGE handling from QWindowsContext::windowsProc(), by creating a dedicated window for listening to WM_DISPLAYCHANGE. This is similar to how we already handle tray icons, power notifications, clipboard, etc -- the only difference being that since purely HWND_MESSAGE windows do not receive WM_DISPLAYCHANGE it's an actual invisible WS_TILED window. This also lets us remove the workaround for QTBUG-79248, which was doing screen updates in response to WM_DPICHANGED when detecting that there were no QWindows. Task-number: QTBUG-103383 Task-number: QTBUG-79248 Fixes: QTBUG-102343 Change-Id: I905d8253069ec339b193edf05c052d21361ca3e9 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit fa0b2ef81c0d22f4038235871fbc1abda55887d1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* wasm: Fix up namespacing in wasm platform pluginLorn Potter2022-06-1813-7/+40
| | | | | | | Change-Id: I2fdbb6688b252743578dfcd58f9259eb5ac3cca8 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> (cherry picked from commit ff0c7dfc6e3198c91cad099fd09657b8abba1d33) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* wasm: fix unicode inputLorn Potter2022-06-173-9/+9
| | | | | | | | | | also remove duplicated function call to get Qt key for event Fixes: QTBUG-78826 Change-Id: Ibaf0dd3eb428b65280ed1f840a4849b44f2868e0 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> (cherry picked from commit 87c2a401dabacddb94b61595e2873627c222c60a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Update window state in QWindowsWindow and QXcbWindow geometry settersAxel Spoerl2022-06-172-0/+6
| | | | | | | | | | | | | | | | | | When QWidget::resize() is called on a maximized or minimized QWidget, the window state of the widget and the corresponding QWindow is not updated (i.e. remains maximized or minimized). This patch updates the window state to Qt:WindowNoState when setGeometry() is called in QWindowsWindow or QXcbWindow. A test is added in tst_QWidget. Fixes: QTBUG-104201 Change-Id: I07491fb9293d13509573fc403750da0a50f6a785 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 99c8ffb9f259760e45618f0988bbd79237d6d291) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Windows QPA: Update screen on child window DPI changeMorten Sørvig2022-06-164-2/+19
| | | | | | | | | | | | | | | | | | | | | | | Windows does not send WM_DPICHANGED to child windows, which means that the normal DPI change handling code does not run for QWindows which are embedded in a foreign, non-Qt, window. Add code which handles WM_DPICHANGED_AFTERPARENT. This event is sent to all child windows, but not the top-level window. Call checkForScreenChanged() here, similar to what the WM_DPICHANGED code does. This commit does not add code to resize the child window, since it is uncertain if this is the responsibility of the window which receives WM_DPICHANGED, or of each child window. Done-with: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Task-number: QTBUG-103383 Change-Id: Icf85dd0afa806609dbbe0ffc36efbc5127962c39 Reviewed-by: <stefan.wastl@native-instruments.de> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 077eddb3e1aaba1517d67e7c83574c16e971dc67) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* wasm: fix some coding styleLorn Potter2022-06-161-2/+7
| | | | | | | | | | - shorten a couple extra long lines - add space between functions Change-Id: I14ad7448372ba50f4b0299535c4261a5bbf415b7 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> (cherry picked from commit 4d25429746dd1d71aac373c5ecd3d56756ce4d80) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Avoid recursively updating screens when window moves screenTor Arne Vestbø2022-06-161-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The QWSI APIs for reporting added or removed screens is not transactional, so when several screens change at once Qt will see each screen change as a separate state. As a result, Qt, or the application itself, may react to the first of many screen updates by moving a window to a different screen -- one which is going to updated (removed) in the next iteration of QWSI calls. This caused trouble on macOS, where we use many different signals to detect that the system has changed the screens, one of them being that a window has been moved to a different screen. In the scenario above, we would be in the process of updating screens in response to the system going to sleep, which means all 3 connected screens will be disconnected and replaced with one fake screen provided by the system. As we delivered the removal of the first QScreen, Qt or the application, would respond by moving the window to one of the other two screens, which in turn would recursively trigger another round of screen updates. This round would then proceed to remove (and delete) all remaining QScreens. When we then recursed back to the initial round of screen updates we would continue iterating and operating on screens that had already been removed, causing a crash. Since we know that the screens will stabilize eventually, and that QCocoaScreen has cached all info based on the displayId and NSScreen, we can safely skip any recursive invocations of updateScreens(). Fixes: QTBUG-102021 Fixes: QTBUG-84741 Invaluable-help-by: Bruno Cadoret <bruno.cadoret_1@signify.com> Change-Id: I9ff96dbcbc6f308ad2729faf2db2de7ef08513c0 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit 2a76c41fdd1546b614295ccf72ae2f0bcc704e1d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qwasmtheme: Enable hover effects by defaultMaximilian Goldstein2022-06-161-0/+2
| | | | | | | | | | | | | Previously hover effects had to be enabled manually due to not being enabled in the platform style. This change enables them by default. Fixes: QTBUG-88799 Change-Id: I014e1f5dfcd9b15656f11e12ab75a77d42f4815c Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Lorn Potter <lorn.potter@gmail.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit 64f86ca03eeda4ea52ec15546edc5a0bc183bc8a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Android: Improve loading speed of individual assetsLouis du Verdier2022-06-151-18/+46
| | | | | | | | | | | | | | | | | | | | | | | This change improves the loading speed of files stored in Android assets folder by caching the information about files already opened. Prior to the change, when creating a QFile or QFileInfo to an asset file, the engine would first scan all the file's directory and parent directories in order to cache all this in FolderIterator::m_assetsCache. Due to the nature of Android assets, it might be very slow, depending on the number of images in this tree. In this patch, individual file accesses will stop using FolderIterator and will simply open what is asked, caching the information about the resource in order to avoid to have to call the expensive AAssetManager_open if the file is accessed again (e.g. by QFileInfo). Fixes: QTBUG-101161 Change-Id: Iaedf4cdf83d5116053b51895a6795d43bc60f942 Reviewed-by: Rami Potinkara <rami.potinkara@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> (cherry picked from commit edd983071e0a90ee8665d2f45916fb575fc25857) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix typos in docs and commentsKai Köhne2022-06-1517-23/+23
| | | | | | | | | | Found by codespell Change-Id: Ie3e301a23830c773a2e9aff487c702a223d246eb Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 9d2cc4dd766ca6538e17040b6ac845ed880ab0fe) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Replace QT_NO_ACCESSIBILITY with QT_CONFIG(accessibility)Allan Sandfeld Jensen2022-06-1520-44/+46
| | | | | | | | Change-Id: Iee4bd8970810be1b23bdba65a74de912401dca65 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Marc Mutz <marc.mutz@qt.io> (cherry picked from commit f53f7095044275767e389d16aabad5ff7144ec9f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Make rhiFlush() support custom source DPRMorten Sørvig2022-06-154-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | The rhiFlush() implementation currently assumes that QWindow->devicePixelRatio() is the correct scale factor for transforming device independent window geometry to source geometry. However, this assumption does not hold if/when we add support for drawing to a rounded-up DPR, with a downscale later in the rhiFlush implementation. Fix this by adding a sourceDevicePixelRatio argument to rhiFlush(), which is set to either QWindow::devicePixelRatio() or QWidget::devicePixelRatio(), depending on from where it is used. Change deviceRect() and friends in qbackingstoredefualtcompositor.cpp to be scale*() functions instead which take a scale factor instead of a QWindow. Update call sites to use srouceDevicePixelRatio where that makes sense. Change-Id: Idb7b1e2f36816a201e00f0defe100d2dc079cb17 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit d38118c80828eecb3c0192404249c1fad5660792) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* xcb: Replace qCWarning by qCDebug in QXcbConnection::printXcbError()Axel Spoerl2022-06-141-6/+6
| | | | | | | | | | | | | | | | | Example: Error "BadWindow" (3) is raised by the XCB backend when a mouse event is processed on a resource that disappears between posting and processing of the event. That constellation is harmless and can occur in async environments. As XCB errors point to coding issues, this patch changes their logging behavior from qCWarning to qCDebug. Fixes: QTBUG-56893 Change-Id: Idee5ee80efaf9cd6686448779f76c68d5e4c9b63 Reviewed-by: Liang Qi <liang.qi@qt.io> (cherry picked from commit 373392eeb4199654e954f70ce919850f090d59bd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Ignore update requests for offline displaysTor Arne Vestbø2022-06-131-0/+5
| | | | | | | | | | | | Accessing a display that's offline may cause crashes, so to be on the safe side we skip update requests in this situation. Task-number: QTBUG-102021 Change-Id: I6b48b6722bccde628e510c538943d14f2b0271e5 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 5909e33d1dea34daef271598eb1c9dd06a238801) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Resolve screen name via NSScreen on macOS 10.15+Tor Arne Vestbø2022-06-131-1/+6
| | | | | | | | | | | Apple Silicon Macs no longer expose display information through IOKit. Luckily we can use the 10.15 localizedName property on NSString to resolve the name. Change-Id: Ie75430df1a80808cb7b23d97d1e440d1f3bf75d6 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit f7a56b32cc127e340e81e3e1cdb3f24f912863af) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Cocoa: fix build: add missing includeThiago Macieira2022-06-121-0/+1
| | | | | | | | | | qcocoansmenu.mm:21:38: error: implicit instantiation of undefined template 'QVarLengthArray<unsigned short, 10>' Change-Id: Iba16e8ea451b444ab213fffd16f4da39dfcc343d Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit bd40c1838931fd58c4f6d2622028162c28a6f046) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fallback to another file dialog implementation when XDP is inaccessibleIlya Fedin2022-06-133-33/+53
| | | | | | | | Fixes: QTBUG-98988 Change-Id: Idca1ab4cae0e9eabebc599f3c8efa136a7973918 Reviewed-by: Jan Grulich <jgrulich@redhat.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit fb981a0954119ed0dfa4a402fdef78e7257ffc96)
* Add QXdgDesktopPortalFileDialog::useNativeFileDialog()Ilya Fedin2022-06-082-4/+15
| | | | | | | | Task-number: QTBUG-98988 Change-Id: I39417f089d839a9af009791088bd20058532bd7a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 6f9f6849c53e057e8b4186db64a1a6b5e1f31eca) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fallback to PerMonitorDpiAware if V2DpiAware is not supported by systemVladimir Belyavsky2022-06-083-19/+21
| | | | | | | | | | | | | | | DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 might not be supported on some legacy Windows 10 editions (prior Creator Update). In this case SetProcessDpiAwarenessContext returns ERROR_INVALID_PARAMETER. Fallback to DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE using old API SetProcessDpiAwareness in such cases as the most suitable. Fixes: QTBUG-103733 Change-Id: I39216e63ecfcae96aaa159237a52b0a76bc5d956 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> (cherry picked from commit 4a2c31103c7c993c87f88087811e02804adfabf3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix a leak of fallback dialog helper in xdgdesktopportalIlya Fedin2022-06-061-3/+3
| | | | | | | | Task-number: QTBUG-98988 Change-Id: Id066f0dd2cacbc273deacd4f7df66c3787ad4017 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 36c1a7ba23eab079683a344dc34094c28a9f56e2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Windows: Don't terminate threads in QtVolker Hilsheimer2022-06-051-12/+10
| | | | | | | | | | | | | | | | | | | Terminating a thread that we don't have full control over might leave mutexes or critical sections locked, ending up with an application that can't allocate memory or open new windows. Also, if terminating of the thread would fail (which the code tried to handle), then deleting the QThread anyway would have triggered the assertion that we don't delete a running thread in ~QThread. So simplify this code: wait simply returns true if the thread isn't running anymore, no need for the double-check. Leave the thread running and leaking if it is stuck somewhere in Windows APIs while executing the native dialog. Fixes: QTBUG-103984 Change-Id: I34aa42cbde7c769a58c14bf524781cf3abd13b70 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* qiostheme: Don't determine the appearance mode from the keyWindowDoris Verria2022-06-031-1/+1
| | | | | | | | | | | | We were querying the traitCollection property of the application's keyWindow in order to determine the appearance mode (light/dark) of the app. However, the application may not have a keyWindow (visible window) by the time the we set up the appearance mode, so get that information from the last window in the application's windows array instead. Change-Id: If7435d9f565b5c594a26027c971c16a1e3a9af26 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Windows: fix crash on closing an app when native file dialog is openedVladimir Belyavsky2022-06-032-37/+25
| | | | | | | | | | | | | | | | | | | | | The crash was provoked by QThread::terminate() called for QWindowsDialogThread from QWindowsDialogHelperBase destructor. It's still not clear why terminating the thread here causes a crash, but normally we should avoid terminating a thread anyway. Current changes make several improvements to avoid terminating the thread. The main problem was that QWindowsDialogThread::run() was never returned. That's because QWindowsNativeFileDialogBase::close() was not called on QWindowsDialogHelperBase destruction. The second problem was that QWindowsNativeFileDialogBase::close() may still not close native file dialog because it was not able to find HWND for IFileDialog instance in some circumstances, so make this by more robust way. Fixes: QTBUG-93298 Pick-to: 6.3 Change-Id: I55c8cf664ae2cf7c41c8cce43a6bb88a2680bf14 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Expose the qtloader object globallyDavid Skoland2022-06-031-1/+2
| | | | | | | | | | | | When testing, we need to query the state of the Qt application, so change the scope of qtloader from inside the init function to global scope. Additionally, adjust the test script accordingly to query and use this state to make good decisions on how to terminate. Change-Id: I6264ba20843716eb87340b160680617b718f6bd9 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Streamline error handling in qtloader.jsDavid Skoland2022-06-031-13/+18
| | | | | | | | | | | | Added new function handleError which does the usual work whenever there there is an error, including logging the error to console. Also make the app exit when the emscripten module fails to load. Additionally, make sure we correctly report it as crash if the module fails to load. Change-Id: I9d723373a34ccbb146959a2207ebded8bcbd4f18 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* Fix misuses of 0.9999 constantAllan Sandfeld Jensen2022-06-021-9/+3
| | | | | | | | | Replace it with floor and round. It appears the old behavior was to work around combining ceil with inaccurate FP, but it doesn't appear this hacky ceil is needed. Change-Id: I5c16ec0fa4916e17198a733c46937fde53f2ddb5 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* wasm: don't enable specialHTMLTargets by defaultMorten Sørvig2022-06-012-11/+39
| | | | | | | | | | | | | | | | | | Adding specialHTMLTargets to EXPORTED_RUNTIME_METHODS carries the obligation to actually use it as well; failing to do so makes Emscripten stop with a reference error on startup. However, we can't guarantee that Qt will use it in all cases. The current usage depends on QGuiApplication being used. Application code could be using QCoreApplication, or no application object at all. Detect if specialHTMLTargets is present instead, and then enable the code paths which uses it if that's the case. This means that apps which want to use e.g. multiple browser windows can opt into support by making sure EXPORTED_RUNTIME_METHODS contains specialHTMLTargets. Change-Id: I81105aa01946602fcf593f170e305d7dc9bad3be Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* Initialize m_exclusive in QGtk3MenuItem constructorElias Rudberg2022-06-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | Problem detected while investigating a crash of a program using QT, valgrind was used to detect errors and valgrind reported "Conditional jump or move depends on uninitialised value(s)" due to m_exclusive being uninitialized. Not sure to what extent this fix matters in practice, the crash turned out to be caused by something else outside QT. But anyway it seems good to initialize m_exclusive like other things, in the constructor, and it helps avoiding such warnings from valgrind, that will make it easier to detect other problems using valgrind or similar tools. Amends ac8a1787eb74d374a346ae5982d0ea361747729e where it looks like initialization of this member was simply forgotten. Pick-to: 6.3 6.2 5.15 Change-Id: I3d1637a00b7899eded61c2e4f5f9a1c5041e4f45 Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Elias Rudberg <mail@eliasrudberg.se>
* macOS: create application menu as QCocoaNSMenu with delegateVolker Hilsheimer2022-05-263-1/+9
| | | | | | | | | | | | This way we can handle keyboard shortcuts for actions in that menu as well in our menuHasKeyEquivalent implementation. This allows the focus widget to accept the override, and e.g. a QKeySequenceEdit to record Cmd+Q which with a plain NSMenu will just quit the application. Pick-to: 6.3 6.2 Fixes: QTBUG-103590 Change-Id: I84597307aef8f0ab65d97d78e5aa15e5cf2e707d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* wasm: move CTRL <-> META comment into right placeMorten Sørvig2022-05-242-2/+3
| | | | | | Change-Id: I9f95542fd6a0326985744503a71e36448961d6fc Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: David Skoland <david.skoland@qt.io>
* wasm: Improve wheel event handlingMorten Sørvig2022-05-241-17/+14
| | | | | | | | | | | | | | | | | | | | | | | Always invert scroll deltas. This is what the code did before, expect for on non-Safari macOS. There is no need any "smart" code here: correct deltas are provided by the native API regardless of macOS scroll direction setting. Reading webkitDirectionInvertedFromDevice is still useful for certain use cases, such as 3D scene zooming or spinbox value change, where upwards motion on the trackpad should always correspond to "increment" regardless of scroll direction. Propagate this to Qt using one of the handleWheelEvent() overloads Finally, we were sending pixel deltas as angle deltas; fix by sending pixel deltas as well, but keep existing angle delta behavior for compatibility. Change-Id: I7a7104c30da057fefc0377816e551a9e7e2fa0e7 Reviewed-by: Lorn Potter <lorn.potter@gmail.com> Reviewed-by: David Skoland <david.skoland@qt.io>
* wasm: remove debug codeMorten Sørvig2022-05-241-8/+0
| | | | | | | Accidentally added with commit d4905016. Change-Id: Ie896dc79218f5778be552114d9e896fea8c80ed8 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* wasm: use correct geometry when drawing window decorationsMorten Sørvig2022-05-241-3/+3
| | | | | | | | | | | | | | We were drawing window decorations at an incorrect location in cases where the QScreen was not at (0,0) (i.e. at an offset on the web page). Window content was placed correctly. Correct canvas geometry can be fond by offsetting window geometry by the negative screen position. Implement this for drawWindowDecorations(), and also simplify the existing code in drawWindowContent(). Change-Id: I1347d325a58dae5e2bb950b93902123f64199ee8 Reviewed-by: Lorn Potter <lorn.potter@gmail.com> Reviewed-by: David Skoland <david.skoland@qt.io>
* wasm: update m_normalGeometry on setGeometry()Morten Sørvig2022-05-241-0/+2
| | | | | | | | | If we don't do this then applyWindowState() will apply the original window geometry from QWasmWindow::initialize(). Change-Id: I4a0fb7aa7984ba21c64364e0bf00d70513232d5d Reviewed-by: Lorn Potter <lorn.potter@gmail.com> Reviewed-by: David Skoland <david.skoland@qt.io>
* 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>