Browse Source

Send UIMOUSECLICK event on click to emptiness even if there is a modal element. Fixes #423.

Lasse Öörni 11 years ago
parent
commit
1c6d04c6b5
1 changed files with 4 additions and 3 deletions
  1. 4 3
      Source/Engine/UI/UI.cpp

+ 4 - 3
Source/Engine/UI/UI.cpp

@@ -1023,10 +1023,11 @@ void UI::ProcessClickBegin(const IntVector2& cursorPos, int button, int buttons,
                 dragBeginTimer_.Reset();
             }
         }
-        else if (!HasModalElement())
+        else
         {
-            // If clicked over no element, or a disabled element, lose focus
-            SetFocusElement(0);
+            // If clicked over no element, or a disabled element, lose focus (but not if there is a modal element)
+            if (!HasModalElement())
+                SetFocusElement(0);
             SendClickEvent(E_UIMOUSECLICK, element, cursorPos, button, buttons, qualifiers);
         }