summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
Commit message (Collapse)AuthorAgeFilesLines
* 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 Change-Id: Ia4de30930a0dc1dc306c61e1553970c3dab67bd6 Reviewed-by: Liang Qi <liang.qi@qt.io> (cherry picked from commit 7311cdc0d2c10d47511e5b4850e3b348ea10e0d8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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 Change-Id: I485e2d4f3c654707c62adaba367c1b8afb3fc36c Reviewed-by: Liang Qi <liang.qi@qt.io> (cherry picked from commit 25a7034d78aeb12726a1052d64c0aa3314a1f69d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* iOS: Keep undo/redo widgets enabled on the undo shortcut bar after undoTamás Martinec2021-05-051-1/+14
| | | | | | | | | | | | Having two undo/redo operations on the rebuilt undo stack always enables the undo/redo widgets on the shorcut bar. This might be more desirable than the current behavior that only allows one undo from the shortcut bar. Fixes: QTBUG-63393 Change-Id: I2c99f27895def47b58534035461ceb7b4e5c3057 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 3b155973c494e847b821f0b5675a061f4e424a6c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Don't override action set during drop handlingAndy Shaw2021-04-291-1/+3
| | | | | | | | | | | | | | | | | When the drop has been handled, the target might have accepted a specific action by calling QDropEvent::setDropAction. Don't override that with the operation received by the OS if the drag'n'drop operation takes place within the same application. If the operation comes from outside, we have no choice but to trust the OS. This way the drag-site will get the action accepted by the drop-site when QDrag::drag returns. Fixes: QTBUG-77427 Change-Id: I0e4c86adeeea66b345966a03a3251fa62263b3e8 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit a014300898bd3bd574ef19bba7123d4b5a07789b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* xcb: Add more debug info for XCB_INPUT eventLiang Qi2021-04-271-1/+44
| | | | | | | Change-Id: I99bba80659a103aa79426ae94cd04db2c5d851d6 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 6a91ad7b5b429a9e277a4eedd7161b052b3acf68) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* [Android] Fix select handles misplacement on QDialogPekka Gehör2021-04-261-6/+19
| | | | | | | | | | | Get select handles {Left, Right}Point from a mapToGlobal with a cursorRectangle of anchorRectangle of the selected word/text Change-Id: I3425104c90f0efe6a1e4337328cf06dc93685b6f Task-number: QTBUG-90799 Reviewed-by: Rami Potinkara <rami.potinkara@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> (cherry picked from commit 56b54743e001c4af196c1e4786118d88b1d2cd2f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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. Change-Id: If6adac0c88198579332ddebc673f1524f324c0e4 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> (cherry picked from commit 6560778616b090f8cc73700675ec2ef385953fb6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* iOS: Protect against a possible crash after the window is deletedAndy Shaw2021-04-192-1/+3
| | | | | | | | | | | | | | | | | | If we are in a case where the original window is deleted before a new one is shown then we need to make sure that we are not still expecting that the original one has the focus. So we protect against the crash by only outputting the address of the object that previously had focus. A follow-up patch will be done for inclusion from 6.2 that will fix the root cause of the pointer being invalid when the only window is deleted before a new one is shown. Fixes: QTBUG-92173 Change-Id: Ifdb3fd6b6cb8fb8e8b79d2c325a30c27b298d8a9 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit b050d4867f68c3d35493221d65d343749504c988) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Don't disable menu items that belong to the active modal windowVolker Hilsheimer2021-04-123-5/+18
| | | | | | | | | | | | | | | | | | | A popup/context menu created via QQuickPlatformMenu doesn't belong to any menubar, so by disabling items in a menu that doesn't belong to the currently active menubar (5b9f6862b1), we disabled all menu items in a QQuickPlatformMenu when a modal window was active. For such unrooted menus, use the QCocoaMenuObject data structure to record which window it is shown for, and only disable items if that window is not also the current modal window. Amends 5b9f6862b1aa474a392203c69f6db678d633cecf. Fixes: QTBUG-92040 Change-Id: I56b6d579e5e94689b43ca84d4637e35dc2cbeb4c Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 2bdaf28034541cd57b0aa7c067fda8cfbffa0e94) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Windows QPA: Fix accessibility focus event for table/tree/listAndre de la Rocha2021-03-251-0/+11
| | | | | | | | | | | | | The focused element within a table, tree or list was not being informed in the UI Automation focus change events, causing the focused element to be missed by screen readers. Fixes: QTBUG-91029 Change-Id: I738502e6871358508b4510763018837c304b618e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> (cherry picked from commit f1eccab04e01b3acc1a4b4c6a5fe7b3af3e2dcba) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Return the result we have already when getting an object with no nameAndy Shaw2021-03-241-1/+1
| | | | | | | | | | | This will ensure that something is set for the AutomationId based on the actual object and the parents that do have object names until it reaches one without an object name. Change-Id: I205485bc0ba772e321879e00e64ea8e1d8f1ba91 Reviewed-by: André de la Rocha <andre.rocha@qt.io> (cherry picked from commit 5577cbaac59e7fc198ea2c98c1e4268779fbf0b4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Include minus sign in ImhFormattedNumbersOnly's available keysEdward Welbourne2021-03-161-3/+1
| | | | | | | | | | | | | | | UIKeyboardTypeDecimalPad only provides digits and decimal point, no minus sign, but ImhFormattedNumbersOnly is documented to provide a minus sign as well. UIKeyboardTypeNumbersAndPunctuation includes punctuation, which should cover signs as well as decimal separator, so use that - same as for ImhPreferNumbers. A little more permissive than we want here, but that's better than more restrictive ! Fixes: QTBUG-91455 Change-Id: I0418946014e0a66d503e61704154fd7798a0b785 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 17bf553b76ebd688e58e4de4271407e2058d89ef) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* xcb: unset old states and set new ones for windowLiang Qi2021-03-081-16/+33
| | | | | | | | | | This partly reverts a02959bb5b43a3f9d881e5213ceedf535202b6a1. Fixes: QTBUG-87078 Change-Id: I69e18ad3c0a8d142b2e1f5ab87990addc97d9df1 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit f61b140482d9578c07410a5979379e44e05352e5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Android: make calling exit() conditional on an environment variableVille Voutilainen2021-03-051-2/+3
| | | | | | | | | Task-number: QTBUG-82617 Task-number: QTBUG-85449 Task-number: QTBUG-83043 Change-Id: I5ac67b5d57550e5a1f816e5db01f4aab31127283 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit 6e0ce4ee8005d36ee5d080212b8d83b42ebcae17)
* Fix handling of virtual/native pixels in QAndroidPlatformWindowAndreas Buhr2021-02-231-7/+14
| | | | | | | | | | | | | f92e1953699b2529cc6ea2fd399fe4f2b887e83c made sure a new QAndroidPlatformWindow always has a geometry. However, it did not take into account HiDPI handling. This patch fixes it and introduces proper HiDPI handling. Fixes: QTBUG-91161 Change-Id: Iddf31b7abfd0a1bada3b051ed4de3bf6c2897d8e Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit dec429e0778493bc4e85d6b18202804d0bbbe5f1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: don't let windows that are transparent for input become key windowVolker Hilsheimer2021-02-192-2/+3
| | | | | | | | | | | | | Such windows are typically used as mostly transparent overlays on top of other windows underneath. Letting such an overlay become the key window breaks cursor updates and focus handling. Fixes: QTBUG-83632 Change-Id: I192d419a5bdb8dfa0e9223e9fbbd7876c62fe743 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 24b07b2b2d367c61b911c8f3a72f7209ef7e00d2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* iOS: Disable three-finger-tap editing interaction menu when there's no focus ↵Tor Arne Vestbø2021-02-111-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | object A typical Qt application, such as a QML application, is a single full screen QUIView, containing all of the granular controls of the UI. The view accepts first responder status, so that we can pass on text input to a possible text field inside the UI. That however triggers iOS to bring up the editing interaction menu whenever the user taps with three fingers, as iOS can't know that only parts of our view is suitable for interaction. To mitigate that we override the editingInteractionConfiguration getter of the view, as documented, and dynamically report the correct enablement based on whether we have an active focus object that accepts input. This works because iOS queries the getter from the three finger tap gesture recognizer, before showing the menu. Change-Id: I0874340c42e437e1d7251896993f2eafe122f09e Fixes: QTBUG-89735 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit f0f00dbd119e0169bc81aa761e4d548e4ecf2214) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* iOS: close edit menu upon focus transferRichard Moe Gustavsen2021-02-111-0/+3
| | | | | | | | | | | | | | | | | If you select text, the edit menu will show. But if you tap directly inside another input field, and as such, transfer focus, the menu will continue to stay visible. This patch will ensure that we hide the edit menu when the input field that it was requested for looses focus. Fixes: QTBUG-90937 Change-Id: I1d97bd57fc793826a3170404795b06a1e058d1b7 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> (cherry picked from commit 0bae5fbabbb64371b1b6c646ce0a32e084e42f83) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Don't assume NSEvent charactersByApplyingModifiers: produces characterTor Arne Vestbø2021-02-051-2/+5
| | | | | | | | | | | In cases where the keyboard layout doesn't have a mapping for a given event and modifier combination the result will be an empty string. Fixes: QTBUG-90683 Change-Id: Ice06241f0ae71a19cde041410818decc312bc630 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> (cherry picked from commit 7c85a45fde5dd3f84eb033261ccb0d54ee72d30c) Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* macOS: Don't wrap key event keys in QCharTor Arne Vestbø2021-02-052-13/+17
| | | | | | | | | | | | | | | | | | | | | | | | Key events have a wider range of possible values than the unicode range, as they also include all the special keys as defined in Qt::Keys. Instead of turning the argument to keyMapForKey into an integer, we can remove the argument completely, as it was only used as a fallback in the cases where UCKeyTranslate (or in the future, charactersByApplyingModifiers:), failed to map the virtual key and modifiers to a character. But in those cases we should not fall back to the Qt key from the key event, as that doesn't match what the keyboard layout defines. Most keyboard layouts explicitly define the base key as the key for these "undefined" mappings, but if the keyboard layout does not, we should not produce any input in the application, to match what AppKit does in this case. Fixes: QTBUG-90315 Change-Id: Ib9ffd9521049ee8e4b103597c1d34cbe3d23dbdf Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> (cherry picked from commit 6faa33192c99f3432b28591b991918b47bd6fa09) Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* a11y: Report mixed state if QCheckBox is PartiallyCheckedJan Arve Sæther2021-02-051-0/+2
| | | | | | | | | | | Previously it only returned checked or unchecked for a tri-state checkbox. Fixes: QTBUG-84616 Change-Id: Ife72098e35f8295fd389bda232de5478ffa7e87f Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit f4887aca1e5ac7b90abf862d7c9828417a74a1b6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* iOS: hide edit menu if typing on the input panelRichard Moe Gustavsen2021-02-041-4/+8
| | | | | | | | | | | | | | | | | On iOS, if you select some text, the edit menu will show on top of it. And if you tap on the screen (or inside the menu) it will hide. But if you type on the input panel, it will stay open. This is wrong. This patch will keep better track of whether or not the edit menu was opened by us, and if it was, ensure we close it also if the cursor moves by typing on the input panel. Fixes: QTBUG-90860 Change-Id: I0a51382030560182e7925c8b694b42e50943514e Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> (cherry picked from commit b39081230428a9cc08389342c4610d11b2ee210d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* iOS: always hide edit menu when showing the magnifier glassRichard Moe Gustavsen2021-02-011-6/+1
| | | | | | | | | | | | | | | | | | | | Bug: If you do a press and hold on a line edit, the edit menu will show to let you select a word etc. If you now do another press and hold to bring back the magnifier glass, the edit menu will stay open while you move the magnifier glass. This patch will ensure that we always hide the edit menu when we show the magnifier. There is never a case where both of them should show at the same time. By hiding the menu from the place where we show the magnifier means that we can remove code from the QIOSSelectionRecognizer that used to do this for one of the cases from before. Fixes: QTBUG-90743 Change-Id: If2a92f94422c730c2b223129d96f5bc3bf3deeee Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> (cherry picked from commit 3811be28adc9022f7a7ac1a15385ae91beaf9889) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Cocoa: When validating menus, account for modal window only if activeAndy Shaw2021-01-291-4/+3
| | | | | | | | | | | | | When a modal window is WindowModal then it is possible for another top level window to be active and therefore the menus shown may be valid for the window. So we can still allow the menu items to be validated in the context of that window. Fixes: QTBUG-74088 Change-Id: Ifb9c3fe12654b2972e0e3c368dc093fae1ed4cc8 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 115bcdb862ec52ebda04e1337f978096d8879e6d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Don't restrict non-modal file dialogs to open-dialogs onlyTor Arne Vestbø2021-01-261-16/+14
| | | | | | | | | None of the APIs used for non-modal operation require NSOpenPanel. Change-Id: I7ea49a8dad6e724a8a0d4321ea443d4cdcc5a6b1 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> (cherry picked from commit d7c07578bc02be1f0c3c3c3c3d64b020f2ec50ac) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Show system tray icon on mouse button press, not releaseTor Arne Vestbø2021-01-261-1/+1
| | | | | | | | | | | | | | | | This was a regression from 395e2d9bc48941d6. The system behavior is to show the menu on press, so we follow that. This is also documented at: https://doc.qt.io/qt-5/qsystemtrayicon.html#ActivationReason-enum Fixes: QTBUG-86518 Change-Id: Ia4dc5356bf0377a9d55f238caf5bf1becd95648d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit fce391fefb0bbdea220aa2c935ca6f154f6121cf) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Don't exec file dialogs via runModal unless they are app modalTor Arne Vestbø2021-01-252-20/+40
| | | | | | | | | | | | | | | | | | | | | | | Non-modal or window modal dialogs are shown at show(), via AppKit APIs that are non-blocking. If we want to block execution at this point, we need to spin our own event loop. The runModal API of NSSavePanel is not meant to be used for blocking execution for already shown dialogs, but is reserved for application modal dialogs. This means we no longer trip over AppKit's understanding of what state the dialog is in, which would result in the dialog not reporting back any files. It also allows us to remove the guard for closing dialogs twice. We now also correctly close and end the application modal session if the dialog is closed programmatically using Qt APIs. Task-number: QTBUG-89959 Fixes: QTBUG-85547 Change-Id: Ida3dc404417789d4823822ecfbf0935591c23878 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> (cherry picked from commit aa3b42d6342c6756c3ce941db0bbf1122ae48224) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* iOS: ensure we hide the edit menu while dragging on the selection handlesRichard Moe Gustavsen2021-01-201-0/+9
| | | | | | | | | | | | | | | | | | | | | iOS used to close the edit menu automatically when the user tapped on the screen (even for menus shown explicitly using the UIMenuController API). Apperently this has now changed (probably as a part of [UIMenuController setMenuVisible:] being deprecated in iOS 13). So we now need to hide it explicitly instead. Because of this, the edit menu would be showing together with the magnifier class while the user was dragging on any of the handles. This patch will fix this, so that we close the edit menu explicitly whenever the user starts dragging on a handle. Fixes: QTBUG-80298 Change-Id: Iff2032d64db1b582fa7f048c6a1f37ec8a1528af Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> (cherry picked from commit 2e35a03cd624c006b92cb95847231c8b1efde45b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* iOS: ensure we close the edit menu when the user taps outside the input areaRichard Moe Gustavsen2021-01-201-32/+50
| | | | | | | | | | | | | | | | | | | | | | | | iOS used to close the edit menu automatically when the user tapped on the screen (even for menus shown explicitly using the UIMenuController API). Apperently this has now changed (probably as a part of [UIMenuController setMenuVisible:] being deprecated in iOS 13). So we now need to hide it explicitly. Because of this, we no longer close the edit menu if the user taps outside the input area. This patch will fix this by updating the logic in QIOSTapRecognizer to close the menu explicitly. There are some more details around when to show or hide the menu, which is commented on at the relevant places directly in the patch. Fixes: QTBUG-90332 Change-Id: I336e3f4003817b39c7abf63f963fde1f3ef87c20 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> (cherry picked from commit 427e639275be379e3577cd3b3c8a63a6b5e46d46) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* [Android] Fix Text select handle misplaced on fields inside QDialog issuesPekka Gehör2021-01-201-2/+2
| | | | | | | | | | | | Get cursorPoint from a mapToGlobal with a cursorRectangle of the selected inputMethod Fixes: QTBUG-65229 Fixes: QTBUG-58503 Change-Id: I89b056fa91c59d260f02164c9bd6672b5ada64d6 Reviewed-by: Rami Potinkara <rami.potinkara@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> (cherry picked from commit a5bb7b3ca510c301baf84e1dd46d5aeeb4986eb2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Remove DontConfirmOverwrite workaroundMorten Johan Sørvig2021-01-201-9/+2
| | | | | | | | | | | | | Does not work any more on recent macOS versions. As a bonus, Qt now handles file names which contain “___qt_very_unlikely_prefix_” correctly. Task-number: QTBUG-39791 Change-Id: I944a68efa18edc72939d953ab32ecb53d8f8e1c4 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit fded886ff4b9869c1a9e016e3fae05cc409c9ccd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* eglfs: Use drmClose in drm/EGLDevice backendLaszlo Agocs2021-01-181-1/+1
| | | | | | | | Fixes: QTBUG-90350 Change-Id: I29a71e4abc2df7b777a895792bc5385a89223895 Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit 957344123672e891a25e55b54dcb012d2017b27a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix VNC format conversionAllan Sandfeld Jensen2021-01-134-8/+9
| | | | | | | | | | | | | Pass the right from depth to the conversion function, and set the right format before creating the compositor image for RGB16 support. Fixes: QTBUG-85621 Change-Id: I76f46a3c2d8f1d2b040b790035dbdb0a960ff1a7 Reviewed-by: Andy Nichols <andy.nichols@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit 47c6b5b91e0d1271075d98ded5aa7a25296b5ee3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Revert "Windows QPA: Call QWSI::flushWindowSystemEvents() from WM_PAINT for ↵Morten Johan Sørvig2021-01-131-3/+2
| | | | | | | | | | | | | | | | | | | | full update only" This reverts commit a81dfb32d6f9e7a407567511c20b59e537f6a063. Paint immediately on WM_PAINT in all cases in order to avoid flicker on resize. The cases mentioned in commit a81dfb should no longer apply: - QTBUG-38327: QGLWidget is not supported in Qt 6. - QTBUG-39842: Fixed by using ExcludeUserInputEvents. Fixes: QTBUG-89688 Change-Id: If82cf7703d6663982769048e86a7060223730ce7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> (cherry picked from commit 9f894788dda8407c6221aaa1491cd54a5a2b4cb7)
* macOS: Don't try to close already-closed/closing file dialogTor Arne Vestbø2021-01-121-1/+7
| | | | | | | | | | | | | | | | | | Doing so results in a warning about "modalSession has been exited prematurely - check for a reentrant call to endModalSession:", and on Big Sur will also result in the file failing to save because the return code from runModal will no longer be NSModalResponseOK. This would happen when the completion handler for beginSheetModalForWindow would call QNSOpenSavePanelDelegate_panelClosed, resulting in calls to QDialog::done(), which in turn tries to hide the dialog, via QCocoaFileDialogHelper::hideCocoaFilePanel(). Fixes: QTBUG-89959 Change-Id: I048afe3dcc7fe62e0d0273f12b4b2c0237abb052 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit 163d9c7cc46aa9174fdaaac8d64d8050f05c0a1f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Windows QPA: Fix crashes when using screen reader with Q(Plain)TextEditFriedemann Kleint2021-01-121-2/+6
| | | | | | | | | | Make sure the search start with valid values. Task-number: QTBUG-89354 Change-Id: I5b5100db89c62f23748b5c88e9188cfe3811e6e8 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> (cherry picked from commit 7b7dda654acda884b8ebf6e7f2bfed315a566801) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Send Qt::Key_MediaTogglePlayPause for VK_MEDIA_PLAY_PAUSEAllan Sandfeld Jensen2021-01-081-1/+2
| | | | | | | | | | | Speculative fix to get the right keys in WebEngine Fixes: QTBUG-89915 Change-Id: I79519b715a1415dccfc4601aae5025b3222a79ae Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> (cherry picked from commit d5a980df97051dea4b952a1f7c9558316454ccf0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Android: KEYCODE_MEDIA_PLAY_PAUSE translated rightPiotr Mikolajczyk2020-12-211-1/+1
| | | | | | | | | | | KEYCODE_MEDIA_PLAY_PAUSE was incorrectly translated to Qt.Key_MediaPlay. This patch changes it to Qt.Key_MediaTogglePlayPause. Fixes: QTBUG-66448 Change-Id: Icd2747857bc479228bfdffcd8ab8fdef7b79e918 Reviewed-by: Andy Shaw <andy.shaw@qt.io> (cherry picked from commit 096b4590d5aefc16b9c68611fdc1463b4c173f80) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* xcb: fix thread synchronization in QXcbEventQueue::waitForNewEvents() againIgor Kushnir2020-12-183-5/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch amends a41701904e880f58e19b352ade1931d6cd1a7112 If peeking into the event queue looking for a clipboard event fails, QXcbClipboard::waitForClipboardEvent() calls queue->peek for the second time to "process other clipboard events, since someone is probably requesting data from us". QXcbEventQueue::peek() in turn calls QXcbEventQueue::flushBufferedEvents(). This second flushing can acquire a waited-for clipboard event. The issue was that the code in waitForNewEvents() ignored this possibility and assumed that there were no clipboard events before or at its current m_flushedTail. If there were no more events on the X11 connection after tailBeforeFlush, the waitForNewEvents() in waitForClipboardEvent() blocked execution for 5 seconds and eventually timed out. The fix is to remember QXcbEventQueue::m_flushedTail just after looking for and not finding a clipboard event in the queue. And then wait for more events via QWaitCondition in waitForNewEvents() only if there were no more events after the remembered m_flushedTail. Fixes: QTBUG-75319 Change-Id: I4919c5b9b9227b3a8a29a11e7094f97960b3a121 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io> (cherry picked from commit f2d22d5a5126e7a73da620a60847fc124f724333) Reviewed-by: Liang Qi <liang.qi@qt.io>
* Android: Fix for accessibility potential crashPiotr Mikolajczyk2020-12-181-1/+1
| | | | | | | | | | When accessibility was not active it was possible to force its update, causing a null pointer exception in java. Change-Id: I60f65612d6e9f712ba3c591ffcc6803f06f09efb Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit fe51137f859948472571ce4c879955eb74c77716) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Android: Pass pending state to ResumePauseListenerBartlomiej Moskal2020-12-171-1/+6
| | | | | | | | | | | | | | | | | | | | It can happen that updateApplicationState() is called before m_androidPlatformIntegration is set. In such case, new applicationState will be remembered and propagated later. Before this change, pending application state was passed only to QWindowSystemInterface. ResumePauseListeners that are subscribed for changes to ApplicationActive/ApplicationInactive state also should be informed about new application state. Fixes: QTBUG-84737 Change-Id: I67e79860b340ee5de2d13d148a222e9f1c942b93 Reviewed-by: Rami Potinkara <rami.potinkara@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit 2eb77139a2deeb88c4d517dd5131f3e45d6acc1f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* xcb: Fix available geometry after rotationAlexander Volkov2020-12-132-5/+10
| | | | | | | | | | | | | | | QXcbVirtualDesktop::m_workArea is not updated after screen rotation if _NET_WORKAREA is not updated, e.g. when a window manager is not running. Use width of -1 for m_workArea to indicate that _NET_WORKAREA is not set and thus there is no need to find its intersection with screens' geometries. Change-Id: Ic1f3ec23576ed8407a76cc2b9f84a145c67b1d4b Reviewed-by: Liang Qi <liang.qi@qt.io> (cherry picked from commit df28d75721f7e57f4421ed8c4b8131da742f3967) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Remove warning about KVO observers on QNSWindow/QNSPanelTor Arne Vestbø2020-12-091-5/+0
| | | | | | | | | | | | | | | | | NSTitleBarView in Big Sur will observe the window it is in, but makes sure to remove these observers in viewWillMoveToWindow, as it should. To avoid spamming user logs with this warning we remove it. It was dubious what cases it would have caught anyways, as anyone trying to KVO observe properties Z of a child object Y of X.Y would need to track whether X changes its Y between adding and removing the observer. There are no guarantees that Y is stable, and this applies to an NSView's window property as well. Change-Id: I27a0d04625f96c4c5d382c39ac068721ce1e8f9d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit b58d6831de79ad21463e20c079093667918ee626) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Fix crash when showing parent-less platform menusTor Arne Vestbø2020-12-091-2/+2
| | | | | | | Change-Id: I80f02da1621e4088eb040bb16a4db3867b6ad4d7 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 7886fa8474bb6fc0274ef05f15981bc795125a47) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Android: Qml accessibility fixesPiotr Mikolajczyk2020-12-095-13/+87
| | | | | | | | | | | | | | | | | | | - Accessibility focus can follow the position of the widget (for example when swiping on a scrollview) - controls are clickable directly after appearing on the screen after scroll (previously you had to click somewhere else on the screen, and after that you could focus the newly appeared control) - checkbox and switch react correctly on click action - fixed combobox behavior with accessibility enabled Task-number: QTBUG-79611 Change-Id: If36914ab0165f33593e68fd7ecf168693f8538a7 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit fd20bc2277f98b86bddbd3f8a0ca92457a8c7c70) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix highdpi conversion of QTabletEvent coordinates on xcbShawn Rutledge2020-12-081-4/+2
| | | | | | | | | | | | | | Amends 1535fc9fb9ddbfce1680979c0634b4fdf8d75fca : when high-dpi scaling is enabled, there was an offset from the cursor position to the event position, because QWindow::mapFromGlobal() works in device-independent pixels, but we are using actual screen pixels here. Task-number: QTBUG-77826 Change-Id: Ic8743b9e5c4041065f530ed1d9d6c49337b0207a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> (cherry picked from commit 9d51fb579bb4655f6740096f17f1ced50258c28f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Always allow interacting with popup windows during modal sessionTor Arne Vestbø2020-12-081-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | f4889e63c7b changed the worksWhenModal logic for QNSWindow to be based on the transient parent relationship of the child window to the modal session window, to fix many issues where windows that should be blocked were not. Unfortunately, some window types do not maintain a transient parent relationship (e.g. QCompleter, which is itself just a QObject), or are not common for users to create with a QWidget parent (such as a context QMenu). This change restores part of the special-casing that was removed in f4889e, so that all popup windows are always allowed to be interacted with during modal sessions. This includes popup windows that were opened as part of a parent modal session, which would normally be fully blocked, but we assume that popup windows are intermittent enough that this will not be a problem. For now we leave out the other two special casings from f4889e, namely tool windows and dialogs. The former should in most cases be created with a parent window, while the latter definitely should. Fixes: QTBUG-88188 Fixes: QTBUG-88985 Fixes: QTBUG-87849 Fixes: QTBUG-86845 Change-Id: I005a402b21e8dc16c3b18bcd7e67d12b94a66f44 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit ae3594436b9b0540ef94379a73bf8fec8d3b7465) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Replace discouraged Q_MOVABLE_TYPE by Q_RELOCATABLE_TYPEAndreas Buhr2020-12-042-2/+2
| | | | | | | | | | | | | | | Q_MOVABLE_TYPE was conceived before C++ had move semantics. Now, with move semantics, its name is misleading. Q_RELOCATABLE_TYPE was introduced as a synonym to Q_MOVABLE_TYPE. Usage of Q_MOVABLE_TYPE is discouraged now. This patch replaces all usages of Q_MOVABLE_TYPE by Q_RELOCATABLE_TYPE in QtBase. As the two are synonymous, this patch should have no impact on users. Change-Id: Ie653984363198c1aeb1f70f8e0fa189aae38eb5c Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit 0440614af0bb08e373d8e3e40f90b6412c043d14) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Re-generate project files in srcJoerg Bornemann2020-12-015-7/+2
| | | | | | | Change-Id: I1f5f822d68129490f1a7c495f718aead0b520ca9 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit d4e9f0e6332d1ea740e28718d21281099c6d62e7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Windows QPA: Pass device for synthesized touch/tablet eventsFriedemann Kleint2020-11-274-12/+41
| | | | | | | | | | | | Add the overloads for mouse events with device/without timestamp and pass the active tablet or touch device. Task-number: QTBUG-88678 Task-number: QTBUG-46412 Change-Id: I8695b493540d0cbf50e9c72afe870a7633de3ab9 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> (cherry picked from commit d3caea04dc6c3a7072a43294b70bec860c199bf1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>