diff --git a/src/core/keybindings.c b/src/core/keybindings.c index cfbf35d5f..e44f36ecc 100644 --- a/src/core/keybindings.c +++ b/src/core/keybindings.c @@ -1618,10 +1618,10 @@ meta_window_grab_keys (MetaWindow *window) if (priv->keys_grabbed) { - if (window->frame && !window->grab_on_frame) + if (window->frame && !priv->grab_on_frame) change_window_keygrabs (keys, meta_window_x11_get_xwindow (window), FALSE); else if (window->frame == NULL && - window->grab_on_frame) + priv->grab_on_frame) ; /* continue to regrab on client window */ else return; /* already all good */ @@ -1632,7 +1632,7 @@ meta_window_grab_keys (MetaWindow *window) TRUE); priv->keys_grabbed = TRUE; - window->grab_on_frame = window->frame != NULL; + priv->grab_on_frame = window->frame != NULL; } void @@ -1650,10 +1650,10 @@ meta_window_ungrab_keys (MetaWindow *window) MetaDisplay *display = window->display; MetaKeyBindingManager *keys = &display->key_binding_manager; - if (window->grab_on_frame && + if (priv->grab_on_frame && window->frame != NULL) change_window_keygrabs (keys, window->frame->xwindow, FALSE); - else if (!window->grab_on_frame) + else if (!priv->grab_on_frame) change_window_keygrabs (keys, meta_window_x11_get_xwindow (window), FALSE); priv->keys_grabbed = FALSE; diff --git a/src/core/window-private.h b/src/core/window-private.h index 58efabc0d..ec2cfd762 100644 --- a/src/core/window-private.h +++ b/src/core/window-private.h @@ -506,9 +506,6 @@ struct _MetaWindow /* Are we in meta_window_new()? */ guint constructing : 1; - /* Used by keybindings.c */ - guint grab_on_frame : 1; /* grabs are on the frame */ - /* Set if the reason for unmanaging the window is that * it was withdrawn */ diff --git a/src/core/window.c b/src/core/window.c index 95d1785c8..a3e5a7685 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -1059,7 +1059,6 @@ meta_window_constructed (GObject *object) window->placed = ((window->mapped && !window->hidden) || window->override_redirect); window->denied_focus_and_not_transient = FALSE; window->unmanaging = FALSE; - window->grab_on_frame = FALSE; window->withdrawn = FALSE; window->initial_workspace_set = FALSE; window->initial_timestamp_set = FALSE; diff --git a/src/x11/window-x11-private.h b/src/x11/window-x11-private.h index da10f6c52..8b3ac2a4e 100644 --- a/src/x11/window-x11-private.h +++ b/src/x11/window-x11-private.h @@ -94,6 +94,7 @@ struct _MetaWindowX11Private /* Used by keybindings.c */ gboolean keys_grabbed; /* normal keybindings grabbed */ + gboolean grab_on_frame; /* grabs are on the frame */ }; MetaWindowX11Private * meta_window_x11_get_private (MetaWindowX11 *window_x11); diff --git a/src/x11/window-x11.c b/src/x11/window-x11.c index aebf583fe..18ed0a5f4 100644 --- a/src/x11/window-x11.c +++ b/src/x11/window-x11.c @@ -2088,6 +2088,7 @@ meta_window_x11_constructed (GObject *object) priv->xclient_leader = None; priv->keys_grabbed = FALSE; + priv->grab_on_frame = FALSE; g_signal_connect (window, "notify::decorated", G_CALLBACK (meta_window_x11_update_input_region),