diff --git a/src/wayland/meta-wayland-stage.c b/src/wayland/meta-wayland-stage.c index f7d28d419..66f7f29a1 100644 --- a/src/wayland/meta-wayland-stage.c +++ b/src/wayland/meta-wayland-stage.c @@ -55,6 +55,7 @@ meta_wayland_stage_class_init (MetaWaylandStageClass *klass) static void meta_wayland_stage_init (MetaWaylandStage *self) { + clutter_stage_set_user_resizable (CLUTTER_STAGE (self), FALSE); } ClutterActor * @@ -64,3 +65,22 @@ meta_wayland_stage_new (void) "cursor-visible", FALSE, NULL); } + +void +meta_wayland_stage_apply_monitor_config (MetaWaylandStage *stage) +{ + MetaMonitorManager *manager; + MetaMonitorInfo *infos; + int n_infos; + + manager = meta_monitor_manager_get (); + infos = meta_monitor_manager_get_monitor_infos (manager, &n_infos); + + g_assert (n_infos == 1); + + /* FIXME: when we support a sliced stage, this is the place to do it + But! This is not the place to apply KMS config, here we only + notify Clutter/Cogl/GL that the framebuffer sizes changed */ + clutter_actor_set_size (CLUTTER_ACTOR (stage), + infos[0].rect.width, infos[0].rect.height); +} diff --git a/src/wayland/meta-wayland-stage.h b/src/wayland/meta-wayland-stage.h index c242fbd60..fae7cc7a0 100644 --- a/src/wayland/meta-wayland-stage.h +++ b/src/wayland/meta-wayland-stage.h @@ -65,6 +65,8 @@ GType meta_wayland_stage_get_type (void) G_GNUC_CONST ClutterActor *meta_wayland_stage_new (void); +void meta_wayland_stage_apply_monitor_config (MetaWaylandStage *self); + G_END_DECLS #endif /* META_WAYLAND_STAGE_H */ diff --git a/src/wayland/meta-wayland.c b/src/wayland/meta-wayland.c index 99fd4b302..c13224ea2 100644 --- a/src/wayland/meta-wayland.c +++ b/src/wayland/meta-wayland.c @@ -1424,6 +1424,7 @@ on_monitors_changed (MetaMonitorManager *monitors, { g_list_free_full (compositor->outputs, (GDestroyNotify) wl_global_destroy); meta_wayland_compositor_create_outputs (compositor, monitors); + meta_wayland_stage_apply_monitor_config (META_WAYLAND_STAGE (compositor->stage)); } void @@ -1532,21 +1533,20 @@ meta_wayland_init (void) dup2 (fd, STDIN_FILENO); } - compositor->stage = meta_wayland_stage_new (); - /* FIXME */ - clutter_actor_set_size (CLUTTER_ACTOR (compositor->stage), 1024, 768); - clutter_stage_set_user_resizable (CLUTTER_STAGE (compositor->stage), FALSE); - g_signal_connect_after (compositor->stage, "paint", - G_CALLBACK (paint_finished_cb), compositor); - g_signal_connect (compositor->stage, "destroy", - G_CALLBACK (stage_destroy_cb), NULL); - meta_monitor_manager_initialize (NULL); monitors = meta_monitor_manager_get (); g_signal_connect (monitors, "monitors-changed", G_CALLBACK (on_monitors_changed), compositor); meta_wayland_compositor_create_outputs (compositor, monitors); + compositor->stage = meta_wayland_stage_new (); + meta_wayland_stage_apply_monitor_config (META_WAYLAND_STAGE (compositor->stage)); + + g_signal_connect_after (compositor->stage, "paint", + G_CALLBACK (paint_finished_cb), compositor); + g_signal_connect (compositor->stage, "destroy", + G_CALLBACK (stage_destroy_cb), NULL); + meta_wayland_data_device_manager_init (compositor->wayland_display); compositor->seat = meta_wayland_seat_new (compositor->wayland_display,