forked from AuroraMiddleware/gtk
window: tie focus to surface state changes
We don't get a focus-out on the event controller, when the surface is losing keyboard focus, since we are not moving our focus to some other widget, so we are never unsetting the mnemonics-visible property. Do that in response to surface state changes instead.
This commit is contained in:
parent
6e6b4a851f
commit
1f8e633fff
@ -5088,7 +5088,16 @@ surface_state_changed (GtkWidget *widget)
|
||||
priv->state = new_surface_state;
|
||||
|
||||
if (changed_mask & GDK_SURFACE_STATE_FOCUSED)
|
||||
ensure_state_flag_backdrop (widget);
|
||||
{
|
||||
gboolean focused = new_surface_state & GDK_SURFACE_STATE_FOCUSED;
|
||||
|
||||
ensure_state_flag_backdrop (widget);
|
||||
|
||||
_gtk_window_set_is_active (window, focused);
|
||||
|
||||
if (!focused)
|
||||
gtk_window_set_mnemonics_visible (window, FALSE);
|
||||
}
|
||||
|
||||
if (changed_mask & GDK_SURFACE_STATE_FULLSCREEN)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user