1
0
Fork 0

window: Move grab_on_frame to WindowX11

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3584>
This commit is contained in:
Bilal Elmoussaoui 2024-02-14 14:27:42 +01:00 committed by Marge Bot
parent de2a24b313
commit 72326d8ca5
5 changed files with 7 additions and 9 deletions

View file

@ -1618,10 +1618,10 @@ meta_window_grab_keys (MetaWindow *window)
if (priv->keys_grabbed) 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); change_window_keygrabs (keys, meta_window_x11_get_xwindow (window), FALSE);
else if (window->frame == NULL && else if (window->frame == NULL &&
window->grab_on_frame) priv->grab_on_frame)
; /* continue to regrab on client window */ ; /* continue to regrab on client window */
else else
return; /* already all good */ return; /* already all good */
@ -1632,7 +1632,7 @@ meta_window_grab_keys (MetaWindow *window)
TRUE); TRUE);
priv->keys_grabbed = TRUE; priv->keys_grabbed = TRUE;
window->grab_on_frame = window->frame != NULL; priv->grab_on_frame = window->frame != NULL;
} }
void void
@ -1650,10 +1650,10 @@ meta_window_ungrab_keys (MetaWindow *window)
MetaDisplay *display = window->display; MetaDisplay *display = window->display;
MetaKeyBindingManager *keys = &display->key_binding_manager; MetaKeyBindingManager *keys = &display->key_binding_manager;
if (window->grab_on_frame && if (priv->grab_on_frame &&
window->frame != NULL) window->frame != NULL)
change_window_keygrabs (keys, window->frame->xwindow, FALSE); 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); change_window_keygrabs (keys, meta_window_x11_get_xwindow (window), FALSE);
priv->keys_grabbed = FALSE; priv->keys_grabbed = FALSE;

View file

@ -506,9 +506,6 @@ struct _MetaWindow
/* Are we in meta_window_new()? */ /* Are we in meta_window_new()? */
guint constructing : 1; 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 /* Set if the reason for unmanaging the window is that
* it was withdrawn * it was withdrawn
*/ */

View file

@ -1059,7 +1059,6 @@ meta_window_constructed (GObject *object)
window->placed = ((window->mapped && !window->hidden) || window->override_redirect); window->placed = ((window->mapped && !window->hidden) || window->override_redirect);
window->denied_focus_and_not_transient = FALSE; window->denied_focus_and_not_transient = FALSE;
window->unmanaging = FALSE; window->unmanaging = FALSE;
window->grab_on_frame = FALSE;
window->withdrawn = FALSE; window->withdrawn = FALSE;
window->initial_workspace_set = FALSE; window->initial_workspace_set = FALSE;
window->initial_timestamp_set = FALSE; window->initial_timestamp_set = FALSE;

View file

@ -94,6 +94,7 @@ struct _MetaWindowX11Private
/* Used by keybindings.c */ /* Used by keybindings.c */
gboolean keys_grabbed; /* normal keybindings grabbed */ gboolean keys_grabbed; /* normal keybindings grabbed */
gboolean grab_on_frame; /* grabs are on the frame */
}; };
MetaWindowX11Private * meta_window_x11_get_private (MetaWindowX11 *window_x11); MetaWindowX11Private * meta_window_x11_get_private (MetaWindowX11 *window_x11);

View file

@ -2088,6 +2088,7 @@ meta_window_x11_constructed (GObject *object)
priv->xclient_leader = None; priv->xclient_leader = None;
priv->keys_grabbed = FALSE; priv->keys_grabbed = FALSE;
priv->grab_on_frame = FALSE;
g_signal_connect (window, "notify::decorated", g_signal_connect (window, "notify::decorated",
G_CALLBACK (meta_window_x11_update_input_region), G_CALLBACK (meta_window_x11_update_input_region),