Skip to content

Commit c580523

Browse files
committed
Ensure window title doesn't get updated by other windows
1 parent 2c9615c commit c580523

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/video/emscripten/SDL_emscriptenvideo.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -769,9 +769,17 @@ static SDL_FullscreenResult Emscripten_SetWindowFullscreen(SDL_VideoDevice *_thi
769769
}
770770
}
771771

772+
// Assume the first window that calls SDL_SetWindowTitle is the main window.
773+
static SDL_Window *mainWindow = NULL;
774+
772775
static void Emscripten_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window)
773776
{
774-
emscripten_set_window_title(window->title);
777+
if (!mainWindow) {
778+
mainWindow = window;
779+
}
780+
if (mainWindow == window) {
781+
emscripten_set_window_title(window->title);
782+
}
775783
}
776784

777785
static bool Emscripten_SetWindowPosition(SDL_VideoDevice *_this, SDL_Window *window)

0 commit comments

Comments
 (0)