From 12773cf8e2954082f346dee300af624b25baf23c Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Thu, 29 Sep 2022 19:21:50 +0200 Subject: [PATCH] window: Drop frame_action argument from meta_window_begin_grab_op() The final effect of this boolean can now be expressed through the META_GRAB_OP_WINDOW_FLAG_UNCONSTRAINED flag to MetaGrabOp. Use that in the relevant places, and drop the argument. Part-of: --- src/core/keybindings.c | 8 ++++---- src/core/window.c | 10 +++------- src/meta/window.h | 1 - src/wayland/meta-wayland-surface.c | 1 - src/x11/window-x11.c | 10 +--------- 5 files changed, 8 insertions(+), 22 deletions(-) diff --git a/src/core/keybindings.c b/src/core/keybindings.c index ed2b6bbd3..fda45cece 100644 --- a/src/core/keybindings.c +++ b/src/core/keybindings.c @@ -3378,8 +3378,8 @@ handle_begin_move (MetaDisplay *display, if (window->has_move_func) { meta_window_begin_grab_op (window, - META_GRAB_OP_KEYBOARD_MOVING, - FALSE, + META_GRAB_OP_KEYBOARD_MOVING | + META_GRAB_OP_WINDOW_FLAG_UNCONSTRAINED, event->time); } } @@ -3394,8 +3394,8 @@ handle_begin_resize (MetaDisplay *display, if (window->has_resize_func) { meta_window_begin_grab_op (window, - META_GRAB_OP_KEYBOARD_RESIZING_UNKNOWN, - FALSE, + META_GRAB_OP_KEYBOARD_RESIZING_UNKNOWN | + META_GRAB_OP_WINDOW_FLAG_UNCONSTRAINED, event->time); } } diff --git a/src/core/window.c b/src/core/window.c index c288e528f..67d5a5633 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -6733,7 +6733,6 @@ warp_grab_pointer (MetaWindow *window, gboolean meta_window_begin_grab_op (MetaWindow *window, MetaGrabOp op, - gboolean frame_action, guint32 timestamp) { int x, y; @@ -6756,9 +6755,6 @@ meta_window_begin_grab_op (MetaWindow *window, y = pos.y; } - if (!frame_action) - op |= META_GRAB_OP_WINDOW_FLAG_UNCONSTRAINED; - return meta_display_begin_grab_op (window->display, window, op, @@ -8391,9 +8387,9 @@ meta_window_handle_ungrabbed_event (MetaWindow *window, if (op != META_GRAB_OP_WINDOW_BASE) { + op |= META_GRAB_OP_WINDOW_FLAG_UNCONSTRAINED; meta_window_begin_grab_op (window, op, - FALSE, event->any.time); } } @@ -8411,8 +8407,8 @@ meta_window_handle_ungrabbed_event (MetaWindow *window, if (window->has_move_func) { meta_window_begin_grab_op (window, - META_GRAB_OP_MOVING, - FALSE, + META_GRAB_OP_MOVING | + META_GRAB_OP_WINDOW_FLAG_UNCONSTRAINED, event->any.time); } } diff --git a/src/meta/window.h b/src/meta/window.h index 20b2e8831..e799f0f57 100644 --- a/src/meta/window.h +++ b/src/meta/window.h @@ -411,7 +411,6 @@ void meta_window_get_work_area_all_monitors (MetaWindow *window, META_EXPORT gboolean meta_window_begin_grab_op (MetaWindow *window, MetaGrabOp op, - gboolean frame_action, guint32 timestamp); META_EXPORT diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c index 9500ad73b..d0e21b019 100644 --- a/src/wayland/meta-wayland-surface.c +++ b/src/wayland/meta-wayland-surface.c @@ -1559,7 +1559,6 @@ meta_wayland_surface_begin_grab_op (MetaWaylandSurface *surface, being moved/resized via a SSD event. */ return meta_window_begin_grab_op (window, grab_op, - TRUE, /* frame_action */ meta_display_get_current_time_roundtrip (window->display)); } diff --git a/src/x11/window-x11.c b/src/x11/window-x11.c index 9a04bd26b..6e9a48cb4 100644 --- a/src/x11/window-x11.c +++ b/src/x11/window-x11.c @@ -3272,13 +3272,6 @@ meta_window_x11_client_message (MetaWindow *window, int button; guint32 timestamp; - /* _NET_WM_MOVERESIZE messages are almost certainly going to come from - * clients when users click on the fake "frame" that the client has, - * thus we should also treat such messages as though it were a - * "frame action". - */ - gboolean const frame_action = TRUE; - x_root = event->xclient.data.l[0]; y_root = event->xclient.data.l[1]; action = event->xclient.data.l[2]; @@ -3342,7 +3335,7 @@ meta_window_x11_client_message (MetaWindow *window, ((window->has_move_func && op == META_GRAB_OP_KEYBOARD_MOVING) || (window->has_resize_func && op == META_GRAB_OP_KEYBOARD_RESIZING_UNKNOWN))) { - meta_window_begin_grab_op (window, op, frame_action, timestamp); + meta_window_begin_grab_op (window, op, timestamp); } else if (op != META_GRAB_OP_NONE && ((window->has_move_func && op == META_GRAB_OP_MOVING) || @@ -3356,7 +3349,6 @@ meta_window_x11_client_message (MetaWindow *window, "Beginning move/resize with button = %d", button); meta_window_begin_grab_op (window, op, - frame_action, timestamp); button_mask = query_pressed_buttons (window);