From 449aba978957fa1a78b05b52ce3f9096086f62bc Mon Sep 17 00:00:00 2001 From: asdqwe Date: Thu, 12 Dec 2024 17:53:03 -0300 Subject: [PATCH 1/3] Enable FLAG_WINDOW_ALWAYS_RUN by default on PLATFORM_DESKTOP_GLFW --- src/platforms/rcore_desktop_glfw.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/platforms/rcore_desktop_glfw.c b/src/platforms/rcore_desktop_glfw.c index 5caf17ea..b406b2f7 100644 --- a/src/platforms/rcore_desktop_glfw.c +++ b/src/platforms/rcore_desktop_glfw.c @@ -1341,6 +1341,9 @@ int InitPlatform(void) if ((CORE.Window.flags & FLAG_WINDOW_TOPMOST) > 0) glfwWindowHint(GLFW_FLOATING, GLFW_TRUE); else glfwWindowHint(GLFW_FLOATING, GLFW_FALSE); + // Enable FLAG_WINDOW_ALWAYS_RUN by default + if ((CORE.Window.flags & FLAG_WINDOW_ALWAYS_RUN) == 0) CORE.Window.flags |= FLAG_WINDOW_ALWAYS_RUN; + // NOTE: Some GLFW flags are not supported on HTML5 if ((CORE.Window.flags & FLAG_WINDOW_TRANSPARENT) > 0) glfwWindowHint(GLFW_TRANSPARENT_FRAMEBUFFER, GLFW_TRUE); // Transparent framebuffer else glfwWindowHint(GLFW_TRANSPARENT_FRAMEBUFFER, GLFW_FALSE); // Opaque framebuffer From 5711d2c5c813c3082471b0b070a9e214b2fe2e4a Mon Sep 17 00:00:00 2001 From: asdqwe Date: Mon, 16 Dec 2024 22:46:06 -0300 Subject: [PATCH 2/3] Revert enabling FLAG_WINDOW_ALWAYS_RUN by default on PLATFORM_DESKTOP_GLFW --- src/platforms/rcore_desktop_glfw.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/platforms/rcore_desktop_glfw.c b/src/platforms/rcore_desktop_glfw.c index b406b2f7..5caf17ea 100644 --- a/src/platforms/rcore_desktop_glfw.c +++ b/src/platforms/rcore_desktop_glfw.c @@ -1341,9 +1341,6 @@ int InitPlatform(void) if ((CORE.Window.flags & FLAG_WINDOW_TOPMOST) > 0) glfwWindowHint(GLFW_FLOATING, GLFW_TRUE); else glfwWindowHint(GLFW_FLOATING, GLFW_FALSE); - // Enable FLAG_WINDOW_ALWAYS_RUN by default - if ((CORE.Window.flags & FLAG_WINDOW_ALWAYS_RUN) == 0) CORE.Window.flags |= FLAG_WINDOW_ALWAYS_RUN; - // NOTE: Some GLFW flags are not supported on HTML5 if ((CORE.Window.flags & FLAG_WINDOW_TRANSPARENT) > 0) glfwWindowHint(GLFW_TRANSPARENT_FRAMEBUFFER, GLFW_TRUE); // Transparent framebuffer else glfwWindowHint(GLFW_TRANSPARENT_FRAMEBUFFER, GLFW_FALSE); // Opaque framebuffer From 74ad9d75b564f84ec6ce20f8710e611b9ad15fcd Mon Sep 17 00:00:00 2001 From: asdqwe Date: Mon, 16 Dec 2024 22:48:47 -0300 Subject: [PATCH 3/3] Add implementation for FLAG_WINDOW_ALWAYS_RUN on PLATFORM_DESKTOP_SDL --- src/platforms/rcore_desktop_sdl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/platforms/rcore_desktop_sdl.c b/src/platforms/rcore_desktop_sdl.c index de93a1f5..b83d70e3 100644 --- a/src/platforms/rcore_desktop_sdl.c +++ b/src/platforms/rcore_desktop_sdl.c @@ -571,7 +571,7 @@ void SetWindowState(unsigned int flags) } if (flags & FLAG_WINDOW_ALWAYS_RUN) { - TRACELOG(LOG_WARNING, "SetWindowState() - FLAG_WINDOW_ALWAYS_RUN is not supported on PLATFORM_DESKTOP_SDL"); + CORE.Window.flags |= FLAG_WINDOW_ALWAYS_RUN; } if (flags & FLAG_WINDOW_TRANSPARENT) { @@ -658,7 +658,7 @@ void ClearWindowState(unsigned int flags) } if (flags & FLAG_WINDOW_ALWAYS_RUN) { - TRACELOG(LOG_WARNING, "ClearWindowState() - FLAG_WINDOW_ALWAYS_RUN is not supported on PLATFORM_DESKTOP_SDL"); + CORE.Window.flags &= ~FLAG_WINDOW_ALWAYS_RUN; } if (flags & FLAG_WINDOW_TRANSPARENT) { @@ -1378,6 +1378,8 @@ void PollInputEvents(void) CORE.Window.resizedLastFrame = false; + if (((CORE.Window.flags & FLAG_WINDOW_MINIMIZED) > 0) && ((CORE.Window.flags & FLAG_WINDOW_ALWAYS_RUN) == 0)) SDL_WaitEvent(NULL); + SDL_Event event = { 0 }; while (SDL_PollEvent(&event) != 0) {