summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/wasm
Commit message (Collapse)AuthorAgeFilesLines
...
| * | wasm: use requestActive instead of activateLorn Potter2019-05-021-5/+2
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-74868 Change-Id: Ibbbac1ece66c8978440a282bf6949a82fb64d216 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | | Remove extraneous sodipodi/inkskape cruft from Qt SVGEdward Welbourne2019-04-301-28/+1
|/ / | | | | | | | | Change-Id: Ib2d77331b33cac97e819e8273362703fcd80886c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | wasm: don't propagate touchLorn Potter2019-04-241-1/+1
| | | | | | | | | | | | Task-number: QTBUG-75263 Change-Id: I099f76114f876b3d6d81df3efb94db126db6a806 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | wasm: improve event coordinate handlingMorten Johan Sørvig2019-04-043-29/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | targetX and targetY are canvas-local coordinates, while Qt generally works with window-local and global coordinates. Add coordinate mapping calls where needed and make sure we pass correct coordinate types to Qt. This starts mattering when we have canvases which are not located at (0, 0). Change-Id: I28563310ca17d0cc5535317cff99fcd82d3723db Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* | wasm: hide canvas text caretMorten Johan Sørvig2019-04-042-1/+2
| | | | | | | | | | | | | | | | Another side effect of setting contenteditable on the canvas. Seen on Firefox. Change-Id: I789ba4d7e6fbbdbf14b66fe1ae57183ec04e04bb Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* | wasm: implement QDesktopServices::openUrl()Morten Johan Sørvig2019-04-025-4/+107
| | | | | | | | | | | | | | Call window.open(url, ”_blank”) for a new tab. Change-Id: I227904f905262c7aedd086203ed816b53f66359c Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* | wasm: make windows fullscreen by defaultMorten Johan Sørvig2019-04-012-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | (fullscreen as in use the entire canvas area, without showing window decorations) This is a better default for Qt on the web where window decorations are not common. We also avoid the “window close” trap, where there is no way to re-open a closed main window. Change-Id: Ie0fbf6ada3f49244bee765ea882acb473809e715 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* | wasm: add resizeCanvasElement() API to qtloader.jsMorten Johan Sørvig2019-04-013-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | HTMl does not have per-element resize events, which means Qt has not way of knowing that a canvas has been resized and that the canvas buffer size should be updated. Depending on the use case, the hosting JavaScript code that caused the canvas resize could also inform Qt that the canvas has been resized. Add API to do this, which calls the existing canvas/screen resize implementation. Other solutions taken/not taken: - browser window resize events: these are available, and we install an event handler in qwasmeventtranslator.cpp. - DOM mutation events: would detect changes to the the size attributes themselves, but not if the size indirectly changed, e.g. “width: 100%” depends on the parent width. Not implemented. Change-Id: Ib324bb30f523e9fceea68000b95bf857a1d36b6c Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | wasm: support adding and removing canvases at runtimeMorten Johan Sørvig2019-04-013-12/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | Add qtloader API: addCanvasElement() removeCanvasElement() These functions call the corresponding add/remove screen functions on QWasmIntegration. Task-number: QTBUG-64079 Change-Id: I537c11f3b5fb9240cca9b6313dd45f803d865ac6 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | wasm: Use common “qt” prefix for exported functionsMorten Johan Sørvig2019-03-263-26/+26
| | | | | | | | | | | | | | | | Prevent namespace collisions and make sure Qt functions are grouped together. Change-Id: I217188ee93e4300e273d10a79d6014179fc5a1ef Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* | wasm: update depreciated getElementByIdLorn Potter2019-03-251-3/+3
| | | | | | | | | | | | Change-Id: Ibef29f0fd2cb2012a05400a855cb4985f9164d92 Fixes: QTBUG-74601 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | wasm: disable threaded renderingMorten Johan Sørvig2019-03-251-1/+1
| | | | | | | | | | | | | | | | Enabling makes QtQuick to attempt to access window.devicePixelRatio [via QWasmWindow::devicePixelRatio()] from a web worker. Change-Id: I957df29060c7eb8c47d02bc67c8c5c2219b570f4 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-03-201-2/+5
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/gui/kernel/qplatformintegration.cpp src/gui/kernel/qplatformintegration.h src/plugins/platforms/wasm/qwasmintegration.cpp src/plugins/platforms/xcb/qxcbconnection_screens.cpp Change-Id: I15063d42e9a1e226d9d2d2d372f75141b84c5c1b
| * Move screen maintenance functions from QPlatformIntegration to QWSITor Arne Vestbø2019-03-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QWindowSystemInterface is the de facto API for any plumbing going from the platform plugin to QtGui. Having the functions as protected members of QPlatformIntegration was idiosyncratic, and resulted in awkward workarounds to be able to call the functions from outside of the QPlatformIntegration subclass. The functions in QPlatformIntegration have been left in, but deprecated so that platform plugins outside of qtbase have a chance to move over to the new QWSI API before they are removed. Change-Id: I327fec460db6b0faaf0ae2a151c20aa30dbe7182 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* | wasm: fix touchpoint handlingLorn Potter2019-03-152-23/+49
| | | | | | | | | | | | | | | | | | | | | | | | emscripten sends a touchstart event for every touch point when a new touch point happens, so this makes them moved or stationary if already known. This allows QtQuick PinchArea to work. Task-number: QTBUG-72214 Change-Id: I8e7c0cd2d78b07cfeae21491846cc31092359050 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | wasm: support rendering to multiple canvasesMorten Johan Sørvig2019-03-0814-156/+224
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Qt (via the the qtloader.js API) now supports rendering to multiple canvases. The application sees each canvas as a QScreen. Make qtloader.js support multiple canvases: var qtloader = QtLoader({ canvasElements : [array-of-canvas], showCanvas: function() { // make canvas(es) visible }, }); The canvases were previously created/returned by showCanvas(), however this function is called after the Qt app has been started and adding screens that that point is too late. (This worked before since there was only one screen, and no need to connect each screen instance to specific canvas.) Remove QWasmScreen, QWasmCompositor, and QWasmEventTranslator singletons from QWasmIntegration. These are are now crated per-screen and are owned by the QWasmScreen. Task-number: QTBUG-64079 Change-Id: I24689929fd5bfb7ff0ba076f66937728fa4bc4e4 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* | wasm: make wasm platform target a specific canvas instead of defaultLorn Potter2019-03-088-73/+98
| | | | | | | | | | | | | | | | This allows for multi canvas use Task-number: QTBUG-64079 Change-Id: I69c998aa4c2869bb5b7f14ba65bb63284365ad70 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | wasm: improve clipboard fallback pathMorten Johan Sørvig2019-03-044-17/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This improves handling of cut/copy/paste clipboard events, ands allows clipboard access via the common keyboard shortcuts. Make the canvas be eligible for clipboard events by setting the contenteditable attribute. Install clipboard event handlers directly on the canvas. Suppress Ctrl+X/C/V key event handling in the keyboard event handler in order to make the browser generate clipboard events. Send synthetic key events from the clipboard event handlers to make the app copy/paste to Qt’s clipboard at the correct time. Access the system clipboard data using event.clipboardData. Task-number: QTBUG-64638 Change-Id: I584b78ffa2b755b1b76e477b970255c6e5522f6a Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* | wasm: fix clipboard useLorn Potter2019-02-271-7/+21
| | | | | | | | | | | | | | Change 5242126a inadvertantly removed clipboard functionality Change-Id: Ie15e08470dd51d1c166063bbd443fd04416b2786 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | wasm: activateWindow when neededLorn Potter2019-02-271-1/+4
| | | | | | | | | | | | Task-number: QTBUG-74066 Change-Id: I6babab888de118c8c881fd8a18a90049563d7a23 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | wasm: make setting the cursor shape work againMorten Johan Sørvig2019-02-211-1/+2
| | | | | | | | | | | | | | | | | | Commit 960af0d64 ported away from EM_ASM but also changed the logic. Set the canvas.style.cursor property, like it originally did. Change-Id: Ie4b23abeae54173894bff1db000a305c459684bb Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* | wasm: fix crash on window closeLorn Potter2019-02-201-1/+3
| | | | | | | | | | | | | | | | Change-Id: I07d6edfbfbf056240262b833ccb708dc15f830a3 Fixes: QTBUG-73678 Task-number: QTBUG-73678 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | wasm: improve key handlingLorn Potter2019-02-182-270/+452
| | | | | | | | | | | | | | | | | | Allow for extended non English keys Task-number: QTBUG-68189 Task-number: QTBUG-69392 Change-Id: I12187ebc1250a5c29022cd2d3ad3a77eb45c06a8 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | wasm: add clipboard supportLorn Potter2019-02-156-11/+307
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This feature uses the js Clipboard API and is supported only in Chrome, as Firefox only supports reading the clipboard in browser extensions. It also requires https or localhost access, otherwise access to the clipboard is blocked by chrome. Chrome users will be able to copy/paste text to and from the system clipbaord. Other browsers will be able to use the clipboard from within the same application. Currently only supports text and html. Task-number: QTBUG-64638 Change-Id: Ie6de9d10812b776519bd6115593b433fe77059fe Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | wasm: remove EM_ASM calls in wasm platform pluginLorn Potter2019-02-134-35/+27
| | | | | | | | | | | | Change-Id: I8453836b6730d18eaaa4ffe1fb9cb3933079ebee Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Liang Qi2019-02-081-1/+0
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/android/templates/AndroidManifest.xml src/network/ssl/qsslsocket_mac.cpp src/widgets/styles/qstylesheetstyle.cpp tests/auto/corelib/kernel/qtimer/BLACKLIST tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp tests/auto/testlib/selftests/expected_blacklisted.lightxml tests/auto/testlib/selftests/expected_blacklisted.tap tests/auto/testlib/selftests/expected_blacklisted.teamcity tests/auto/testlib/selftests/expected_blacklisted.txt tests/auto/testlib/selftests/expected_blacklisted.xml tests/auto/testlib/selftests/expected_blacklisted.xunitxml tests/auto/testlib/selftests/expected_float.tap tests/auto/testlib/selftests/expected_float.teamcity tests/auto/testlib/selftests/expected_float.txt tests/auto/testlib/selftests/expected_float.xunitxml Done-With: Christian Ehrlicher <ch.ehrlicher@gmx.de> Done-With: Edward Welbourne <edward.welbourne@qt.io> Done-With: Timur Pocheptsov <timur.pocheptsov@qt.io> Change-Id: If93cc432a56ae3ac1b6533d0028e4dc497415a52
| * Wasm: remove debug output.Morten Johan Sørvig2019-01-291-1/+0
| | | | | | | | | | Change-Id: Ieb9c06203626854f9b7c561563c3261510230803 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* | Wasm: enable thread supportMorten Johan Sørvig2019-02-071-3/+5
|/ | | | | | | | | | | | | | | | | | | | | | | | | | configure.json: Make the “thread” feature be allowed for wasm but disabled by default. Change qmake.conf and wasm.prf to enable Emscripten pthreads mode: - Add USE_PTHREADS=1 linker flag - Add PTHREAD_POOL_SIZE linker flag with a default pool size (4). - Add TOTAL_MEMORY linker flag to set available memory (1GB) It is possible to override options such as PTHREAD_POOL_SIZE from the application .pro file using QMAKE_WASM_PTHREAD_POOL_SIZE To change TOTAL_MEMORY, use QMAKE_WASM_TOTAL_MEMORY Make qtloader.js work in pthreads mode: - The Module.instantiateWasm callback must provide the module in addition to the instance to Emscripten. - Set Module.mainScriptUrlOrBlob so that the pthreads web workers can access the main script Task-number: QTBUG-64625 Change-Id: I1ab5a559ec97c27c5fc24500ba5f863bcd275141 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* wasm: send mouse release to proper windowLorn Potter2018-12-162-11/+17
| | | | | | | | | | | | | | | | | When the mouse is released, it gets the current window to send the event to from the pointer position. If the release happens out of the browser viewport, that window is null and the release event essentially gets ignored. This change keeps the last known QWindow object to send the event to until the release. Also replace hardcoded emscripten events with enum names. Task-number: QTBUG-71948 Change-Id: I354d14479a43489f210cca31d6b9e0f65d083bb0 Fixes: QTBUG-71948 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* wasm: fix qpa plugin build system integrationOswald Buddenhagen2018-11-211-1/+1
| | | | | | | | | | | fix the plugin name (it was missing the leading 'q') and the name used in configure (the latter making it unnecessary to mess with it in the mkspec). the qt.prf override which forced linkage of the plugin is also removed due to being completely redundant. Change-Id: I94687a34a295c36754e36a298af902b656ba2ecc Reviewed-by: Kyle Edwards <kyle.edwards@kitware.com> Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* wasm: use maintainTimers instead of processEvents for touch callbackLorn Potter2018-10-251-1/+1
| | | | | Change-Id: If39cdeedef60a47c0ba1afbab6adf1668bf5d0d6 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* wasm: fix wheel scroll logicLorn Potter2018-10-201-2/+5
| | | | | | | Task-number: QTBUG-71180 Fixes: QTBUG-71180 Change-Id: If442da096b847fdf69f3b24615e99c2ca988fb79 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* wasm: use config for natural scroll on safariLorn Potter2018-10-011-0/+29
| | | | | Change-Id: Idc2ee096144194e3f0d9ca165a578ff9745ef13d Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* wasm: make maximized and fullscreen windows not draggableLorn Potter2018-09-284-21/+31
| | | | | | | | Also make fullscreen windows not have a titlebar Task-number: QTBUG-69318 Change-Id: I017fc40fecb9f46d6540ffb72a71c9b62097a368 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* wasm: disable RasterGlSurfaceLorn Potter2018-08-311-1/+1
| | | | | | | | | | | | QOpenGlWidget and QuickQidget do not work at this time anyway. This also causes gl to be initialized for widget apps, so disabling this will optimize widget apps. We could use Qt::AA_ForceRasterWidgets as well. Task-number: QTBUG-67797 Change-Id: I8f86a9f72e6f3d437a818b4fbe3d6f3658e17d04 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* WebAssembly for QtBaseMorten Johan Sørvig2018-08-3029-0/+4709
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>