mirror of
https://github.com/brl/mutter.git
synced 2025-01-11 20:22:23 +00:00
window: Add some hooks for when grab ops begin / end on windows
This commit is contained in:
parent
417090f3fa
commit
70713cc7db
@ -1848,18 +1848,14 @@ meta_display_begin_grab_op (MetaDisplay *display,
|
||||
&display->grab_initial_window_pos);
|
||||
display->grab_anchor_window_pos = display->grab_initial_window_pos;
|
||||
|
||||
if (meta_grab_op_is_resizing (display->grab_op) &&
|
||||
display->grab_window->sync_request_counter != None)
|
||||
meta_window_create_sync_request_alarm (display->grab_window);
|
||||
|
||||
meta_window_refresh_resize_popup (display->grab_window);
|
||||
|
||||
if (meta_is_wayland_compositor ())
|
||||
meta_display_sync_wayland_input_focus (display);
|
||||
|
||||
g_signal_emit (display, display_signals[GRAB_OP_BEGIN], 0,
|
||||
screen, display->grab_window, display->grab_op);
|
||||
|
||||
meta_window_grab_op_began (display->grab_window, display->grab_op);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -1878,13 +1874,13 @@ meta_display_end_grab_op (MetaDisplay *display,
|
||||
g_signal_emit (display, display_signals[GRAB_OP_END], 0,
|
||||
display->screen, display->grab_window, display->grab_op);
|
||||
|
||||
meta_window_grab_op_ended (display->grab_window, display->grab_op);
|
||||
|
||||
if (meta_grab_op_is_moving_or_resizing (display->grab_op))
|
||||
{
|
||||
/* Clear out the edge cache */
|
||||
meta_display_cleanup_edges (display);
|
||||
|
||||
display->grab_window->shaken_loose = FALSE;
|
||||
|
||||
/* Only raise the window in orthogonal raise
|
||||
* ('do-not-raise-on-click') mode if the user didn't try to move
|
||||
* or resize the given window by at least a threshold amount.
|
||||
@ -1918,12 +1914,6 @@ meta_display_end_grab_op (MetaDisplay *display,
|
||||
display->grab_tile_monitor_number = -1;
|
||||
display->grab_op = META_GRAB_OP_NONE;
|
||||
|
||||
if (display->grab_resize_popup)
|
||||
{
|
||||
meta_ui_resize_popup_free (display->grab_resize_popup);
|
||||
display->grab_resize_popup = NULL;
|
||||
}
|
||||
|
||||
if (display->grab_resize_timeout_id)
|
||||
{
|
||||
g_source_remove (display->grab_resize_timeout_id);
|
||||
|
@ -752,4 +752,7 @@ void meta_window_move_resize_internal (MetaWindow *window,
|
||||
int h);
|
||||
void meta_window_save_user_window_placement (MetaWindow *window);
|
||||
|
||||
void meta_window_grab_op_began (MetaWindow *window, MetaGrabOp op);
|
||||
void meta_window_grab_op_ended (MetaWindow *window, MetaGrabOp op);
|
||||
|
||||
#endif
|
||||
|
@ -8942,3 +8942,29 @@ meta_window_set_urgent (MetaWindow *window,
|
||||
if (urgent)
|
||||
g_signal_emit_by_name (window->display, "window-marked-urgent", window);
|
||||
}
|
||||
|
||||
void
|
||||
meta_window_grab_op_began (MetaWindow *window,
|
||||
MetaGrabOp op)
|
||||
{
|
||||
if (meta_grab_op_is_resizing (op) &&
|
||||
window->sync_request_counter != None)
|
||||
meta_window_create_sync_request_alarm (window);
|
||||
|
||||
meta_window_refresh_resize_popup (window);
|
||||
}
|
||||
|
||||
void
|
||||
meta_window_grab_op_ended (MetaWindow *window,
|
||||
MetaGrabOp op)
|
||||
{
|
||||
MetaDisplay *display = window->display;
|
||||
|
||||
window->shaken_loose = FALSE;
|
||||
|
||||
if (display->grab_resize_popup)
|
||||
{
|
||||
meta_ui_resize_popup_free (display->grab_resize_popup);
|
||||
display->grab_resize_popup = NULL;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user