diff options
| -rw-r--r-- | CHANGELOG.md | 8 | ||||
| -rw-r--r-- | README.md | 2 | ||||
| -rw-r--r-- | sokol_app.h | 13 |
3 files changed, 18 insertions, 5 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e739665..5c19bf56 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,14 @@ restored when moving the mouse outside a window and then back in. Again, many thanks to @Seb-degraff for identifying the issue and providing a fix via PR https://github.com/floooh/sokol/pull/1323! +- ...and another sokol_app.h update: `sapp_toggle_fullscreen()` now works on the web + (with the usual web platform caveats: the function needs to be called within + or 'near' an input event, and the user may leave fullscreen mode at any time, + and Safari on iOS doesn't support fullscreen mode at all). + + Many thanks again to @Seb-degraff for kicking this off! Original PR: + https://github.com/floooh/sokol/pull/1322, merge branch PR with additional + fixes: https://github.com/floooh/sokol/pull/1324 ### 29-Aug-2025 @@ -6,7 +6,7 @@ # Sokol -[**See what's new**](https://github.com/floooh/sokol/blob/master/CHANGELOG.md) (**01-Sep-2025**: custom mouse cursors in sokol_app.h) +[**See what's new**](https://github.com/floooh/sokol/blob/master/CHANGELOG.md) (**01-Sep-2025**: custom mouse cursors in and web fullscreen support in sokol_app.h) [](/../../actions/workflows/main.yml) [](/../../actions/workflows/gen_bindings.yml) [](https://github.com/floooh/sokol-zig/actions/workflows/main.yml) [](https://github.com/floooh/sokol-nim/actions/workflows/main.yml) [](https://github.com/floooh/sokol-odin/actions/workflows/main.yml)[](https://github.com/floooh/sokol-rust/actions/workflows/main.yml)[](https://github.com/kassane/sokol-d/actions/workflows/build.yml)[](https://github.com/floooh/sokol-c3/actions/workflows/build.yml) diff --git a/sokol_app.h b/sokol_app.h index 2a69d458..323e0e61 100644 --- a/sokol_app.h +++ b/sokol_app.h @@ -866,8 +866,13 @@ call sapp_is_fullscreen(). On the web, sapp_desc.fullscreen will have no effect, and the application - will always start in non-fullscreen mode. Call sapp_toggle_fullscreen() to - switch to fullscreen programatically, if the user allows it. + will always start in non-fullscreen mode. Call sapp_toggle_fullscreen() + from within or 'near' an input event to switch to fullscreen programatically. + Note that on the web, the fullscreen state may change back to windowed at + any time (either because the browser had rejected switching into fullscreen, + or the user leaves fullscreen via Esc), this means that the result + of sapp_is_fullscreen() may change also without calling sapp_toggle_fullscreen()! + WINDOW ICON SUPPORT =================== @@ -5726,8 +5731,8 @@ _SOKOL_PRIVATE EM_BOOL _sapp_emsc_fullscreenchange_cb(int emsc_type, const Emscr return true; } -// will be called after the request/exitFullscreen promise resolves or rejects -// to set the actual state of fullscreen mode +// will be called after the request/exitFullscreen promise rejects +// to restore the _sapp.fullscreen flag to the actual fullscreen state EMSCRIPTEN_KEEPALIVE void _sapp_emsc_set_fullscreen_flag(int f) { _sapp.fullscreen = (bool)f; } |