backend: Rename update_screen_size() to update_stage()

We don't only update the size of the screen / stage, but also regenerate
views etc. Make this a bit more obvious by renaming the function to
update_stage().

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3443>
This commit is contained in:
Jonas Ådahl 2023-11-09 13:08:44 +08:00 committed by Marge Bot
parent 08d2155b6c
commit 83e2f70f1f
5 changed files with 24 additions and 21 deletions

View File

@ -100,7 +100,7 @@ struct _MetaBackendClass
void (* lock_layout_group) (MetaBackend *backend, void (* lock_layout_group) (MetaBackend *backend,
guint idx); guint idx);
void (* update_screen_size) (MetaBackend *backend, int width, int height); void (* update_stage) (MetaBackend *backend);
void (* select_stage_events) (MetaBackend *backend); void (* select_stage_events) (MetaBackend *backend);
void (* set_pointer_constraint) (MetaBackend *backend, void (* set_pointer_constraint) (MetaBackend *backend,

View File

@ -265,14 +265,9 @@ meta_backend_destroy (MetaBackend *backend)
} }
static void static void
meta_backend_sync_screen_size (MetaBackend *backend) meta_backend_update_stage (MetaBackend *backend)
{ {
MetaBackendPrivate *priv = meta_backend_get_instance_private (backend); META_BACKEND_GET_CLASS (backend)->update_stage (backend);
int width, height;
meta_monitor_manager_get_screen_size (priv->monitor_manager, &width, &height);
META_BACKEND_GET_CLASS (backend)->update_screen_size (backend, width, height);
} }
static void static void
@ -347,7 +342,7 @@ update_cursors (MetaBackend *backend)
void void
meta_backend_monitors_changed (MetaBackend *backend) meta_backend_monitors_changed (MetaBackend *backend)
{ {
meta_backend_sync_screen_size (backend); meta_backend_update_stage (backend);
update_cursors (backend); update_cursors (backend);
} }
@ -546,7 +541,7 @@ meta_backend_real_post_init (MetaBackend *backend)
meta_monitor_manager_setup (priv->monitor_manager); meta_monitor_manager_setup (priv->monitor_manager);
meta_backend_sync_screen_size (backend); meta_backend_update_stage (backend);
priv->idle_manager = meta_idle_manager_new (backend); priv->idle_manager = meta_idle_manager_new (backend);

View File

@ -450,16 +450,19 @@ meta_backend_native_set_pointer_constraint (MetaBackend *backend,
} }
static void static void
meta_backend_native_update_screen_size (MetaBackend *backend, meta_backend_native_update_stage (MetaBackend *backend)
int width, int height)
{ {
ClutterActor *stage = meta_backend_get_stage (backend); ClutterActor *stage = meta_backend_get_stage (backend);
ClutterStageWindow *stage_window = ClutterStageWindow *stage_window =
_clutter_stage_get_window (CLUTTER_STAGE (stage)); _clutter_stage_get_window (CLUTTER_STAGE (stage));
MetaStageNative *stage_native = META_STAGE_NATIVE (stage_window); MetaStageNative *stage_native = META_STAGE_NATIVE (stage_window);
MetaMonitorManager *monitor_manager =
meta_backend_get_monitor_manager (backend);
int width, height;
meta_stage_native_rebuild_views (stage_native); meta_stage_native_rebuild_views (stage_native);
meta_monitor_manager_get_screen_size (monitor_manager, &width, &height);
clutter_actor_set_size (stage, width, height); clutter_actor_set_size (stage, width, height);
} }
@ -899,7 +902,7 @@ meta_backend_native_class_init (MetaBackendNativeClass *klass)
backend_class->get_keymap = meta_backend_native_get_keymap; backend_class->get_keymap = meta_backend_native_get_keymap;
backend_class->get_keymap_layout_group = meta_backend_native_get_keymap_layout_group; backend_class->get_keymap_layout_group = meta_backend_native_get_keymap_layout_group;
backend_class->lock_layout_group = meta_backend_native_lock_layout_group; backend_class->lock_layout_group = meta_backend_native_lock_layout_group;
backend_class->update_screen_size = meta_backend_native_update_screen_size; backend_class->update_stage = meta_backend_native_update_stage;
backend_class->set_pointer_constraint = meta_backend_native_set_pointer_constraint; backend_class->set_pointer_constraint = meta_backend_native_set_pointer_constraint;

View File

@ -183,14 +183,16 @@ meta_backend_x11_cm_get_input_settings (MetaBackend *backend)
} }
static void static void
meta_backend_x11_cm_update_screen_size (MetaBackend *backend, meta_backend_x11_cm_update_stage (MetaBackend *backend)
int width,
int height)
{ {
MetaBackendX11 *x11 = META_BACKEND_X11 (backend); MetaBackendX11 *x11 = META_BACKEND_X11 (backend);
Display *xdisplay = meta_backend_x11_get_xdisplay (x11); Display *xdisplay = meta_backend_x11_get_xdisplay (x11);
Window xwin = meta_backend_x11_get_xwindow (x11); Window xwin = meta_backend_x11_get_xwindow (x11);
MetaMonitorManager *monitor_manager =
meta_backend_get_monitor_manager (backend);
int width, height;
meta_monitor_manager_get_screen_size (monitor_manager, &width, &height);
XResizeWindow (xdisplay, xwin, width, height); XResizeWindow (xdisplay, xwin, width, height);
} }
@ -543,7 +545,7 @@ meta_backend_x11_cm_class_init (MetaBackendX11CmClass *klass)
backend_class->get_cursor_renderer = meta_backend_x11_cm_get_cursor_renderer; backend_class->get_cursor_renderer = meta_backend_x11_cm_get_cursor_renderer;
backend_class->create_cursor_tracker = meta_backend_x11_cm_create_cursor_tracker; backend_class->create_cursor_tracker = meta_backend_x11_cm_create_cursor_tracker;
backend_class->get_input_settings = meta_backend_x11_cm_get_input_settings; backend_class->get_input_settings = meta_backend_x11_cm_get_input_settings;
backend_class->update_screen_size = meta_backend_x11_cm_update_screen_size; backend_class->update_stage = meta_backend_x11_cm_update_stage;
backend_class->select_stage_events = meta_backend_x11_cm_select_stage_events; backend_class->select_stage_events = meta_backend_x11_cm_select_stage_events;
backend_class->lock_layout_group = meta_backend_x11_cm_lock_layout_group; backend_class->lock_layout_group = meta_backend_x11_cm_lock_layout_group;
backend_class->set_keymap = meta_backend_x11_cm_set_keymap; backend_class->set_keymap = meta_backend_x11_cm_set_keymap;

View File

@ -102,15 +102,18 @@ meta_backend_x11_nested_get_input_settings (MetaBackend *backend)
} }
static void static void
meta_backend_x11_nested_update_screen_size (MetaBackend *backend, meta_backend_x11_nested_update_stage (MetaBackend *backend)
int width,
int height)
{ {
ClutterActor *stage = meta_backend_get_stage (backend); ClutterActor *stage = meta_backend_get_stage (backend);
MetaRenderer *renderer = meta_backend_get_renderer (backend); MetaRenderer *renderer = meta_backend_get_renderer (backend);
MetaMonitorManager *monitor_manager =
meta_backend_get_monitor_manager (backend);
int width, height;
meta_renderer_rebuild_views (renderer); meta_renderer_rebuild_views (renderer);
clutter_stage_clear_stage_views (CLUTTER_STAGE (stage)); clutter_stage_clear_stage_views (CLUTTER_STAGE (stage));
meta_monitor_manager_get_screen_size (monitor_manager, &width, &height);
clutter_actor_set_size (stage, width, height); clutter_actor_set_size (stage, width, height);
} }
@ -320,7 +323,7 @@ meta_backend_x11_nested_class_init (MetaBackendX11NestedClass *klass)
backend_class->create_monitor_manager = meta_backend_x11_nested_create_monitor_manager; backend_class->create_monitor_manager = meta_backend_x11_nested_create_monitor_manager;
backend_class->get_cursor_renderer = meta_backend_x11_nested_get_cursor_renderer; backend_class->get_cursor_renderer = meta_backend_x11_nested_get_cursor_renderer;
backend_class->get_input_settings = meta_backend_x11_nested_get_input_settings; backend_class->get_input_settings = meta_backend_x11_nested_get_input_settings;
backend_class->update_screen_size = meta_backend_x11_nested_update_screen_size; backend_class->update_stage = meta_backend_x11_nested_update_stage;
backend_class->select_stage_events = meta_backend_x11_nested_select_stage_events; backend_class->select_stage_events = meta_backend_x11_nested_select_stage_events;
backend_class->lock_layout_group = meta_backend_x11_nested_lock_layout_group; backend_class->lock_layout_group = meta_backend_x11_nested_lock_layout_group;
backend_class->set_keymap = meta_backend_x11_nested_set_keymap; backend_class->set_keymap = meta_backend_x11_nested_set_keymap;