From 286160646bc711dba85171059c28c4d49803cc85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 19 Jan 2011 17:00:18 +0100 Subject: [PATCH] display: Keep track of the original tile state during drag Drag operations may be cancelled, in which case the dragged window should be restored to the position/state it had when the drag was initialized. In order to do this for tiled states, the original state has to be saved during the operation. https://bugzilla.gnome.org/show_bug.cgi?id=639988 --- src/core/display-private.h | 8 ++++++++ src/core/display.c | 3 +++ src/core/window-private.h | 7 ------- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/core/display-private.h b/src/core/display-private.h index faa803ead..a233b4d63 100644 --- a/src/core/display-private.h +++ b/src/core/display-private.h @@ -77,6 +77,13 @@ typedef enum { */ #define N_IGNORED_SERIALS 4 +typedef enum { + META_TILE_NONE, + META_TILE_LEFT, + META_TILE_RIGHT, + META_TILE_MAXIMIZED +} MetaTileMode; + struct _MetaDisplay { GObject parent_instance; @@ -179,6 +186,7 @@ struct _MetaDisplay int grab_anchor_root_x; int grab_anchor_root_y; MetaRectangle grab_anchor_window_pos; + MetaTileMode grab_tile_mode; int grab_latest_motion_x; int grab_latest_motion_y; gulong grab_mask; diff --git a/src/core/display.c b/src/core/display.c index e3de96327..bb13adde7 100644 --- a/src/core/display.c +++ b/src/core/display.c @@ -553,6 +553,7 @@ meta_display_open (void) the_display->grab_window = NULL; the_display->grab_screen = NULL; the_display->grab_resize_popup = NULL; + the_display->grab_tile_mode = META_TILE_NONE; the_display->grab_edge_resistance_data = NULL; @@ -3580,6 +3581,7 @@ meta_display_begin_grab_op (MetaDisplay *display, display->grab_xwindow = grab_xwindow; display->grab_button = button; display->grab_mask = modmask; + display->grab_tile_mode = window->tile_mode; display->grab_anchor_root_x = root_x; display->grab_anchor_root_y = root_y; display->grab_latest_motion_x = root_x; @@ -3776,6 +3778,7 @@ meta_display_end_grab_op (MetaDisplay *display, display->grab_window = NULL; display->grab_screen = NULL; display->grab_xwindow = None; + display->grab_tile_mode = META_TILE_NONE; display->grab_op = META_GRAB_OP_NONE; if (display->grab_resize_popup) diff --git a/src/core/window-private.h b/src/core/window-private.h index dcb070cc7..6538db86a 100644 --- a/src/core/window-private.h +++ b/src/core/window-private.h @@ -61,13 +61,6 @@ typedef enum { #define NUMBER_OF_QUEUES 3 -typedef enum { - META_TILE_NONE, - META_TILE_LEFT, - META_TILE_RIGHT, - META_TILE_MAXIMIZED -} MetaTileMode; - struct _MetaWindow { GObject parent_instance;