Skip to content

Commit 0889e89

Browse files
committed
Hackfixed onClientBlur not triggering when clicking into an empty area
1 parent cca0492 commit 0889e89

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

MTA10/gui/CGUI_Impl.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,6 +1128,16 @@ bool CGUI_Impl::Event_MouseButtonDown ( const CEGUI::EventArgs& Args )
11281128
// Call global and object handlers
11291129
if ( pElement )
11301130
pElement->Event_OnMouseButtonDown();
1131+
else
1132+
{
1133+
// If there's no element, we're probably dealing with the root element
1134+
CEGUI::Window* pActiveWindow = m_pTop->getActiveChild();
1135+
if ( m_pTop == wnd && pActiveWindow )
1136+
{
1137+
// Deactivate active window to trigger onClientGUIBlur
1138+
pActiveWindow->deactivate();
1139+
}
1140+
}
11311141

11321142
if ( m_MouseButtonDownHandlers[ m_Channel ] )
11331143
{

0 commit comments

Comments
 (0)