backends: Make clutter stage resizing more explicit

The stage resizing was placed in the generic backend, which was only
run on certain configurations (when running nested or using the native
backend). This commits makes the resizing more explicit thus more
obvious.

https://bugzilla.gnome.org/show_bug.cgi?id=768976
This commit is contained in:
Jonas Ådahl 2016-05-20 15:36:05 +08:00
parent 085df1170e
commit 55726e787b
3 changed files with 13 additions and 14 deletions

View File

@ -346,15 +346,6 @@ meta_backend_real_ungrab_device (MetaBackend *backend,
return TRUE; return TRUE;
} }
static void
meta_backend_real_update_screen_size (MetaBackend *backend,
int width, int height)
{
MetaBackendPrivate *priv = meta_backend_get_instance_private (backend);
clutter_actor_set_size (priv->stage, width, height);
}
static void static void
meta_backend_real_select_stage_events (MetaBackend *backend) meta_backend_real_select_stage_events (MetaBackend *backend)
{ {
@ -393,7 +384,6 @@ meta_backend_class_init (MetaBackendClass *klass)
klass->create_cursor_renderer = meta_backend_real_create_cursor_renderer; klass->create_cursor_renderer = meta_backend_real_create_cursor_renderer;
klass->grab_device = meta_backend_real_grab_device; klass->grab_device = meta_backend_real_grab_device;
klass->ungrab_device = meta_backend_real_ungrab_device; klass->ungrab_device = meta_backend_real_ungrab_device;
klass->update_screen_size = meta_backend_real_update_screen_size;
klass->select_stage_events = meta_backend_real_select_stage_events; klass->select_stage_events = meta_backend_real_select_stage_events;
klass->get_relative_motion_deltas = meta_backend_real_get_relative_motion_deltas; klass->get_relative_motion_deltas = meta_backend_real_get_relative_motion_deltas;

View File

@ -379,6 +379,15 @@ meta_backend_native_get_relative_motion_deltas (MetaBackend *backend,
dx_unaccel, dy_unaccel); dx_unaccel, dy_unaccel);
} }
static void
meta_backend_native_update_screen_size (MetaBackend *backend,
int width, int height)
{
ClutterActor *stage = meta_backend_get_stage (backend);
clutter_actor_set_size (stage, width, height);
}
static void static void
meta_backend_native_class_init (MetaBackendNativeClass *klass) meta_backend_native_class_init (MetaBackendNativeClass *klass)
{ {
@ -401,6 +410,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->lock_layout_group = meta_backend_native_lock_layout_group; backend_class->lock_layout_group = meta_backend_native_lock_layout_group;
backend_class->get_relative_motion_deltas = meta_backend_native_get_relative_motion_deltas; backend_class->get_relative_motion_deltas = meta_backend_native_get_relative_motion_deltas;
backend_class->update_screen_size = meta_backend_native_update_screen_size;
} }
static void static void

View File

@ -813,10 +813,9 @@ meta_backend_x11_update_screen_size (MetaBackend *backend,
if (priv->mode == META_BACKEND_X11_MODE_NESTED) if (priv->mode == META_BACKEND_X11_MODE_NESTED)
{ {
/* For a nested wayland session, we want to go through Clutter to update the ClutterActor *stage = meta_backend_get_stage (backend);
* toplevel window size, rather than doing it directly.
*/ clutter_actor_set_size (stage, width, height);
META_BACKEND_CLASS (meta_backend_x11_parent_class)->update_screen_size (backend, width, height);
} }
else else
{ {