[mutter/wip/no-zaphod: 2/3] Kill off grab_screen



commit 28b81310976661dbeca5b444e7e182b17cc23d7c
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Tue Mar 18 17:57:53 2014 -0400

    Kill off grab_screen

 src/compositor/compositor.c |    2 --
 src/core/core.c             |    4 ----
 src/core/display-private.h  |    1 -
 src/core/display.c          |   11 ++++-------
 src/core/edge-resistance.c  |   13 ++++++-------
 src/core/keybindings.c      |    3 +--
 6 files changed, 11 insertions(+), 23 deletions(-)
---
diff --git a/src/compositor/compositor.c b/src/compositor/compositor.c
index b2e339a..0302744 100644
--- a/src/compositor/compositor.c
+++ b/src/compositor/compositor.c
@@ -437,7 +437,6 @@ meta_begin_modal_for_plugin (MetaScreen       *screen,
 
   display->grab_op = META_GRAB_OP_COMPOSITOR;
   display->grab_window = NULL;
-  display->grab_screen = screen;
   display->grab_have_pointer = TRUE;
   display->grab_have_keyboard = TRUE;
 
@@ -462,7 +461,6 @@ meta_end_modal_for_plugin (MetaScreen     *screen,
 
   display->grab_op = META_GRAB_OP_NONE;
   display->grab_window = NULL;
-  display->grab_screen = NULL;
   display->grab_have_pointer = FALSE;
   display->grab_have_keyboard = FALSE;
 }
diff --git a/src/core/core.c b/src/core/core.c
index 506b57e..182a5c9 100644
--- a/src/core/core.c
+++ b/src/core/core.c
@@ -667,10 +667,6 @@ meta_core_get_grab_frame (Display *xdisplay)
   display = meta_display_for_x_display (xdisplay);
 
   g_assert (display != NULL);
-  g_assert (display->grab_op == META_GRAB_OP_NONE || 
-            display->grab_screen != NULL);
-  g_assert (display->grab_op == META_GRAB_OP_NONE ||
-            display->grab_screen->display->xdisplay == xdisplay);
   
   if (display->grab_op != META_GRAB_OP_NONE &&
       display->grab_window &&
diff --git a/src/core/display-private.h b/src/core/display-private.h
index a083f32..2dbd830 100644
--- a/src/core/display-private.h
+++ b/src/core/display-private.h
@@ -191,7 +191,6 @@ struct _MetaDisplay
   
   /* current window operation */
   MetaGrabOp  grab_op;
-  MetaScreen *grab_screen;
   MetaWindow *grab_window;
   Window      grab_xwindow;
   int         grab_button;
diff --git a/src/core/display.c b/src/core/display.c
index 8a6d4b0..551c3b2 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -600,7 +600,6 @@ meta_display_open (void)
 
   the_display->grab_op = META_GRAB_OP_NONE;
   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_tile_monitor_number = -1;
@@ -3848,7 +3847,6 @@ meta_display_begin_grab_op (MetaDisplay *display,
   
   display->grab_op = op;
   display->grab_window = grab_window;
-  display->grab_screen = screen;
   display->grab_xwindow = grab_xwindow;
   display->grab_button = button;
   display->grab_mask = modmask;
@@ -3901,7 +3899,7 @@ meta_display_begin_grab_op (MetaDisplay *display,
               "Grab op %u on window %s successful\n",
               display->grab_op, window ? window->desc : "(null)");
 
-  g_assert (display->grab_window != NULL || display->grab_screen != NULL);
+  g_assert (display->grab_window != NULL);
   g_assert (display->grab_op != META_GRAB_OP_NONE);
 
   if (display->grab_window)
@@ -3926,7 +3924,7 @@ meta_display_end_grab_op (MetaDisplay *display,
     return;
 
   g_signal_emit (display, display_signals[GRAB_OP_END], 0,
-                 display->grab_screen, display->grab_window, display->grab_op);
+                 display->screen, display->grab_window, display->grab_op);
 
   if (display->grab_window != NULL)
     display->grab_window->shaken_loose = FALSE;
@@ -3978,14 +3976,13 @@ meta_display_end_grab_op (MetaDisplay *display,
       if (display->grab_window)
         meta_window_ungrab_all_keys (display->grab_window, timestamp);
       else
-        meta_screen_ungrab_all_keys (display->grab_screen, timestamp);
+        meta_screen_ungrab_all_keys (display->screen, timestamp);
     }
 
-  meta_cursor_tracker_set_grab_cursor (display->grab_screen->cursor_tracker, META_CURSOR_DEFAULT);
+  meta_cursor_tracker_set_grab_cursor (display->screen->cursor_tracker, META_CURSOR_DEFAULT);
 
   display->grab_timestamp = 0;
   display->grab_window = NULL;
-  display->grab_screen = NULL;
   display->grab_xwindow = None;
   display->grab_tile_mode = META_TILE_NONE;
   display->grab_tile_monitor_number = -1;
diff --git a/src/core/edge-resistance.c b/src/core/edge-resistance.c
index 6a2648a..8eb48a7 100644
--- a/src/core/edge-resistance.c
+++ b/src/core/edge-resistance.c
@@ -30,7 +30,6 @@
  */
 #define WINDOW_EDGES_RELEVANT(window, display) \
   meta_window_should_be_showing (window) &&    \
-  window->screen == display->grab_screen &&    \
   window         != display->grab_window &&    \
   window->type   != META_WINDOW_DESKTOP &&     \
   window->type   != META_WINDOW_MENU    &&     \
@@ -963,9 +962,9 @@ compute_resistance_and_snapping_edges (MetaDisplay *display)
   /*
    * 1st: Get the list of relevant windows, from bottom to top
    */
-  stacked_windows = 
-    meta_stack_list_windows (display->grab_screen->stack,
-                             display->grab_screen->active_workspace);
+  stacked_windows =
+    meta_stack_list_windows (display->screen->stack,
+                             display->screen->active_workspace);
 
   /*
    * 2nd: we need to separate that stacked list into a list of windows that
@@ -1026,7 +1025,7 @@ compute_resistance_and_snapping_edges (MetaDisplay *display)
            * by other windows or DOCKS, but that's handled below).
            */
           meta_rectangle_intersect (&cur_rect, 
-                                    &display->grab_screen->rect,
+                                    &display->screen->rect,
                                     &reduced);
 
           new_edges = NULL;
@@ -1123,8 +1122,8 @@ compute_resistance_and_snapping_edges (MetaDisplay *display)
    */
   cache_edges (display,
                edges,
-               display->grab_screen->active_workspace->monitor_edges,
-               display->grab_screen->active_workspace->screen_edges);
+               display->screen->active_workspace->monitor_edges,
+               display->screen->active_workspace->screen_edges);
   g_list_free (edges);
 
   /*
diff --git a/src/core/keybindings.c b/src/core/keybindings.c
index 6e766f4..74b3b22 100644
--- a/src/core/keybindings.c
+++ b/src/core/keybindings.c
@@ -1866,8 +1866,7 @@ meta_display_process_key_event (MetaDisplay     *display,
        * we're in some special keyboard mode such as window move
        * mode.
        */
-      if (window ? (window == display->grab_window) :
-          (screen == display->grab_screen))
+      if ((window && window == display->grab_window) || !window)
         {
           switch (display->grab_op)
             {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]