Move rest of non-X11 specific objects from MetaScreen

This moves following objects from MetaScreen to MetaDisplay

- workareas_later and in_fullscreen_later signals and functions
- startup_sequences signals and functions
- tile_preview functions

https://bugzilla.gnome.org/show_bug.cgi?id=759538
This commit is contained in:
Armin Krezović
2017-08-26 21:10:38 +02:00
committed by Jonas Ådahl
parent 1530f27513
commit 68f261e8e2
12 changed files with 534 additions and 543 deletions

View File

@@ -900,10 +900,10 @@ meta_window_main_monitor_changed (MetaWindow *window,
META_WINDOW_GET_CLASS (window)->main_monitor_changed (window, old);
if (old)
g_signal_emit_by_name (window->screen, "window-left-monitor",
g_signal_emit_by_name (window->display, "window-left-monitor",
old->number, window);
if (window->monitor)
g_signal_emit_by_name (window->screen, "window-entered-monitor",
g_signal_emit_by_name (window->display, "window-entered-monitor",
window->monitor->number, window);
}
@@ -1171,7 +1171,7 @@ _meta_window_shared_new (MetaDisplay *display,
/* Apply any window attributes such as initial workspace
* based on startup notification
*/
meta_screen_apply_startup_properties (window->screen, window);
meta_display_apply_startup_properties (window->display, window);
/* Try to get a "launch timestamp" for the window. If the window is
* a transient, we'd like to be able to get a last-usage timestamp
@@ -1551,7 +1551,7 @@ meta_window_unmanage (MetaWindow *window,
META_WINDOW_GET_CLASS (window)->unmanage (window);
meta_prefs_remove_listener (prefs_changed_callback, window);
meta_screen_queue_check_fullscreen (window->screen);
meta_display_queue_check_fullscreen (window->display);
g_signal_emit (window, window_signals[UNMANAGED], 0);
@@ -2533,7 +2533,7 @@ meta_window_show (MetaWindow *window)
}
if (did_show)
meta_screen_queue_check_fullscreen (window->screen);
meta_display_queue_check_fullscreen (window->display);
#ifdef HAVE_WAYLAND
if (did_show && window->client_type == META_WINDOW_CLIENT_TYPE_WAYLAND)
@@ -2640,7 +2640,7 @@ meta_window_hide (MetaWindow *window)
}
if (did_hide)
meta_screen_queue_check_fullscreen (window->screen);
meta_display_queue_check_fullscreen (window->display);
}
static gboolean
@@ -2792,7 +2792,7 @@ meta_window_maximize_internal (MetaWindow *window,
set_net_wm_state (window);
if (window->monitor->in_fullscreen)
meta_screen_queue_check_fullscreen (window->screen);
meta_display_queue_check_fullscreen (window->display);
g_object_freeze_notify (G_OBJECT (window));
g_object_notify_by_pspec (G_OBJECT (window), obj_props[PROP_MAXIMIZED_HORIZONTALLY]);
@@ -3121,7 +3121,7 @@ meta_window_tile (MetaWindow *window,
directions = META_MAXIMIZE_VERTICAL;
meta_window_maximize_internal (window, directions, NULL);
meta_screen_update_tile_preview (window->screen, FALSE);
meta_display_update_tile_preview (window->display, FALSE);
/* Setup the edge constraints */
update_edge_constraints (window);
@@ -3348,7 +3348,7 @@ meta_window_unmaximize (MetaWindow *window,
meta_window_recalc_features (window);
set_net_wm_state (window);
if (!window->monitor->in_fullscreen)
meta_screen_queue_check_fullscreen (window->screen);
meta_display_queue_check_fullscreen (window->display);
}
g_object_freeze_notify (G_OBJECT (window));
@@ -3421,7 +3421,7 @@ meta_window_make_fullscreen_internal (MetaWindow *window)
set_net_wm_state (window);
/* For the auto-minimize feature, if we fail to get focus */
meta_screen_queue_check_fullscreen (window->screen);
meta_display_queue_check_fullscreen (window->display);
g_object_notify_by_pspec (G_OBJECT (window), obj_props[PROP_FULLSCREEN]);
}
@@ -3495,7 +3495,7 @@ meta_window_unmake_fullscreen (MetaWindow *window)
NorthWestGravity,
target_rect);
meta_screen_queue_check_fullscreen (window->screen);
meta_display_queue_check_fullscreen (window->display);
g_object_notify_by_pspec (G_OBJECT (window), obj_props[PROP_FULLSCREEN]);
}
@@ -4165,7 +4165,7 @@ meta_window_move_to_monitor (MetaWindow *window,
window->preferred_output_winsys_id = window->monitor->winsys_id;
if (window->fullscreen || window->override_redirect)
meta_screen_queue_check_fullscreen (window->screen);
meta_display_queue_check_fullscreen (window->display);
}
static void
@@ -5914,7 +5914,7 @@ update_move_maybe_tile (MetaWindow *window,
MetaMonitorManager *monitor_manager =
meta_backend_get_monitor_manager (backend);
MetaLogicalMonitor *logical_monitor;
MetaScreen *screen = window->screen;
MetaDisplay *display = window->display;
MetaRectangle work_area;
/* For side-by-side tiling we are interested in the inside vertical
@@ -5944,18 +5944,18 @@ update_move_maybe_tile (MetaWindow *window,
*/
if (meta_window_can_tile_side_by_side (window) &&
x >= logical_monitor->rect.x && x < (work_area.x + shake_threshold))
screen->preview_tile_mode = META_TILE_LEFT;
display->preview_tile_mode = META_TILE_LEFT;
else if (meta_window_can_tile_side_by_side (window) &&
x >= work_area.x + work_area.width - shake_threshold &&
x < (logical_monitor->rect.x + logical_monitor->rect.width))
screen->preview_tile_mode = META_TILE_RIGHT;
display->preview_tile_mode = META_TILE_RIGHT;
else if (meta_window_can_tile_maximized (window) &&
y >= logical_monitor->rect.y && y <= work_area.y)
screen->preview_tile_mode = META_TILE_MAXIMIZED;
display->preview_tile_mode = META_TILE_MAXIMIZED;
else
screen->preview_tile_mode = META_TILE_NONE;
display->preview_tile_mode = META_TILE_NONE;
if (screen->preview_tile_mode != META_TILE_NONE)
if (display->preview_tile_mode != META_TILE_NONE)
window->tile_monitor_number = logical_monitor->number;
}
@@ -5970,7 +5970,6 @@ update_move (MetaWindow *window,
MetaRectangle old;
int shake_threshold;
MetaDisplay *display = window->display;
MetaScreen *screen = window->screen;
display->grab_latest_motion_x = x;
display->grab_latest_motion_y = y;
@@ -6008,7 +6007,7 @@ update_move (MetaWindow *window,
{
/* We don't want to tile while snapping. Also, clear any previous tile
request. */
screen->preview_tile_mode = META_TILE_NONE;
display->preview_tile_mode = META_TILE_NONE;
window->tile_monitor_number = -1;
}
else if (meta_prefs_get_edge_tiling () &&
@@ -6124,8 +6123,8 @@ update_move (MetaWindow *window,
* trigger it unwittingly, e.g. when shaking loose the window or moving
* it to another monitor.
*/
meta_screen_update_tile_preview (screen,
screen->preview_tile_mode != META_TILE_NONE);
meta_display_update_tile_preview (window->display,
window->tile_mode != META_TILE_NONE);
meta_window_get_frame_rect (window, &old);
@@ -6339,8 +6338,8 @@ end_grab_op (MetaWindow *window,
{
if (meta_grab_op_is_moving (window->display->grab_op))
{
if (window->screen->preview_tile_mode != META_TILE_NONE)
meta_window_tile (window, window->screen->preview_tile_mode);
if (window->display->preview_tile_mode != META_TILE_NONE)
meta_window_tile (window, window->display->preview_tile_mode);
else
update_move (window,
modifiers & CLUTTER_SHIFT_MASK,
@@ -6355,7 +6354,7 @@ end_grab_op (MetaWindow *window,
maybe_maximize_tiled_window (window);
}
}
window->screen->preview_tile_mode = META_TILE_NONE;
window->display->preview_tile_mode = META_TILE_NONE;
meta_display_end_grab_op (window->display, clutter_event_get_time (event));
}