summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/wasm
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove the unix dispatcher from WASM buildsMikolaj Boc2023-08-221-3/+0
| | | | | | | Unix dispatcher is not used and - as such - redundant on WASM. Change-Id: Ia8789ef783b06ce9cfba2ce9d67159db2355b594 Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
* wasm: Apply window mask during QWasmWindow initializationTor Arne Vestbø2023-08-151-0/+3
| | | | | | | | | | | | We need to apply properties of the QWindow the underlying "native window", in this case our <div>, on construction, without waiting for the user to call one of the QWindow setters. Pick-to: 6.6 Change-Id: Id422a9424f584e2269ef333e2c7c88a123ecb70b Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io> Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* wasm: Don't add window border, title bar, etc, to child windowsTor Arne Vestbø2023-08-151-1/+1
| | | | | | | | | | Only top level windows should have window manager features, to match other platforms. Pick-to: 6.6 Change-Id: I7a0563ef34aeb430d0b1a16633a5626482ccd17d Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* wasm: Don't clamp y position of child QWindows to parent rectTor Arne Vestbø2023-08-151-1/+4
| | | | | | | | | | | | | | | | A child window should be possible to place at arbitrary positions within its parent, even outside the parent's current rect. Once the parent size is changed, the child might become visible. The current code also caused issues when the parent did not have a size yet (0x0) at the time of the child's setGeometry call, resulting in the child always being placed at y=0. Pick-to: 6.6 Change-Id: I1534b606ab6eb7d51216d3b305a1b60443c41ec2 Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
* Add description to the HTML tags using aria-descriptionShreya Pattani2023-08-112-6/+45
| | | | | | | | Description added to the html tags for accessibility in wasm through the aria-description property Change-Id: Ic1976d5c4c64ea45298f24b660807adeda6fdb64 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Fix link to platform window in QAndroidPlatformBackingStore::flush()Axel Spoerl2023-08-042-9/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Android QPA implementation requires a 1:1 link between a platform window and a platform backing store, to correctly flush a backing store to the screen. QAndroidPlatformBackingStore has a bool member m_backingStoreSet, to remember if this link exists. It defaults to false and is set to true, when setBackingStore() is called in the constructor. It falsely remains true, when a platform window is deleted, e.g. because a QWindow has been hidden. When the QWindow is shown again, a new Android platform window is created. With m_backingStoreSet still being true, this new platform window will never be associated with a backing store. As a consequence, it will never be displayed on the screen. The 1:1 relationship of an Android platform window and an Android backing store is neither ideal, nor in line with other QPA layers (e.g. XCB). Changing the Android QPA implementation is complex and a short term fix is necessary. This patch removes the member m_backingStoreSet. Instead of it, QAndroidPlatformBackingStore::flush() directly checks, if the platform window corresponding to the QWindow argument is associated to a backing store. If that is not the case, setBackingStore() is called. QTBUG-97482 has been fixed with another approach, which this patch reverts. The following commits are effectively reverted by this patch: 9a39ad8dfb4e6d1a179bd0fa38026886f8f7cb8e f91588923b1e7b68f1bd79b38af44d024df85996 a4ca9e80658bca7dad1529f03c1b59173a6ecf62 dbb072eb2838a04e89e34dad686394a496d5de87 959a8b3967ac3b6315f5b458628ec5661dfc367e Fixes: QTBUG-97482 Pick-to: 6.6 6.5 6.2 Change-Id: Ic4344f8df2e954c057dd2705340f11dfd2d4c6fe Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Implement text update in wasm apps during accessibilityShreya Pattani2023-08-021-2/+5
| | | | | | | | | Implementation for QAccessibleEditableTextInterface is pending for texts in qml accessibility, adding accessibile role check for text to be updated when accessibility feature is on in wasm Change-Id: Ic24ebf6942e50a5952126e312afa633ed4fbe9ce Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
* wasm: Render Qt::SubWindow borderlessPiotr Wierciński2023-07-172-5/+16
| | | | | | | | | Windows with Qt::SubWindow flag should not have platform decoration. Fixes: QTBUG-115054 Pick-to: 6.5 6.6 Change-Id: I7111df6057a087080194c1d46e350df839bec437 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* Adapt setBackingStore() overrides in QWasmWindow and QEglFSWindowAxel Spoerl2023-07-162-1/+9
| | | | | | | | | | | This is a follow up to a4ca9e80658bca7dad1529f03c1b59173a6ecf62, adapting the backing store setters to become proper overrides of the newly implemented QPlatformWindow::setBackingStore(); Pick-to: 6.6 Change-Id: Id4f5ff8650ca4e4d3cab1d71d27041c6129bf4ea Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* wasm: clarify qtloader onExit behaviorMorten Sørvig2023-07-102-29/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | onExit is called whenever the application exits, i.e. when the app canvas should no longer be displayed and the loader/embedder code should take some action. Emscripten provides two callbacks which can be used here: - onExit, called when the app exits (but see EXIT_RUNTIME) - onAbort, called on abort errors. These map to the two cases Qt's onExit supports. onExit is not called when EXIT_RUNTIME is disabled, which means we don't need the special case for exit code 0. In addition call onExit on any exception. The second call to showUi() in html_shell.html is then not needed any more and we avoid duplicating the UI state handling in user code. Update the qtloader_integration test to handle changes in behavior (we no longer set the error text on exit). Use emscripten_force_exit() to simulate application exit - using this function makes Emscripten call onExit even when EXIT_RUNTIME is disabled. Pick-to: 6.6 Change-Id: I72b5463c1836e8d5054e594abbd304fbc67032b7 Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io> Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
* wasm: Add qtloader compatibility APIMorten Sørvig2023-07-101-0/+54
| | | | | | | | | | | Implement the main features of the pre Qt 6.6 loader as adaption layer on top of the new loader. Pick-to: 6.6 Task-id: QTBUG-115049 Change-Id: Iabe860d3fb0488fd003876508787da3688e0c87b Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io> Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* wasm: add preload config for shared libraries buildMorten Sørvig2023-07-041-0/+1
| | | | | | | | | | | Preload Qt plugins and QML imports by default. The json files contain file listings generated by scripts in qtbase/util/wasm/preload. Pick-to: 6.6 Task-number: QTBUG-63925 Change-Id: I123b7a46fa19fa75ef214e8edb92e15ef635e5ba Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* wasm: add "preload" qtloader config propertyMorten Sørvig2023-07-041-0/+68
| | | | | | | | | | | | | | | | | | | | | | | Add support for downloading files from the web server to the in-memory file system at application load time. See included documentation for usage. This preload functionality is different from Emscripten's --preload-file and --embed-file in that the files are not packed to a single data file or embedded in the JavaScript runtime. Instead, the files are downloaded individually from the web server, which means that they can be cached individually, and also updated individually without rebuilding the application. Any file type can be preloaded. The primary use case (at the moment) is preloading Qt plugins and QML imports. Pick-to: 6.6 Task-number: QTBUG-63925 Change-Id: I2b71b0d6a2c12ecd3ec58e319c679cd3f6b16631 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* wasm: add "qtdir" qtloader config propertyMorten Sørvig2023-07-041-0/+16
| | | | | | | | | | | | | | | | | | | | | | | This points to the location where qtloader should find the Qt installation when loading Qt shared libraries and plugins. The path is relative to the path of the html file which contains the application, and is set to "qt" by default. Deployment of the Qt installation to the web server is left to the app developer, since this depends on the exact use case. One possible way to deploy is to create a "qt" symlink to the Qt installation, for instance: html/myapp/myapp.html html/myapp/myapp.wasm html/myapp/qt -> /path/to/qt Pick-to: 6.6 Task-number: QTBUG-63925 Change-Id: I76b129dffc75c06ff6bc67d8c20ce12557b32f31 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* wasm: introduce virtual processPostedEvents()Morten Sørvig2023-07-042-4/+5
| | | | | | | | | | | | | | | Don't re-use processEvents() for the case where we get a callback from the native event loop and want to send events. This makes it clearer that these are two different cases. Align with the Core Foundation event dispatcher where processPostedEvents() is virtual and is overridden by the Gui event dispatcher to send window system events. Pick-to: 6.6 Change-Id: I3ea9c55c1d9c03195c1937c4dcc0e5b689e15448 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Remove leftover code in QWasmWindowClientAreaMikolaj Boc2023-07-031-15/+0
| | | | | | | | | Switch cases for EventType::PointerEnter and EventType::PointerLeave are never reached. Change-Id: I02f31c2d7064db740f21b014c9e0f4735a7a1a91 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
* wasm: fix touch -> mouse event synth on SafariMorten Sørvig2023-06-281-1/+4
| | | | | | | | | | | | | | Mobile Safari generates touch pointer events with negative pointer id's, which causes processTochEvent() to skip the event instead of synthesizing a mouse event. Ensure that the id's are always positive by taking the absolute value of the event. Pick-to: 6.6 6.5 Change-Id: I1514329dc76ecc4b9103f7deca9642aaf304df8b Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io> Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* Use a sanitized JS export name for WASM modulesMikolaj Boc2023-06-261-1/+1
| | | | | | | | | | | Previously, a target name with a JS special character (like, -, for example), would lead to an invalid export name being generated for WASM modules. Sanitize these by replacing any non-alphanumeric character with underscores, as is done for feature names. Change-Id: I01fbc50bddedd011a9584f673d79d88a3bc09bbb Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* WASM: don't ignore custom QSurfaceFormat settingsYuhang Zhao2023-06-222-0/+7
| | | | | | | | | | | | | | Previously, Qt would always ignore user's custom QSurfaceFormat settings and this behavior makes user have no way to control the preferred OpenGL version when running on WASM. And after reading the wasm platform plugin code, I don't see any reason why we should limit ourself to the default OpenGL version. And I've tested this patch locally, Qt still work normally if I set a newer OpenGL version. Pick-to: 6.6 6.5 Change-Id: I0cfb831d6a722fe61cc85808a6d9e3098c73d82e Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Make WASM export names different across modulesMikolaj Boc2023-06-202-2/+2
| | | | | | | | The export name is now ${TARGET_NAME}Entry. This can also be overridden by using QT_WASM_EXPORT_NAME, both in CMake and qmake Change-Id: I59c97ae6e22f0b2720716e9d7eff7b6b13d37ab5 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* wasm: Document (and rename) config.qt.moduleMorten Sørvig2023-06-201-2/+5
| | | | | | | | | | This property can take a either a WebAssembly.Module or a promise to a module, and we don't have to specify the exact type in the property name. Pick-to: 6.6 Change-Id: Iebaf52178253afe8c93cf78bbe0853461bf48b67 Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
* Add keyboard input testcase to the QWasmWindow testMikolaj Boc2023-06-201-0/+1
| | | | | | | | | | | | | The test checks whether correct windows get correct keyboard input, having been activated with mouse clicks. Also fixes the event propagation error found. Key events would propagate to parent windows, which is something that should not happen with window managers. Change-Id: I18bae8c14cce5ccae151c2a00c84ffdba3b4587f Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io> Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
* Support child windows on WASMMikolaj Boc2023-06-1511-153/+356
| | | | | | | | | | | | | | Setting parents for WASM platform windows is now supported. This means that windows now reside in a hierarchical window tree, with the screen and individual windows being nodes (QWasmWindowTreeNode), each maintaining their own child window stack. The divs backing windows are properly reparented in response to Qt window parent changes, so that the html structure reflects what is happening in Qt. Change-Id: I55c91d90caf58714342dcd747043967ebfdf96bb Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* wasm: add iOS to platform detectionLorn Potter2023-06-133-5/+6
| | | | | | | | | Add iPad and move iPhone platform to iOS Pick-to: 6.6 6.5 Fixes: QTBUG-114446 Change-Id: I3f601fbe5f3899c0658ee65acf72bbf37d51bf73 Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
* wasm: expose windows before delivering updatesMorten Sørvig2023-06-121-4/+9
| | | | | | | | | | | | | | | | | | | | | | | Don't show a blank frame on app startup. The wasm update request system supports two types of update requests: Expose and UpdateRequest. It can happen that both types of request are made for a single window, in which case the current code prefers UpdateRequest, since those must be delivered in order to keep QWindow in a consistent state. However, if the window is visible but not yet exposed then delivering the update request will not make the window paint anything, and we end up with a blank frame. Ideally this should be handled elsewhere and QWindow::requestUpdate() should not be called for non-exposed windows, but in the case does happen then sending an expose here allows us to recover. Pick-to: 6.5 6.6 Change-Id: Ib53050c33ad1769ea9b9ad678896af15f87a7ecb Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Correctly focus WASM windows on showMikolaj Boc2023-06-091-0/+2
| | | | | | | | | | | Since first requestActivate may happen before the window div is actually displayed on-screen, we need to sync Qt's activation state with DOM as soon as DOM element becomes visible. Focusing an invisible element is impossible. Fixes: QTBUG-79934 Change-Id: I04cf9b4ead006c9b8b135b3b6967d7938c581833 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* wasm: log stack traces for exceptionsMorten Sørvig2023-06-081-0/+1
| | | | | | | | | This is very useful for debugging. Pick-to: 6.6 Change-Id: I4861afb9bd2b4e757a962d81583a8b12958f9f1c Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Correctly document qtLoad's return valueMikolaj Boc2023-06-081-7/+2
| | | | | | | Documentation got outdated during review of the new qt loader. Change-Id: I8e23016b9a42e5f003e88c58a8e546255b167983 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* Modernize the qtloaderMikolaj Boc2023-06-054-628/+250
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is a minimal version of qtloader. The load function accepts the same arguments as emscripten runtime with a few additions: - qt.environment - qt.onExit - qt.containerElements - qt.fontDpi - qt.onLoaded - qt.entryFunction State handling has been removed in favor of making the load async (assume loading when the promise is live). Public APIs getting crashed status, exit text and code have been refactored into the new qt.onExit event fed to load. No need for keeping the state in the loader. The loader is integration-tested. A test module with test APIs has been created as a test harness. The runtime APIs exposed by Qt (font dpi and screen API) are handled by the qtloader seamlessly. Change-Id: Iaee65702667da0349a475feae6b83244d966d98d Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* wasm: fix qtloader.js container element regressionMorten Sørvig2023-05-121-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 Pick-to: 6.5 6.5.1 Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
* wasm: Add DOM accessors functions through NativeInterfacePiotr Wierciński2023-05-051-1/+6
| | | | | | | | | | | Expose document and clientArea emscripten objects through NativeInterface. This is required by WebView implementation for wasm platform. Task-number: QTBUG-75183 Change-Id: I6f2f084a9dbceb80d2186c7395c008f268a91e39 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
* wasm: build with -no-feature-accessibilityMorten Sørvig2023-05-024-5/+22
| | | | | | | | | Add #ifdefs around the accessibility implementation. Fixes: QTBUG-111509 Pick-to: 6.5 Change-Id: I9a600781b4bf9545f046efa75f962cc40fe196a6 Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
* 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. Pick-to: 6.5 Change-Id: Ib6826deeec06ee3def0e793dd1462977710462be Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io> Reviewed-by: Aleksandr Reviakin <aleksandr.reviakin@qt.io>
* Add the missing include guardAmir Masoud Abdol2023-04-131-0/+4
| | | | | | | | Pick-to: 6.5 Task-number: QTBUG-109394 Change-Id: I6a46784fa65aecd48a7f59021c4942ed52321742 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Replace a duplicate symbolAmir Masoud Abdol2023-04-132-13/+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. Pick-to: 6.5 Task-number: QTBUG-109394 Change-Id: I174b601e06c4acdea45cc66495c09aafba6f48f6 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Fix a copy-paste error in QWasmWindowMikolaj Boc2023-04-021-1/+1
| | | | | | | | | minimumSize.width() was used instead of minimumSize.height() for the lower bound of height Change-Id: I330ea79de8ba39a6c55f5ed9b3210f1ff7d10fb6 Reviewed-by: Aleksandr Reviakin <aleksandr.reviakin@qt.io> Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* Correctly update the texture in qwasmbackingstoreMikolaj Boc2023-03-311-5/+7
| | | | | | | | | | Both the full-width and partial-width paths in QWasmBackingStore::updateTexture now correctly compute source and target rects. Task-number: QTBUG-112414 Change-Id: I30b0952609960f521119d3d628d2a8036f8b1fe5 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Remove unused code in qwasmcompositorMikolaj Boc2023-03-313-58/+3
| | | | | | | | Some dead code was left after transferring event support to QWasmWindow. Remove it now. Change-Id: I40e15bc62bcbb6fff071f53c45223c8a2d12e348 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* Stop propagation and default action on WASM window pointer eventMikolaj Boc2023-03-281-2/+3
| | | | | | | | | | | | | | | | The windows should not let events through to targets below (unless they are Qt::WindowTransparentForInput, which is handled independently). Therefore, stopPropagation and preventDefault are now called regardless of whether the window has handled the event or not. If the event is not handled explicitly, we still consume the DOM event so that the windows/elements below don't get focus by mistake. Fixes: QTBUG-111706 Change-Id: Idc78ac5076e97992d9f6f13a1fa574d0df4178ac Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io> Reviewed-by: Aleksandr Reviakin <aleksandr.reviakin@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Remove the redundant QWasmCompositor::requestUpdateAllWindowsMikolaj Boc2023-03-283-35/+13
| | | | | | | | | | | | | | | | Now that the browser compositor is used for rendering windows, the method has become redundant, as windows that got resized during screen resize will schedule their updates directly with the compositor. This also fixes an assertion in QPlatformWindow::hasPendingUpdateRequest as no windows without pending update requests will now have update requests delivered. Also offers a significant speedup with multiple restored window setups. Fixes: QTBUG-112289 Change-Id: Ie5dff69c04d66c4aef8351adef0da8530daf7ab8 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* wasm: add support for input languages win32 mobileLorn Potter2023-03-231-16/+18
| | | | | | | | | | | on Windows virtual keyboard sends characters through the textInput handler, we can use the same mechanism as Android to create an offscreen input element and send the characters from there. Fixes: QTBUG-107139 Pick-to: 6.5 Change-Id: I84a143aedf93d22521fcfa368532eed8c0e7d002 Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
* Close popups on WASM window non-client area interactionsMikolaj Boc2023-03-231-0/+1
| | | | | | | | | This mimics the behavior displayed by the Cocoa window Fixes: QTBUG-111436 Change-Id: I800fd15e870e54cf2c22ba5bd7f0c8b3f7f85bbf Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io> Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* Wasm: Fix displaying frameless QWasmWindow with transparent contentPiotr Wierciński2023-03-203-8/+20
| | | | | | | | | | | | | | | | | | Currently we render shadow and default background-color even for frameless windows with transparent content. This behavior is not consistent comparing to other platforms. An example of such window is InputSelectionHandle from VirtualKeyboard module. This commit disables shadow-box and provides transparent background-color for QWasmWindow which are frameless. It also provides distinction between "frame" as logic property of window and "border" as visual decoration. Change-Id: I902692ea561a2e88e2e6ab7faad8e3eeb536a26b Reviewed-by: Aleksandr Reviakin <aleksandr.reviakin@qt.io> Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
* Wasm: Hide "Enable screen reader" button in QWasmWindowPiotr Wierciński2023-03-152-4/+16
| | | | | | | | | | | | | | | For each QWasmWindow, there is "Enable screeen reader" button added for accessibility. It's hidden visually by z-ordering behind main QWasmWindow div. Sometimes the content of QWasmWindow contains transparent elements and the underlying accessibility button gets visible. This commit introduces new CSS class which hides elements visually, but keeps it accessible for screen readers. Fixes: QTBUG-111896 Change-Id: I78ef5746da9e0d1584ee36dd0ca6ba476623a3de Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Wasm: Add support for setOpacity() in QWasmWindowPiotr Wierciński2023-03-142-0/+6
| | | | | | | Add support for QPlatformWindow::setOpacity() in QWasmWindow. Change-Id: Ib54cecf1f49e3d576a386f4109b8c6df1f16f312 Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
* wasm: restore windowCursor nullptr checkMorten Sørvig2023-03-141-4/+3
| | | | | | | | | | This check was accidentally removed in commit 783b63ce. If the cursor is null, set the default cursor. Pick-to: 6.5 6.5.0 Change-Id: I894d5e04cd7b49041bd0d3b59fc816a8b7efffe7 Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
* Reuse the existing canvas context for offscreen surfacesMikolaj Boc2023-03-122-29/+60
| | | | | | | | | | | | | Due to the nature of WebGL contexts, which cannot be reassigned to targets other than they were created for, we will now reuse the created canvas context for offscreen surfaces, since those (hopefully) mostly operate on textures anyway. If this is not done, any switch to an offscreen surface for the main RHI context invalidates resources on contexts in a share group with it. Fixes: QTBUG-111617 Change-Id: I9752f7eec396a3ef11414881f5f79f26e1e2c859 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Wasm: Hide resizing divs when the window is not resizablePiotr Wierciński2023-03-074-18/+55
| | | | | | | | | Hide divs that are responsible for resizing the window and changing the appearance of the cursor on this window if this window is not resizable. Fixes: QTBUG-111618 Change-Id: I1948eaedf02fdd2a5289ae314521b3fd74ad7811 Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
* wasm: fix respecting minimum size of QWasmWindowPiotr Wierciński2023-03-052-6/+11
| | | | | | | | | | | Minimum size of QWasmWindow was not properly enforced. Make sure that minimumu size constraints are respected when the QWasmWindow is created, resized manually or changed by setGeometry(). Fixes: QTBUG-111162 Change-Id: I2984b0836b5b53f9163275153d734cb1d81ef3b6 Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
* wasm: Fix checking window flags in QWasmWindowPiotr Wierciński2023-02-231-2/+2
| | | | | | | | | Querying bit flags by direct comparison yields incorrect results. As an effect the minimum size for QWasmWindow is not always properly set. Use testFlags() function instead. Change-Id: Ie4cf528ed3c6f664abd17615a6898e8fc49d84b5 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>