summaryrefslogtreecommitdiff
path: root/src/plugins
Commit message (Collapse)AuthorAgeFilesLines
* wasm: fix qtloader.js container element regressionMorten Sørvig2023-05-141-24/+10
| | | | | | | | | | | | | | | | | | | | As of Qt 6.5 the html document should not create canvas elements directly, but instead create div container elements and let Qt create and manage the canvas elements. However, qtloaders.js has not been updated to match this and is still creating canvas elements when given div elements. Remove the canvas creation code and invert the primary and fallback case: config.containerElements is now passed to instance.qtContainerElements. config.canvasElements is copied to config.containerElements, if set. Change-Id: I7372db93ee4de5b23a0a5d992597a3fbd9711a33 Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io> (cherry picked from commit 417b61b0158def614f4079761f85ccba39fba587) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Clear event dispatcher interrupt before running NSAlert modal sessionTor Arne Vestbø2023-05-101-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If the event dispatcher is interrupted we propagate the interrupt to lower event loop levels, in case they too need to be interrupted. And we defer the actual interrupt of the NSApplication to the next time we process Qt events, to avoid AppKit dropping queued events on the floor. This logic relies on QCocoaEventDispatcher::processEvents() setting the interrupt flag to false, which signals that we should not continue to tear down any further event loops. Unfortunately, native run loops such as running application modal sessions, are not driven by QCocoaEventDispatcher::processEvents(), so we never reset the interrupt, and end up ending the session immediately. To work around this we need to explicitly clear the interrupt flag before starting native modal sessions. This also fixes the issue seen in QTBUG-111524 with showing native alerts from nested event loops. Fixes: QTBUG-112697 Task-number: QTBUG-111524 Change-Id: I6aaec97011fd18c4a513c1dde3173b1cc4d50112 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit dcff882f30603dfeb91fbbb678bc053bfa453ed4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Fix leak of application menu NSMenuItemTor Arne Vestbø2023-04-291-2/+2
| | | | | | | | Fixes: QTBUG-112697 Change-Id: I0fe62e5a66f57bb9b8c073e636be346e088e0986 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit d01aa396171e101ba03638799c2c6fae6d116240) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add flicking behavior hints to xcb platform integrationShawn Rutledge2023-04-271-3/+5
| | | | | | | | | | | | For now these will be used in QtQuick Flickable. Task-number: QTBUG-35608 Task-number: QTBUG-35609 Task-number: QTBUG-97055 Change-Id: I944d7f0271d535822ceeef610f232f56c85e0938 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> (cherry picked from commit ebd2fe108ae4e72d94dd7e3bc0ed296253b68b3d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Avoid memory leak when using NSSlider for style drawingTor Arne Vestbø2023-04-271-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To fix the broken sliders reported in QTBUG-98093 a workaround was added by 4bee9cdc0ac4bbee7f061e8f6050d704032f6d0f where we would call initWithFrame on an already initialized NSSlider. This breaks the contract of object initialization in Objective-C, as the class is free to allocate and prepare resources for the instance without freeing previously acquired resources first. As noted by the Object Initialization chapter of the Concepts in Objective-C Programming guide, "Once an object is initialized, you should not initialize it again.": https://tinyurl.com/objc-object-init And as observed in QTBUG-112899, the additional initialization resulted in a memory leak. The other part of 4bee9cdc0ac4bbee7f061e8f6050d704032f6d0f was that we now called startTrackingAt twice when drawing. Both from setupSlider, for all consumers, and from drawComplexControl, and as it turns out, this is the key thing that "fixes" the pressed knob drawing of NSSlider. For some reason, NSSlider needs the duplicate startTrackingAt call both to draw the knob as pressed, and to not let one drawing pass affect another drawing pass. This would benefit from further investigation, but for now the removed leak is an improvement. Fixes: QTBUG-112899 Task-number: QTBUG-98093 Change-Id: Ia7e6ef963910f1858d2fdb10e0323fc5bb3b2eda Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit 4db9fdf58ea88420c5ca41c1547c55948b83d881) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Localize title of edit menu's NSMenuItem via AppKitTor Arne Vestbø2023-04-261-4/+39
| | | | | | | | | | | | | | | | | | | | | | | | | In 939b7bfe66221975d3a12a6d0a6dd14d9ad04344 we synced up the NSMenuItem's title to that of the corresponding NSMenu, as AppKit was observed to use the NSMenuItem title for its heuristics of when to add dictation and emoji entries to the menu. But AppKit's heuristics are based on the localized name of the edit menu, so we need to follow suit and look up AppKit's own localizations. This is of course fragile, as we're relying on this localization continuing to live in the InputManager table, but if that changes we'll just fall back to using the title from the NSMenu, as we did before. In addition, AppKit's heuristics also look for menu items in the menu that match selectors such as copy:, paste:, etc, so even if our lookup of the localized title fails, the additional heuristics would in most cases still succeed in detecting the edit menu. Task-number: QTBUG-53085 Task-number: QTBUG-79565 Change-Id: I5e12973b86ab35f10a8f7434bcae8a4cf134ecfd Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit a92c202b49777696cbc64003f6292e6b61952140) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Handle failure to create display link or invalid display linkTor Arne Vestbø2023-04-263-6/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | In some rare situations the display link may fail to create, or will be created in an uninitialized state: https://bugzilla.mozilla.org/show_bug.cgi?id=1201401#c123 When the latter happens the display link thread will crash in CVCGDisplayLink::getDisplayTimes(). Based on the Mozilla bug report, and subsequent patch, we can detect this situation via CVDisplayLinkGetCurrentCGDisplay(), so we follow the same approach, and then bail out: https://bugzilla.mozilla.org/show_bug.cgi?id=1201401#c158 Once we bail out we fall back to the timer based approach to delivering the update request. The next requestUpdate() will try to use the display link again, which will likely work this time around, as the display has had time to fully initialize. Change-Id: Ib80fd792516d1e4e7f863a82755cbf00d1eb6c34 Reviewed-by: Robert Griebl <robert.griebl@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit ac0953c34d287e00559829e575b3308ccf46cb0b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix crash at exit when tracingAntti Määttä2023-04-263-1/+11
| | | | | | | | | | | | | The crash is caused by the cleanup sending trace messages when the plugin has already been destroyed. Add shutdown callback to the plugin to indicate this has happened. We can't use signals since that also generetes trace event. Change-Id: I2e490fc51c2aaa97c240c1496a528a6ff6077bd0 Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io> Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io> (cherry picked from commit bb8aada627e23a7f7e23dfdb97d443f1b847086a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* wasm: rework local font supportMorten Sørvig2023-04-252-94/+127
| | | | | | | | | | | | | | | Populate a subset of the font families at startup if the local fonts access API is supported, and the access permission has been given. Since this code runs at app startup there is no opportunity to request font access. That should be done in response to user action, for example by having a "load local fonts" button in the application. Change-Id: Ib6826deeec06ee3def0e793dd1462977710462be Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io> Reviewed-by: Aleksandr Reviakin <aleksandr.reviakin@qt.io> (cherry picked from commit 15dab565d071455ef08d6bf4ad4980f726df1cfa) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Remove an unnecessary None definitionAmir Masoud Abdol2023-04-251-9/+2
| | | | | | | | | | We should be able to just pass `0L` and avoid defining a None macro. Change-Id: I513d726120454523627a1e66515a5a533c0238b1 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit eec5a016d35197726ba34fc759ab2e24bdbd37f5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Windows QPA: Fix restore geometry after dragging from maximisedTimothée Keller2023-04-253-0/+26
| | | | | | | | | | | | | | Start tracking the window geometry before a mouse drag, so that we can revert back to that geometry when we restore from maximised. Previously, when dragging from maximised to maximised, the restore geometry would end up being the final drag place before snapping to maximised, instead of where the window was before the first maximised. Fixes: QTBUG-112814 Change-Id: Ic2ddf29d6c4abdc9e8b0c5161b17aa6ee9474ea3 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> (cherry picked from commit 21e411687428d05655b8db2634466384fa35cc03) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Windows QPA: Handle DPI induced geometry change for frameless windowsTimothée Keller2023-04-251-0/+5
| | | | | | | | | | | | Make a manual call to the geometry change handling function after a WM_DPICHANGED event if the window is frameless, since WM_SIZE and WM_MOVE will not be called. Fixes: QTBUG-109429 Change-Id: I79b9f386fe120ee3d06d6490d3f31a7a5d7121b0 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> (cherry picked from commit e86fcae22144236258ad5d82eeb6b20b557e3981) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QPA:EGLFS - ignore scissor and stencil when drawing the cursorInho Lee2023-04-221-7/+11
| | | | | | | | | | | | In QEglFSCursor::draw, There are two missing pipeline states SCISSOR and STENCIL. Fixes: QTBUG-110080 Change-Id: Ifb2495de2685b7a2f80f8d39ab57d5985fe0eec1 Reviewed-by: Lisandro Damián Nicanor Pérez Meyer <perezmeyer@gmail.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit 544464c3d173246e58d39351599b0ffa87ec43df) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QGtk3Theme: Improve fixed font deliveryAxel Spoerl2023-04-201-2/+21
| | | | | | | | | | | | | | | | | | | | | The gtk_fixed widget was used as a reference to obtain a fixed font and HeaderViewFont. This is a mistake, because the gtk_fixed widget is a container for other widgets with fixed geometries and no layouting. This patch makes the default style being used for a fixed font and, as a drive-by, the combo box as a reference for a header view font. A monospace based css provider as explicitly added to the style context, in case a fixed font is requested. The provider is removed afterwards. Task-number: QTBUG-112896 Change-Id: I6bfb2ee9e7befdd2102bdcc6e53ced954a024034 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit 034a071bdac62e7e5cb4e44f7b19eb628b64d095) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Exclude Android Vulkan sources from Unity BuildAmir Masoud Abdol2023-04-201-0/+3
| | | | | | | | | | | If not excluded, `VK_USE_PLATFORM_ANDROID_KHR` might end up being undefined due to the order of includes. Task-number: QTBUG-109394 Change-Id: Ib7bbf42af319568bc39db0b9e5c796d25db3c364 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 972d602ee62421726abfefad4d6d9057c136570b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Exclude files from unity build to resolve Android's buildAmir Masoud Abdol2023-04-191-0/+12
| | | | | | | | | | | | | There are several duplicate symbols defined across android source files. For now, excluding the conflicting files allows us to continue working on bringing unity build to CI. I added some explanation and TODO's on what I think can be done for resolving the conflict. Task-number: QTBUG-109394 Change-Id: Ic0b31c4ae845c69570ea5dd86316e5a795c166c4 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit c2fd8241604787de9fd667f16c9a929fd36015c6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Resolve duplicate symbolsAmir Masoud Abdol2023-04-196-9/+16
| | | | | | | | | | | Turn some of the static variables into private static data members to avoid symbol duplication during the unity build. Task-number: QTBUG-109394 Change-Id: I9e3ee18f6e85a0f806de77f753d89a45ceaff7ac Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 22b0ed0757ac9c73e1f6974fb60d4f2dbc490e3f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Revert "Apply system background color for top level window"Vladimir Belyavsky2023-04-192-17/+1
| | | | | | | | | | | | | | | | This reverts commit 2991c66b75612dfb11dbba166dd08b2376b42102. Reason for revert: it caused a regression with translucent Qt Quick windows. We need to find alternative way how to fix QTBUG-106583 taking into account QQuickWindow's own color property. Fixes: QTBUG-112473 Fixes: QTBUG-112537 Fixes: QTBUG-111969 Fixes: QTBUG-112524 Change-Id: I34258f4c8b045b63c8462e325b09fff927684223 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit bf0f1fa7d1cf0eaad90601bbabb99c660d941cf5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Ignore removed/changed screens if no QIOSIntegration instance existsJan Moeller2023-04-191-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | QIOSTracker registers itself as handlers for system notifications about changes of the screen environment. If no QIOSIntegration instance exists, newly detected screens are not added to the list of known screens (see screenConnected()). This, in turn, will result in a crash if a screen is disconnected and removed in screenDisconnected() as it is not known to qtPlatformScreenFor() and the function returns a nullptr. Consider the QIOSIntegration also whenever a screen is "changed". This is more of a safety measure do avoid crashes for unknown screens. This situation occurs if an iOS device is used to mirror the display via AirPlay and no actual QGuiApplication exists, e.g. Qt is only embedded in a Framework. Fixes: QTBUG-106701 Change-Id: Id778fc5afa7c284b0536ee02b1ba2c10321cc5b1 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Lars Schmertmann <lars.schmertmann@governikus.de> (cherry picked from commit ffdfafc4b47b8267395370199073c292da33dd42) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QNetworkInformation[Win]: Improve WinRT exceptions handlingVladimir Belyavsky2023-04-181-3/+9
| | | | | | | | | | | - handle only winrt::hresult_error exceptions, as this is the only reported cases, so we don't need ellipsis there - print relevant warnings Change-Id: Ibf18a7eab7862e2c20f5729545387ddc7ca42952 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit f6908c4f714f629bfe74babc731b6bbe0448ef2d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QNetworkInformation[Win]: Catch potential WinRT exceptionsVladimir Belyavsky2023-04-141-10/+16
| | | | | | | | | | | Some Windows SDKs seem to throw an exception from winrt::check_hresult() We need to handle this accordingly. Catch the exception and print relevant warning. Fixes: QTBUG-110408 Change-Id: I1434ec425f0d0e597308b53f25f4f15049640060 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 5564b166a3ea00e44053edbf7b8b41f5c9bf8c39) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Revert "Gtk3Theme: set XCURSOR_SIZE and XCURSOR_THEME for wayland sessions"Ilya Fedin2023-04-141-14/+0
| | | | | | | | | | | | | This reverts commit c0b0c7bebb73e1aa609196ce33668a54bd5e0aef. QPlatformTheme::MouseCursorTheme and MouseCursorSize was added in qtbase a823366f7745c235a752dc01c42276b3fa410937 and qtwayland client supports it in 1c25db5e3f23d48e330170f41b94fbd532932b02. Change-Id: Icef2f50d495ac802e3a591d92c222523972b2066 Reviewed-by: Liang Qi <liang.qi@qt.io> (cherry picked from commit c3f00ce3e34d5cfa3ee4227a3a453448ab2f8b31) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Replace a duplicate symbolAmir Masoud Abdol2023-04-142-16/+3
| | | | | | | | | | | Removed the two identical functions and directly call the `static_cast` in their place. This is to resolve a build issue when doing unity build. Task-number: QTBUG-109394 Change-Id: I174b601e06c4acdea45cc66495c09aafba6f48f6 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit 9031142e63b954031134d12b8e9fb1f9c850acfa)
* Revert "macOS: add default Edit menu items, if not added by AppKit"Tor Arne Vestbø2023-04-132-56/+0
| | | | | | | | | | | | | | | | | | | | | | | This reverts commit d42cfeb84faf154b46f2811b2059946b396fcc12. Trying to help AppKit by adding the dictation and emoji edit menu items ourselves resulted in sometimes adding the entries twice, when we failed to detect the existing entries, or AppKit failed to detect our entries as a reason to not add its own. In addition, even if the entries we added were detected by AppKit and AppKit was smart enough to not add its own, our entries were relying on the developer to provide translation, instead of building on the translations that AppKit already provides. And the keyboard shortcut we set for our entries were not following system and user preferences for which keyboard combination should trigger the entries. Fixes: QTBUG-104709 Task-number: QTBUG-79565 Change-Id: I3fabc41f85df917dbb669253ad441bccea8a5e35 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit 9618427ee5a42e1d120fa475aa6e2408a738915a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add the missing include guardAmir Masoud Abdol2023-04-131-0/+4
| | | | | | | | | Task-number: QTBUG-109394 Change-Id: I6a46784fa65aecd48a7f59021c4942ed52321742 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit 4b00aaae9cbf30b4182281e9bb5299a009ff8f83) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* windows: Re-apply mask when DPI changes, to account for new scale factorVolker Hilsheimer2023-04-121-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When the DPI of a window changes due to being moved to another screen, or the current screen reconfiguring, the mask we've set earlier is no longer correct, as the mask was set based on the original screen's scale factor and in relation to the former platform geometry of the window, which now has changed. Like the geometry of a QWindow, the mask is expressed by the user in the QtGui coordinate system, so it's the platform's job to transform this into the platform coordinate system and update it when needed. Add a manual test that users a QWidget and a Q(Raster)Window side by side. There's still an issue with the screen change being triggered to early, via QWindow::setGeometry, instead of when the window has actually moved to the new screen, resulting in the paint event flushing to a window and backingstore that is in the wrong state, but this requires further research to fix. Task-number: QTBUG-97642 Done-with: Volker Hilsheimer <volker.hilsheimer@qt.io> Change-Id: I7ab2d267fbaf6ac32b507d05a418eb025b354a0b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit bbd6cbd71c7ff4df3d141383d090a4bdc2459a48) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS Accessibility: flag all synthetic elements as unignoredVolker Hilsheimer2023-04-121-3/+4
| | | | | | | | | | | | | | | | | This saves us a few more roundtrips. For rows and columns we could check if their accessibilityFrame instersects with the table and so ignore rows and columns that are outside of the view, but I'm observing weird corruptions in the list returned by NSAccessibilityUnignoredChildren when ignoring any objects. Task-number: QTBUG-34337 Change-Id: Ia2d13fff463ff26abb39acfceafcfa0761171203 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit 6b67c3e7384322ade9ea4b7c4c1be5d5b32779ec) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS Accessibility: Delay creation of table cell interfacesVolker Hilsheimer2023-04-121-18/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since macOS requires us to return an array with elements as the children of a table's row. And it might ask for the children of many rows. This is very costly, and results in a lot of QAccessibleInterface instances being created unnecessary. Instead, use unassociated QMacAccessibleElements as place holders for cells, and place them in the column array of the QMacAccessibleElement that represents the respective row. Those placeholder elements have the synthesizedRole set to AXCell, and have the same axid as the table, for as long as there is no corresponding QAccessibleTableCell created. Until that point, they are in practice "managedByParent" just as the row and column elements. Since the place holder object knows about its column, row, and table, it can respond to many inquiries directly without needing to create the interface. Once the QAccessibleInterface for the cell is required for an already existing place holder, then we need to promote the place holder to an independent element. We reset the synthesizedRole to nil, and change the axid to the ID of the cell interface. However, the cell interface might have been created and assocated with an element before the placeholders were created when navigating through the children of a row. So when we create an element for a table cell, then we need to make sure that the table elements' corresponding row is also populated, with the new element in the right place. Fixes: QTBUG-34337 Change-Id: Iff78e3b8335df8cf294fffb6579605bfeb8409ed Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 52c2b82082b535123c0eecafe1ec1e4e4190df2a) Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove outdated comment about macOS cusorUpdateTor Arne Vestbø2023-04-121-4/+0
| | | | | | | Change-Id: Ic270e9800b56e4fa1027245bebc4cd08a58abb3f Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit a0675562eaab4193f68fb391c5ea824ecb8f9f89) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* SQL/MySQL: properly initialize variableChristian Ehrlicher2023-04-111-3/+3
| | | | | | | | | | | Properly initialize outBinds - even it should be initialized by mysql/mariadb client lib we should correctly initialize it with 0 to avoid valgrind warnings about accessing uninitialized data. Change-Id: I85b99a7e639dad9f8d24f554cd96c5997a5838ae Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit ed031ed18ccc112e31d27a2306dbf086a2237711) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS Accessibility: add an elementWithInterface helperVolker Hilsheimer2023-04-112-12/+17
| | | | | | | | | | | | | | | | Instead of explicitly creating an ID from an interface and then asking for the element for the ID, ask for the element for the interface directly. In that helper we can also make sure that the created element is correctly configured if the interface for which it was created was for a table cell. Task-number: QTBUG-34337 Change-Id: Id0f9247b0b50195301b293dcabb8925c3fc2d2cf Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit 03b7e979072761d75d155a7351295f821dc48ae9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS Accessibility: optimize table interface implementationVolker Hilsheimer2023-04-112-44/+58
| | | | | | | | | | | | | | | Store row and column in the QMacAccessibilityElement when creating it so that we can avoid linearly looking for ourselves in the parent's data. Row elements have their m_rowIndex set, Column elements the m_columnIndex, and elements representing a cell have both set. Cells are not managed by the table. Task-number: QTBUG-34337 Change-Id: I319fad1f1fda0cfa4c0b95e9e16c25c87df04351 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit 042d753495cd91df1582ba6bf181e64995be40d6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS Accessibility: don't create an unnecessary interfaceVolker Hilsheimer2023-04-111-6/+3
| | | | | | | | | | | We only need to compare elements to determine whether this element has focus. Task-number: QTBUG-34337 Change-Id: Ic1388ac00381735acfbf1e5877a658f4bd534dfb Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit 69a8d1293ad69faaef120f1e46ab46fd8cd70318) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS Accessibility: code hygieneVolker Hilsheimer2023-04-112-130/+104
| | | | | | | | | | | | | | | Make getting a QAccessibleInterface from a QMacAccessibilityElement a member function that also tests for the validity of the interface, and replace the respective code duplication. Remove unused member functions accessibilityMin/MaxValue. Task-number: QTBUG-34337 Change-Id: Ie15cf0b71285e63cc485d87ced050dc541967c98 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 11ae55e918082e8fdfc0c88c21049e877cc47b5b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix build without egl_x11Ilya Fedin2023-04-112-0/+15
| | | | | | | | | Amends 49d29440457a89bb0438ed882eb47f4f28fd328a Change-Id: I5ff94135245cdb617aa5eea5a0e2782f810b36dc Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit 6f37399cd63e1bd9942bf7a5e5de3ae7d0964fee) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Implement setBadgeNumber for xcb backendCarl Schwan2023-04-112-0/+8
| | | | | | | | | | | | | This use the unity launcher specification which is defined here https://wiki.ubuntu.com/Unity/LauncherAPI This spec is used by Plasma and Unity. On other Linux desktop platform where the unity DBus interface is not detected this is no-op. Change-Id: I81a9b95fe4886ad597bb4e775641926b161c49a5 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: David Edmundson <davidedmundson@kde.org> (cherry picked from commit ac973cb74fecdaedf31922dfd48ea522a7af8f51)
* Guard qopenglcontext_p.h with QT_NO_OPENGLAlexey Edelev2023-04-062-2/+8
| | | | | | | | | | | | | | Fixes the macos build with the disabled opengl feature. Include inttypes.h that used to be implicitly included by qopenglcontext_p.h. It's needed for 'PRId64' macro. Amends: ef27cc126c38ff14360bebeeb3100671df9e4cf4 Fixes: QTBUG-112656 Change-Id: I970329c4aacc70790f50e1ff3a57ab2aa6f6bff7 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 55f89c76d93a1c328fa6628212db7bcff3dfcdbb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* IBus: fix missing Q_SLOTSIlya Fedin2023-04-041-1/+1
| | | | | | | | | | | | The following warning is printed on systems using IBus: qt.dbus.integration: Could not connect "org.freedesktop.IBus" to globalEngineChanged(QString) It seems either the connection has never worked or moc has changed Change-Id: Ib96229c85c975603d28c76163fa144ddfe827b18 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 9d031caf09b2c14328268ef0e871efd30e80eab2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix crash in QIOSTextResponderChristian Strømme2023-04-041-2/+6
| | | | | | | | | | | | | | When a window that has focus is destroyed we can end up calling into nextResponder where the focus window is in the process of being destroyed, so make sure we have a window with a valid platform window before calling winId() Fixes: QTBUG-110019 Change-Id: I704c3597b46e465ddf2605bdb71a21cb36cb2a26 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit f1dc42e19e7757fb5d2845fa0cc3f782e7521aa7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Use NO_PCH_SOURCES to exclude filesAmir Masoud Abdol2023-04-042-7/+4
| | | | | | | | | | | | | | We should be able to just use NO_PCH_SOURCES under MINGW condition and get the same result. P.S. The problem with `qwindowspointerhandler.cpp`, most likely caused due to symbol collision with `qwindowsmousehandler.cpp`. We've encountered it again when we were building with unity. Change-Id: I20a5091d5d1a329228b5ddb4694f5fd61d803554 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit ed4d2917ae5a391ab1a4b6a98d75eae90fa37f32) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Clean up NO_UNITY_BUILD instructionAmir Masoud Abdol2023-04-042-5/+2
| | | | | | | | | | | We can now use NO_UNITY_BUILD_SOURCES instead, and we only need to exclude one of the file to avoid the exclusion. Task-number: QTBUG-109394 Change-Id: I33642eece77e362f8a1de7400c14a30da7889239 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit c19504e708bf099922180ab99f3cf4b94d91fc7e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Make flatpak check more backward compatibleIlya Fedin2023-04-031-2/+2
| | | | | | | | | | | Since 68de00e0d4f2c574162a6e033d41786e3757d25d, the check doesn't work with flatpak versions lesser than 1.13.1. Checking the file in the root directory works since flatpak 0.6.10. Change-Id: Icc83ea5de4a962b52a737c9842248df3b60b1331 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 5c4a94ba85f0bed9633c385455685ba364a72540) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Bump version to 6.5.1Jani Heikkinen2023-04-031-1/+1
| | | | | Change-Id: I8c634d5f4a5a4641be27f0caa37ab1e6391d1b89 Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* QIOSFileEngineAssetsLibrary: bail out early on non-existing dirsTimur Pocheptsov2023-04-021-0/+12
| | | | | | | | | | | | | | | | | | | | | QFileSelector::selectionHelper walks through the list of selectors (on iOS, on my phone it's ("ios", "iOS", "en_NO", "unix", "darwin")), creating paths and testing QDir::exists. This ends up in asset file engine trying to load asset for something like: "assets-library://assets/+iOS" etc. ALAssetsLibrary -assetForUrl: returns nil for such url and we start iterating through the assets library. On my phone (e.g.) this takes about ~6 seconds (to iterate through pictures/videos I have), so the image picker is dismissed ~30 seconds after an image was actually selected in a picker view, making an impression it's completely broken. Bail out early on such url, we know we'll fail (with AssetsLibrary giving a warning about invalid asset with UUID(null). Fixes: QTBUG-109120 Change-Id: Ia302f4151e3aade830e647a8a260479df2b29d4b Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 9ddd71a6c2b6cef641f2a8cdc256fb2fbe01fa5b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Pick up initial state of foreign windows instead of reflecting QWindowTor Arne Vestbø2023-04-011-12/+18
| | | | | | | | | | | | | | | A foreign window can be used both for embedding a Qt window into a native window hierarchy, or for embedding a native window into a Qt window hierarchy. In the former case, we should not modify the foreign window in any way. Since the platform does not know anything about the intended use case at the time of the foreign window creation, it should avoid modifying the foreign window in any way, and should instead pick up the foreign window state and reflect that through QWindow. Change-Id: Id2e39d101277ecebd656d615cea3e7f734a4b0a6 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit f3e27d3688014d15d7f1fd35c86cf1d9fe465ab4) Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* macOS: Send Qt::NonClientAreaMouseMove for NSEventTypeMouseMoved in title barTor Arne Vestbø2023-03-311-3/+2
| | | | | | | | | | | We were missing the NSEventTypeMouseMoved in resolving the event type for handleFrameStrutMouseEvent, resulting in passing on QEvent::None as the event type to QWSI. Change-Id: I144b6459c5d4fda2839d25cd52ddb441dc7c3a47 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit b8f40af17680917a9542acaf967a6c486f8ba71c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix the handling of dead keys and test the mechanismMikolaj Boc2023-03-282-81/+166
| | | | | | | | | | | | | | | | An effort has been made to support more keyboard layouts that provide dead keys (US international, Mac-specific dead keys). The dead key is translated now at the event conversion phase, not when it is actually used for modifying keys, which simplifies the logic. Unittests have been created to check the translation mechanism. Fixes: QTBUG-86272 Change-Id: I07f7d63f5a37f8469c693b034b400da99379f519 Reviewed-by: Lorn Potter <lorn.potter@gmail.com> (cherry picked from commit 3dc6fdc6d8ae661a6800c14a2461f456ec344e17) Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
* Transfer touch event handling to QWasmWindowMikolaj Boc2023-03-2814-172/+127
| | | | | | | | | Fixes: QTBUG-103498 Change-Id: Iec8b5cfba75131e7ddf855e6b729291950888fd3 Reviewed-by: Lorn Potter <lorn.potter@gmail.com> Reviewed-by: Aleksandr Reviakin <aleksandr.reviakin@qt.io> (cherry picked from commit da5dc2062576b75b6427fcc2bc74dc4fcfd9dcf5) Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
* iOS: request authorization before presenting image-pickerTimur Pocheptsov2023-03-283-3/+43
| | | | | | | | | | | | | | | | | | | | | | | | Right now, image picker view is shown first (it does not require access to photos, since it's essentially Photos app getting access to photos ...). Then, we use AssetsLibrary to get asset for an url (using ALAssetsLibrarie's -assetForURL method). This may trigger a permission-related alert, asking to: a. Select more photos or ... b. Allow access to all photos or ... c. Deny access. Showing this alert _after_ picker has selected an image makes little sense (and probably was never intended this way anyway). Instead, we now use Photos.framework to check the authorization and, if needed, we request an authorization (when the current status is 'Nondetermined'). If authorization is 'Granted' as a result, we show picker view and proceed as normal/before. Task-number: QTBUG-109120 Change-Id: I0acfd7b0476346360d75a5e37f5845aaf2d6e3e0 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 21a6c86979064b70b11b14b97c8f828d08e29781) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Don't try to create or manage NSWindow of foreign windowsTor Arne Vestbø2023-03-281-0/+8
| | | | | | | | | | | | A foreign window is a single NSView, and unlike our QNSView, where we in addition manage a NSWindow for top level windows we should treat the foreign window as just an NSView. It's not our place to neither create nor dispose of any NSWindows attached to the foreign window. Change-Id: I88aa796c679be0489abf4999829d1378ba054bdc Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit b64b0c7947f9f2b0ab4ed33fe526880f54e3981f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>