aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Weissflog <floooh@gmail.com>2025-09-01 19:55:48 +0200
committerAndre Weissflog <floooh@gmail.com>2025-09-01 19:55:48 +0200
commitd6d15ac807e5c4c89fe1b9ca39585034f7cbb96c (patch)
treecf3090e0b4cf08dbc9f9322a555e11a1aa2c939f
parente779384ff96b259520bc7637efc25785949fae77 (diff)
update changelog and readme, fix some sokol_app.h comments
-rw-r--r--CHANGELOG.md8
-rw-r--r--README.md2
-rw-r--r--sokol_app.h13
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
diff --git a/README.md b/README.md
index d1d522d5..1e811658 100644
--- a/README.md
+++ b/README.md
@@ -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)
[![Build](/../../actions/workflows/main.yml/badge.svg)](/../../actions/workflows/main.yml) [![Bindings](/../../actions/workflows/gen_bindings.yml/badge.svg)](/../../actions/workflows/gen_bindings.yml) [![build](https://github.com/floooh/sokol-zig/actions/workflows/main.yml/badge.svg)](https://github.com/floooh/sokol-zig/actions/workflows/main.yml) [![build](https://github.com/floooh/sokol-nim/actions/workflows/main.yml/badge.svg)](https://github.com/floooh/sokol-nim/actions/workflows/main.yml) [![Odin](https://github.com/floooh/sokol-odin/actions/workflows/main.yml/badge.svg)](https://github.com/floooh/sokol-odin/actions/workflows/main.yml)[![Rust](https://github.com/floooh/sokol-rust/actions/workflows/main.yml/badge.svg)](https://github.com/floooh/sokol-rust/actions/workflows/main.yml)[![Dlang](https://github.com/kassane/sokol-d/actions/workflows/build.yml/badge.svg)](https://github.com/kassane/sokol-d/actions/workflows/build.yml)[![C3](https://github.com/floooh/sokol-c3/actions/workflows/build.yml/badge.svg)](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;
}