[mutter/wayland] display: Kill off grab_screen



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

    display: Kill off grab_screen
    
    Just like active_screen, the screen can always be inferred
    from the MetaDisplay, so there's no point in keeping it around.

 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 9f30b7e..897940d 100644
--- a/src/compositor/compositor.c
+++ b/src/compositor/compositor.c
@@ -431,7 +431,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;
 
@@ -453,7 +452,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 c189756..a091bb8 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 1a78402..1b8355c 100644
--- a/src/core/display-private.h
+++ b/src/core/display-private.h
@@ -189,7 +189,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 372bb1e..b40b76a 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -562,7 +562,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;
@@ -1977,7 +1976,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;
@@ -2030,7 +2028,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)
@@ -2058,7 +2056,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;
@@ -2110,14 +2108,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 32c1eca..2d82b16 100644
--- a/src/core/keybindings.c
+++ b/src/core/keybindings.c
@@ -1872,8 +1872,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]