mirror of
https://github.com/brl/mutter.git
synced 2024-11-30 03:50:47 -05:00
core: Drop unused arguments to meta_display_grab_op()
Now that it is called from a single place, there's a few arguments that are unnecessary: - button and modifiers are unused - already_grabbed was originally added to handle grab transitions between window menus (GtkMenus, back in the day) with display grabs. It's no longer necessary now - frame_action can be passed through the META_GRAB_OP_WINDOW_FLAG UNCONSTRAINED flag Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2683>
This commit is contained in:
parent
57e56ee866
commit
f62200a17b
@ -162,7 +162,6 @@ struct _MetaDisplay
|
||||
/* current window operation */
|
||||
MetaGrabOp grab_op;
|
||||
MetaWindow *grab_window;
|
||||
int grab_button;
|
||||
int grab_anchor_root_x;
|
||||
int grab_anchor_root_y;
|
||||
MetaRectangle grab_anchor_window_pos;
|
||||
@ -427,10 +426,6 @@ void meta_display_flush_queued_window (MetaDisplay *display,
|
||||
gboolean meta_display_begin_grab_op (MetaDisplay *display,
|
||||
MetaWindow *window,
|
||||
MetaGrabOp op,
|
||||
gboolean pointer_already_grabbed,
|
||||
gboolean frame_action,
|
||||
int button,
|
||||
gulong modmask,
|
||||
uint32_t timestamp,
|
||||
int root_x,
|
||||
int root_y);
|
||||
|
@ -1855,10 +1855,6 @@ gboolean
|
||||
meta_display_begin_grab_op (MetaDisplay *display,
|
||||
MetaWindow *window,
|
||||
MetaGrabOp op,
|
||||
gboolean pointer_already_grabbed,
|
||||
gboolean frame_action,
|
||||
int button,
|
||||
gulong modmask, /* XXX - ignored */
|
||||
guint32 timestamp,
|
||||
int root_x,
|
||||
int root_y)
|
||||
@ -1870,8 +1866,8 @@ meta_display_begin_grab_op (MetaDisplay *display,
|
||||
g_assert (window != NULL);
|
||||
|
||||
meta_topic (META_DEBUG_WINDOW_OPS,
|
||||
"Doing grab op %u on window %s button %d pointer already grabbed: %d pointer pos %d,%d",
|
||||
op, window->desc, button, pointer_already_grabbed,
|
||||
"Doing grab op %u on window %s pointer pos %d,%d",
|
||||
op, window->desc,
|
||||
root_x, root_y);
|
||||
|
||||
if (display->grab_op != META_GRAB_OP_NONE)
|
||||
@ -1882,9 +1878,6 @@ meta_display_begin_grab_op (MetaDisplay *display,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!frame_action)
|
||||
op |= META_GRAB_OP_WINDOW_FLAG_UNCONSTRAINED;
|
||||
|
||||
event_route = get_event_route_from_grab_op (op);
|
||||
|
||||
if (event_route == META_EVENT_ROUTE_WINDOW_OP)
|
||||
@ -1912,9 +1905,6 @@ meta_display_begin_grab_op (MetaDisplay *display,
|
||||
|
||||
display->grab_have_pointer = FALSE;
|
||||
|
||||
if (pointer_already_grabbed)
|
||||
display->grab_have_pointer = TRUE;
|
||||
|
||||
if (META_IS_BACKEND_X11 (backend_from_display (display)) &&
|
||||
display->x11_display)
|
||||
{
|
||||
@ -1954,7 +1944,6 @@ meta_display_begin_grab_op (MetaDisplay *display,
|
||||
display->event_route = event_route;
|
||||
display->grab_op = op;
|
||||
display->grab_window = grab_window;
|
||||
display->grab_button = button;
|
||||
display->grab_tile_mode = grab_window->tile_mode;
|
||||
display->grab_tile_monitor_number = grab_window->tile_monitor_number;
|
||||
display->grab_anchor_root_x = root_x;
|
||||
@ -2043,7 +2032,6 @@ meta_display_end_grab_op (MetaDisplay *display,
|
||||
|
||||
display->event_route = META_EVENT_ROUTE_NORMAL;
|
||||
display->grab_window = NULL;
|
||||
display->grab_button = 0;
|
||||
display->grab_tile_mode = META_TILE_NONE;
|
||||
display->grab_tile_monitor_number = -1;
|
||||
display->grab_anchor_root_x = 0;
|
||||
|
@ -6756,13 +6756,12 @@ 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,
|
||||
FALSE,
|
||||
frame_action,
|
||||
0 /* button */,
|
||||
0,
|
||||
timestamp,
|
||||
x, y);
|
||||
}
|
||||
|
@ -3373,11 +3373,8 @@ meta_window_x11_client_message (MetaWindow *window,
|
||||
else if ((button_mask & (1 << 3)) != 0)
|
||||
button = 3;
|
||||
|
||||
if (button != 0)
|
||||
window->display->grab_button = button;
|
||||
else
|
||||
meta_display_end_grab_op (window->display,
|
||||
timestamp);
|
||||
if (button == 0)
|
||||
meta_display_end_grab_op (window->display, timestamp);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user