Browse Source

Prevent losing input focus when using an external window, as the window flags are not reliable in that case.

Lasse Öörni 10 năm trước cách đây
mục cha
commit
99d93393d1
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 2 1
      Source/Urho3D/Input/Input.cpp

+ 2 - 1
Source/Urho3D/Input/Input.cpp

@@ -296,7 +296,8 @@ void Input::Update()
         if (focusedThisFrame_)
             GainFocus();
 
-        if (inputFocus_ && (flags & SDL_WINDOW_INPUT_FOCUS) == 0)
+        // Check for losing focus. The window flags are not reliable when using an external window, so prevent losing focus in that case
+        if (inputFocus_ && !graphics_->GetExternalWindow() && (flags & SDL_WINDOW_INPUT_FOCUS) == 0)
             LoseFocus();
     }
     else