diff --git a/src/core/window.c b/src/core/window.c index 95ea18f2c..95a8e33e0 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -4502,6 +4502,8 @@ meta_window_focus (MetaWindow *window, { MetaWorkspaceManager *workspace_manager = window->display->workspace_manager; MetaWindow *modal_transient; + MetaBackend *backend; + ClutterStage *stage; g_return_if_fail (!window->override_redirect); @@ -4548,12 +4550,12 @@ meta_window_focus (MetaWindow *window, META_WINDOW_GET_CLASS (window)->focus (window, timestamp); - if (window->display->event_route == META_EVENT_ROUTE_NORMAL) - { - MetaBackend *backend = meta_get_backend (); - ClutterStage *stage = CLUTTER_STAGE (meta_backend_get_stage (backend)); - clutter_stage_set_key_focus (stage, NULL); - } + backend = meta_get_backend (); + stage = CLUTTER_STAGE (meta_backend_get_stage (backend)); + + if (window->display->event_route == META_EVENT_ROUTE_NORMAL && + clutter_stage_get_grab_actor (stage) == NULL) + clutter_stage_set_key_focus (stage, NULL); if (window->close_dialog && meta_close_dialog_is_visible (window->close_dialog))