瀏覽代碼

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

Lasse Öörni 10 年之前
父節點
當前提交
99d93393d1
共有 1 個文件被更改,包括 2 次插入1 次删除
  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