From b521400861ccd2e71d7d31dd239fd01a2bd5c7f4 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Wed, 2 Apr 2025 08:33:16 -0700
Subject: [PATCH] Note that the Emscripten window properties are strings
---
include/SDL3/SDL_video.h | 8 ++++----
src/video/emscripten/SDL_emscriptenvideo.c | 4 ++--
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/include/SDL3/SDL_video.h b/include/SDL3/SDL_video.h
index def306b242b67..799b9528676cf 100644
--- a/include/SDL3/SDL_video.h
+++ b/include/SDL3/SDL_video.h
@@ -1544,9 +1544,9 @@ extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_GetWindowParent(SDL_Window *window)
*
* On Emscripten:
*
- * - `SDL_PROP_WINDOW_EMSCRIPTEN_CANVAS_ID`: the id the canvas element will
+ * - `SDL_PROP_WINDOW_EMSCRIPTEN_CANVAS_ID_STRING`: the id the canvas element will
* have
- * - `SDL_PROP_WINDOW_EMSCRIPTEN_KEYBOARD_ELEMENT`: the keyboard element that
+ * - `SDL_PROP_WINDOW_EMSCRIPTEN_KEYBOARD_ELEMENT_STRING`: the keyboard element that
* associates keyboard events to this window
*
* \param window the window to query.
@@ -1594,8 +1594,8 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetWindowProperties(SDL_Window
#define SDL_PROP_WINDOW_X11_DISPLAY_POINTER "SDL.window.x11.display"
#define SDL_PROP_WINDOW_X11_SCREEN_NUMBER "SDL.window.x11.screen"
#define SDL_PROP_WINDOW_X11_WINDOW_NUMBER "SDL.window.x11.window"
-#define SDL_PROP_WINDOW_EMSCRIPTEN_CANVAS_ID "SDL.window.emscripten.canvas_id"
-#define SDL_PROP_WINDOW_EMSCRIPTEN_KEYBOARD_ELEMENT "SDL.window.emscripten.keyboard_element"
+#define SDL_PROP_WINDOW_EMSCRIPTEN_CANVAS_ID_STRING "SDL.window.emscripten.canvas_id"
+#define SDL_PROP_WINDOW_EMSCRIPTEN_KEYBOARD_ELEMENT_STRING "SDL.window.emscripten.keyboard_element"
/**
* Get the window flags.
diff --git a/src/video/emscripten/SDL_emscriptenvideo.c b/src/video/emscripten/SDL_emscriptenvideo.c
index c8890c5caa852..a265ca9c9c596 100644
--- a/src/video/emscripten/SDL_emscriptenvideo.c
+++ b/src/video/emscripten/SDL_emscriptenvideo.c
@@ -526,8 +526,8 @@ static bool Emscripten_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window,
}, window);
// Ensure canvas_id and keyboard_element are added to the window's properties
- SDL_SetStringProperty(window->props, SDL_PROP_WINDOW_EMSCRIPTEN_CANVAS_ID, wdata->canvas_id);
- SDL_SetStringProperty(window->props, SDL_PROP_WINDOW_EMSCRIPTEN_KEYBOARD_ELEMENT, wdata->keyboard_element);
+ SDL_SetStringProperty(window->props, SDL_PROP_WINDOW_EMSCRIPTEN_CANVAS_ID_STRING, wdata->canvas_id);
+ SDL_SetStringProperty(window->props, SDL_PROP_WINDOW_EMSCRIPTEN_KEYBOARD_ELEMENT_STRING, wdata->keyboard_element);
// Window has been successfully created
return true;