@ -1220,32 +1220,42 @@ static void processEvent(XEvent *event)
case FocusIn :
case FocusIn :
{
{
if ( event - > xfocus . mode = = NotifyNormal )
if ( event - > xfocus . mode = = NotifyGrab | |
event - > xfocus . mode = = NotifyUngrab )
{
{
if ( window - > x11 . ic )
// Ignore focus events from popup indicator windows, window menu
XSetICFocus ( window - > x11 . ic ) ;
// key chords and window dragging
return ;
}
if ( window - > x11 . ic )
XSetICFocus ( window - > x11 . ic ) ;
_glfwInputWindowFocus ( window , GL_TRUE ) ;
_glfwInputWindowFocus ( window , GL_TRUE ) ;
if ( window - > cursorMode = = GLFW_CURSOR_DISABLED )
if ( window - > cursorMode = = GLFW_CURSOR_DISABLED )
disableCursor ( window ) ;
disableCursor ( window ) ;
}
return ;
return ;
}
}
case FocusOut :
case FocusOut :
{
{
if ( event - > xfocus . mode = = NotifyNormal )
if ( event - > xfocus . mode = = NotifyGrab | |
event - > xfocus . mode = = NotifyUngrab )
{
{
if ( window - > x11 . ic )
// Ignore focus events from popup indicator windows, window menu
XUnsetICFocus ( window - > x11 . ic ) ;
// key chords and window dragging
return ;
}
if ( window - > x11 . ic )
XUnsetICFocus ( window - > x11 . ic ) ;
_glfwInputWindowFocus ( window , GL_FALSE ) ;
_glfwInputWindowFocus ( window , GL_FALSE ) ;
if ( window - > cursorMode = = GLFW_CURSOR_DISABLED )
if ( window - > cursorMode = = GLFW_CURSOR_DISABLED )
restoreCursor ( window ) ;
restoreCursor ( window ) ;
}
return ;
return ;
}
}