diff --git a/src/core/display.c b/src/core/display.c index 147cb82b7..adbec2c56 100644 --- a/src/core/display.c +++ b/src/core/display.c @@ -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); diff --git a/src/core/window-private.h b/src/core/window-private.h index aaf62bcef..a7e86a26e 100644 --- a/src/core/window-private.h +++ b/src/core/window-private.h @@ -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 diff --git a/src/core/window.c b/src/core/window.c index 048a35d10..715f984e2 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -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; + } +}