mirror of
https://github.com/brl/mutter.git
synced 2024-11-13 01:36:10 -05:00
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.
This commit is contained in:
parent
d7519f4ebc
commit
47aa583625
@ -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;
|
||||
|
||||
|
@ -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 &&
|
||||
|
@ -189,7 +189,6 @@ struct _MetaDisplay
|
||||
|
||||
/* current window operation */
|
||||
MetaGrabOp grab_op;
|
||||
MetaScreen *grab_screen;
|
||||
MetaWindow *grab_window;
|
||||
Window grab_xwindow;
|
||||
int grab_button;
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
||||
/*
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user