소스 검색

Fix reversed window blur/focus logic for web (#5590)

pull/5591/head
Borin Ouch 6 일 전
committed by GitHub
부모
커밋
ad82393bb8
No known key found for this signature in database GPG 키 ID: B5690EEEBB952194
2개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. +2
    -2
      src/platforms/rcore_web.c
  2. +2
    -2
      src/platforms/rcore_web_emscripten.c

+ 2
- 2
src/platforms/rcore_web.c 파일 보기

@ -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

+ 2
- 2
src/platforms/rcore_web_emscripten.c 파일 보기

@ -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;
}

불러오는 중...
취소
저장