[mutter] window: Add some hooks for when grab ops begin / end on windows
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] window: Add some hooks for when grab ops begin / end on windows
- Date: Tue, 29 Apr 2014 21:58:55 +0000 (UTC)
commit 70713cc7db156bb90d85ca255eba2e359e17f1e5
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Tue Apr 29 15:30:21 2014 -0400
window: Add some hooks for when grab ops begin / end on windows
src/core/display.c | 18 ++++--------------
src/core/window-private.h | 3 +++
src/core/window.c | 26 ++++++++++++++++++++++++++
3 files changed, 33 insertions(+), 14 deletions(-)
---
diff --git a/src/core/display.c b/src/core/display.c
index 147cb82..adbec2c 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 aaf62bc..a7e86a2 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 048a35d..715f984 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;
+ }
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]