We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3229

Summary: Various Emscripten changes
Product: SDL Reporter: Charlie Birks <charlie>
Component: *don't know*Assignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: hef, martin.gerhardy
Version: HG 2.0   
Hardware: Other   
OS: Other   
Attachments: use css size for touch normalisation
simplify fullscreen handling using new fullscreen_strategy api
use SDL_SetMouseFocus
listen for mouse up on document (fixes mouseup outside canvas)
send mouse move on enter/leave
Include timers when using cmake
optimize a getValue
optimize Emscripten_UpdateWindowFramebuffer
Fix of mouse events in browser without pointer locks
Accumulate subpixel mouse motion so motion is not lost.
Mouse events use CSS coordinates, so don't scale by pixel_ratio
Listen for blur and focus events on window instead of canvas
Unpress all keys on blur to avoid stuck keys
Fix CMake CMAKE_REQUIRED_FLAGS handling to preserve existing CMake flags required by Emscripten toolchain.
Remove unused variable warning from Emscripten build in Emscripten_HandleFullscreenChange().
Support SDL_SetWindowTitle() via Module['setWindowTitle']()
Fix full screen mode in Firefox, which was broken by 9d4beb2
use screen resolution instead of canvas size
only unset fullscreen flags if fullscreen failed
add some detail to fullscreen workaround comment
use Module.createContext for 2D rendering in emscripten
Add mapping for media keys
Only prevent the default browser event handling when the specific event types aren't disabled by the user

Description Charlie Birks 2016-01-09 14:57:23 UTC
Not sure of the best way to submit these, but here's a link to the relevant commits:

https://github.com/spurious/SDL-mirror/compare/master...Daft-Freak:squash
Comment 1 Martin Gerhardy 2016-01-13 14:06:02 UTC
+1 for these changes
Comment 2 Charlie Birks 2016-04-12 14:55:01 UTC
Created attachment 2410 [details]
use css size for touch normalisation

Prep for next patch
Comment 3 Charlie Birks 2016-04-12 14:55:53 UTC
Created attachment 2411 [details]
simplify fullscreen handling using new fullscreen_strategy api
Comment 4 Charlie Birks 2016-04-12 14:56:52 UTC
Created attachment 2412 [details]
use SDL_SetMouseFocus
Comment 5 Charlie Birks 2016-04-12 14:59:05 UTC
Created attachment 2413 [details]
listen for mouse up on document (fixes mouseup outside canvas)
Comment 6 Charlie Birks 2016-04-12 15:00:24 UTC
Created attachment 2414 [details]
send mouse move on enter/leave
Comment 7 Charlie Birks 2016-04-12 15:02:00 UTC
Created attachment 2415 [details]
Include timers when using cmake
Comment 8 Charlie Birks 2016-04-12 15:03:09 UTC
Created attachment 2416 [details]
optimize a getValue
Comment 9 Charlie Birks 2016-04-12 15:04:18 UTC
Created attachment 2417 [details]
optimize Emscripten_UpdateWindowFramebuffer

Significant optimisation to software rendering.
Comment 10 Charlie Birks 2016-04-12 15:05:31 UTC
Created attachment 2418 [details]
Fix of mouse events in browser without pointer locks
Comment 11 Charlie Birks 2016-04-12 15:07:17 UTC
Created attachment 2419 [details]
Accumulate subpixel mouse motion so motion is not lost.
Comment 12 Charlie Birks 2016-04-12 15:07:50 UTC
Created attachment 2420 [details]
Mouse events use CSS coordinates, so don't scale by pixel_ratio
Comment 13 Charlie Birks 2016-04-12 15:08:51 UTC
Created attachment 2421 [details]
Listen for blur and focus events on window instead of canvas
Comment 14 Charlie Birks 2016-04-12 15:14:51 UTC
Created attachment 2422 [details]
Unpress all keys on blur to avoid stuck keys
Comment 15 Charlie Birks 2016-04-12 15:16:43 UTC
Created attachment 2423 [details]
Fix CMake CMAKE_REQUIRED_FLAGS handling to preserve existing CMake flags required by Emscripten toolchain.
Comment 16 Charlie Birks 2016-04-12 15:17:18 UTC
Created attachment 2424 [details]
Remove unused variable warning from Emscripten build in Emscripten_HandleFullscreenChange().
Comment 17 Charlie Birks 2016-04-12 15:18:48 UTC
Created attachment 2425 [details]
Support SDL_SetWindowTitle() via Module['setWindowTitle']()
Comment 18 Charlie Birks 2016-04-12 15:23:32 UTC
Created attachment 2426 [details]
Fix full screen mode in Firefox, which was broken by 9d4beb2

This one is a hack but we can't use fullscreen mode otherwise... (see https://github.com/emscripten-ports/SDL2/pull/13 and https://github.com/kripken/emscripten/pull/3265)
Comment 19 Charlie Birks 2016-04-12 15:25:15 UTC
Created attachment 2427 [details]
use screen resolution instead of canvas size

Makes reported display mode actually match the screen.
Comment 20 Charlie Birks 2016-04-12 15:26:19 UTC
Created attachment 2428 [details]
only unset fullscreen flags if fullscreen failed
Comment 21 Charlie Birks 2016-04-12 15:27:36 UTC
Created attachment 2429 [details]
add some detail to fullscreen workaround comment

Comment on fullscreen hack
Comment 22 Charlie Birks 2016-04-12 15:28:21 UTC
Created attachment 2430 [details]
use Module.createContext for 2D rendering in emscripten
Comment 23 Charlie Birks 2016-04-12 15:29:04 UTC
Created attachment 2431 [details]
Add mapping for media keys
Comment 24 Charlie Birks 2016-04-12 15:29:43 UTC
Created attachment 2432 [details]
Only prevent the default browser event handling when the specific event types aren't disabled by the user
Comment 25 Charlie Birks 2016-04-12 15:32:03 UTC
Reminded about this today, so generated patches.
Comment 26 Charlie Birks 2016-09-01 14:11:51 UTC
Apart from "simplify fullscreen handling using new fullscreen_strategy api" and "Only prevent the default browser event handling when the specific event types aren't disabled by the user" these should still apply. Rebased versions of these are here: 

https://github.com/Daft-Freak/SDL-emscripten/commit/1cb4f143721ccf3217b55285d9755133caa261ff
https://github.com/Daft-Freak/SDL-emscripten/commit/365e9166000abe87d71f2d8316a317db826f87b8

Is there anything I need to do to get these looked at?
Comment 27 Sam Lantinga 2016-09-13 07:11:07 UTC
Patches applied, thanks!