summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/wasm/qwasmcursor.h
Commit message (Collapse)AuthorAgeFilesLines
* Set the cursor in QWasmWindowMikolaj Boc2023-01-241-7/+0
| | | | | | | Also, trim QWasmCursor as some of it was dead code. Change-Id: If6fee3390e4c2a2c66ceaef5917d7387f8dbd46c Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Move the window through the title bar element itselfMikolaj Boc2022-12-211-0/+1
| | | | | | | | | | | | | | | | | The compositor is redundant in the process of moving the window. Have the title bar react to move all by itself. Additionally, a clearer structure in the window was introduced. The non-client area has been extracted into a separate class, as was the icon store and free DOM functions used across files. Since it was now easy, made the window maximize/restore on double click on the title element. Fixes: QTBUG-107626 Pick-to: 6.5 Change-Id: Iba7f207e46806ae7162656965892ae5a48ac5ebe Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Refactor code focused around QWasmCompositor::processMouseMikolaj Boc2022-07-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactoring of the logic around QWasmCompositor::processMouse has been performed for readability and easier modification, in preparation for further fixes for event delivery and handling in windows. There should be no logic changes, just cleaner code. Change groups: Members of QWasmCompositor have been prefixed by m_ for easier discerning of stateful and stateless variables in functions. Variables renamed to more descriptive, e.g. window2->targetWindow, globalPoint->targetPointInScreenCoords. Magic numbers eliminated, e.g. mouseEvent->button == 0 is now button == Qt::MouseButton::LeftButton. Some common condition checks have been wrapped into single constants, e.g. !(htmlWindow->m_windowState & Qt::WindowFullScreen) && !(htmlWindow->m_windowState & Qt::WindowMaximized) == isTargetWindowResizable Some nested if-conditions were collapsed. Some unnecessary checks have been moved to outer if conditions (e.g. for draggedWindow in EMSCRIPTEN_EVENT_MOUSEMOVE, since the code would crash anyway because only some parts are guarded against it being nullptr). Consts introduced so that variables are only used for one purpose. Made QWasmEventTranslator::translateMouseButton constexpr Made QWasmWindow::isPointOnTitle behave correctly when the window has no title bar so that no flag probing is needed prior to calling it. Made QWasmCursor::setOverrideWasmCursor accept a const ref - having it accept pointer suggested it might dangle. Change-Id: I8910622fddad764ee86eb0260b5ad23c7ee7f97a Reviewed-by: David Skoland <david.skoland@qt.io>
* wasm: Fix up namespacing in wasm platform pluginLorn Potter2022-06-181-0/+3
| | | | | | Pick-to: 6.4 Change-Id: I2fdbb6688b252743578dfcd58f9259eb5ac3cca8 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-161-28/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* wasm: initialize htmlCursorName to "default"Morten Sørvig2022-04-251-1/+1
| | | | | | | | | | | | | | | The canvas cursor should always be restored to "default" if no cursor is set, otherwise we get the I-beam cursor since the canvas is contenteditable. The code which handles setting and restoring the override cursors handles this correctly, however we also need to set the default htmlCursorName for cases where setOverrideWasmCursor() is not called. Pick-to: 6.3 Change-Id: I23be7847d3a30ab78e3a8c9ec402285246bfefec Reviewed-by: David Skoland <david.skoland@qt.io> Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* wasm: ensure cursor reverts after window resizeLorn Potter2022-01-121-0/+5
| | | | | | | | | | | | | | This partially reverts 97be0cca174a3b92c24062c557bf4df34db23f7b but without the crash We temporarily override the wasm cursor while leaving the application/window cursor alone to mimic what desktop application behavior is like. Pick-to: 6.3 Fixes: QTBUG-99111 Change-Id: I23df48b2eaa82830593f1753ec23d14fe375b70c Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* WebAssembly for QtBaseMorten Johan Sørvig2018-08-301-0/+43
This is the squashed diff from wip/webassembly to dev. Done-with: Peng Wu <peng.wu@intopalo.com> Done-with: Sami Enne <sami.enne@intopalo.com> Done-with: Morten Johan Sørvig <morten.sorvig@qt.io> Started-by: Andrew Knight <andrew.knight@intopalo.com> Change-Id: I6562433c0a38d6ec49ab675e0f104f2665f3392d Reviewed-by: Lorn Potter <lorn.potter@gmail.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>