Browse Source

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

Lasse Öörni 10 years ago
parent
commit
99d93393d1
1 changed files with 2 additions and 1 deletions
  1. 2 1
      Source/Urho3D/Input/Input.cpp

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

@@ -296,7 +296,8 @@ void Input::Update()
         if (focusedThisFrame_)
         if (focusedThisFrame_)
             GainFocus();
             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();
             LoseFocus();
     }
     }
     else
     else