mirror of
https://github.com/raysan5/raylib.git
synced 2026-02-26 21:35:03 +00:00
Fix reversed window blur/focus logic for web (#5590)
This commit is contained in:
@@ -1482,8 +1482,8 @@ static void WindowIconifyCallback(GLFWwindow *window, int iconified)
|
||||
// GLFW3: Called on windows get/lose focus
|
||||
static void WindowFocusCallback(GLFWwindow *window, int focused)
|
||||
{
|
||||
if (focused) FLAG_SET(CORE.Window.flags, FLAG_WINDOW_UNFOCUSED); // The window was focused
|
||||
else FLAG_CLEAR(CORE.Window.flags, FLAG_WINDOW_UNFOCUSED); // The window lost focus
|
||||
if (focused) FLAG_CLEAR(CORE.Window.flags, FLAG_WINDOW_UNFOCUSED); // The window was focused
|
||||
else FLAG_SET(CORE.Window.flags, FLAG_WINDOW_UNFOCUSED); // The window lost focus
|
||||
}
|
||||
|
||||
// GLFW3: Called on file-drop over the window
|
||||
|
||||
@@ -1321,8 +1321,8 @@ static EM_BOOL EmscriptenFocusCallback(int eventType, const EmscriptenFocusEvent
|
||||
|
||||
switch (eventType)
|
||||
{
|
||||
case EMSCRIPTEN_EVENT_BLUR: FLAG_CLEAR(CORE.Window.flags, FLAG_WINDOW_UNFOCUSED); break; // The canvas lost focus
|
||||
case EMSCRIPTEN_EVENT_FOCUS: FLAG_SET(CORE.Window.flags, FLAG_WINDOW_UNFOCUSED); break;
|
||||
case EMSCRIPTEN_EVENT_BLUR: FLAG_SET(CORE.Window.flags, FLAG_WINDOW_UNFOCUSED); break; // The canvas lost focus
|
||||
case EMSCRIPTEN_EVENT_FOCUS: FLAG_CLEAR(CORE.Window.flags, FLAG_WINDOW_UNFOCUSED); break;
|
||||
default: consumed = 0; break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user