We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent64df9cf commitdeb85d1Copy full SHA for deb85d1
src/video/emscripten/SDL_emscriptenevents.c
@@ -497,10 +497,21 @@ static EM_BOOL Emscripten_HandleFullscreenChange(int eventType, const Emscripten
497
staticEM_BOOLEmscripten_HandleFullscreenChangeGlobal(inteventType,constEmscriptenFullscreenChangeEvent*fullscreenChangeEvent,void*userData)
498
{
499
SDL_VideoDevice*device=userData;
500
-SDL_Window*window=Emscripten_GetFocusedWindow(device);
+SDL_Window*window=NULL;
501
+for (window=device->windows;window!=NULL;window=window->next) {
502
+constchar*canvas_id=window->internal->canvas_id;
503
+if (*canvas_id=='#') {
504
+canvas_id++;
505
+ }
506
+if (SDL_strcmp(fullscreenChangeEvent->id,canvas_id)==0) {
507
+break;// this is the window.
508
509
510
+
511
if (window) {
512
returnEmscripten_HandleFullscreenChange(eventType,fullscreenChangeEvent,window->internal);
513
}
514
515
returnEM_FALSE;
516
517