mirror of
https://github.com/brl/mutter.git
synced 2024-11-28 19:10:43 -05:00
Remove duplicate path for resizing clutter stage
Handle it in meta_compositor_sync_stage_size(), like we do under X11.
This commit is contained in:
parent
1e3aad2d8c
commit
49a83138f4
@ -624,7 +624,7 @@ meta_compositor_manage_screen (MetaCompositor *compositor,
|
|||||||
MetaCompScreen *info;
|
MetaCompScreen *info;
|
||||||
MetaDisplay *display = meta_screen_get_display (screen);
|
MetaDisplay *display = meta_screen_get_display (screen);
|
||||||
Display *xdisplay = meta_display_get_xdisplay (display);
|
Display *xdisplay = meta_display_get_xdisplay (display);
|
||||||
Window xwin;
|
Window xwin = None;
|
||||||
gint width, height;
|
gint width, height;
|
||||||
#ifdef HAVE_WAYLAND
|
#ifdef HAVE_WAYLAND
|
||||||
MetaWaylandCompositor *wayland_compositor;
|
MetaWaylandCompositor *wayland_compositor;
|
||||||
@ -666,6 +666,9 @@ meta_compositor_manage_screen (MetaCompositor *compositor,
|
|||||||
{
|
{
|
||||||
wayland_compositor = meta_wayland_compositor_get_default ();
|
wayland_compositor = meta_wayland_compositor_get_default ();
|
||||||
info->stage = wayland_compositor->stage;
|
info->stage = wayland_compositor->stage;
|
||||||
|
|
||||||
|
meta_screen_get_size (screen, &width, &height);
|
||||||
|
clutter_actor_set_size (info->stage, width, height);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif /* HAVE_WAYLAND */
|
#endif /* HAVE_WAYLAND */
|
||||||
@ -767,6 +770,8 @@ meta_compositor_manage_screen (MetaCompositor *compositor,
|
|||||||
|
|
||||||
redirect_windows (compositor, screen);
|
redirect_windows (compositor, screen);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
clutter_actor_show (info->stage);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -1415,18 +1420,25 @@ meta_compositor_sync_screen_size (MetaCompositor *compositor,
|
|||||||
guint width,
|
guint width,
|
||||||
guint height)
|
guint height)
|
||||||
{
|
{
|
||||||
|
MetaCompScreen *info = meta_screen_get_compositor_data (screen);
|
||||||
|
|
||||||
if (meta_is_wayland_compositor ())
|
if (meta_is_wayland_compositor ())
|
||||||
{
|
{
|
||||||
/* It's not clear at the moment how we will be dealing with screen
|
/* FIXME: when we support a sliced stage, this is the place to do it
|
||||||
* resizing as a Wayland compositor so for now just abort if we
|
But! This is not the place to apply KMS config, here we only
|
||||||
* hit this code. */
|
notify Clutter/Cogl/GL that the framebuffer sizes changed.
|
||||||
g_critical ("Unexpected call to meta_compositor_sync_screen_size() "
|
|
||||||
"when running as a wayland compositor");
|
And because for now clutter does not do sliced, we use one
|
||||||
|
framebuffer the size of the whole screen, and when running on
|
||||||
|
bare metal MetaMonitorManager will do the necessary tricks to
|
||||||
|
show the right portions on the right screens.
|
||||||
|
*/
|
||||||
|
|
||||||
|
clutter_actor_set_size (info->stage, width, height);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MetaDisplay *display = meta_screen_get_display (screen);
|
MetaDisplay *display = meta_screen_get_display (screen);
|
||||||
MetaCompScreen *info = meta_screen_get_compositor_data (screen);
|
|
||||||
Display *xdisplay;
|
Display *xdisplay;
|
||||||
Window xwin;
|
Window xwin;
|
||||||
|
|
||||||
@ -1437,11 +1449,11 @@ meta_compositor_sync_screen_size (MetaCompositor *compositor,
|
|||||||
xwin = clutter_x11_get_stage_window (CLUTTER_STAGE (info->stage));
|
xwin = clutter_x11_get_stage_window (CLUTTER_STAGE (info->stage));
|
||||||
|
|
||||||
XResizeWindow (xdisplay, xwin, width, height);
|
XResizeWindow (xdisplay, xwin, width, height);
|
||||||
|
}
|
||||||
|
|
||||||
meta_verbose ("Changed size for stage on screen %d to %dx%d\n",
|
meta_verbose ("Changed size for stage on screen %d to %dx%d\n",
|
||||||
meta_screen_get_screen_number (screen),
|
meta_screen_get_screen_number (screen),
|
||||||
width, height);
|
width, height);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -2877,7 +2877,6 @@ on_monitors_changed (MetaMonitorManager *manager,
|
|||||||
&changes);
|
&changes);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (screen->display->compositor)
|
|
||||||
meta_compositor_sync_screen_size (screen->display->compositor,
|
meta_compositor_sync_screen_size (screen->display->compositor,
|
||||||
screen,
|
screen,
|
||||||
screen->rect.width, screen->rect.height);
|
screen->rect.width, screen->rect.height);
|
||||||
|
@ -66,23 +66,3 @@ meta_wayland_stage_new (void)
|
|||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
meta_wayland_stage_apply_monitor_config (MetaWaylandStage *stage)
|
|
||||||
{
|
|
||||||
MetaMonitorManager *manager;
|
|
||||||
int width, height;
|
|
||||||
|
|
||||||
manager = meta_monitor_manager_get ();
|
|
||||||
meta_monitor_manager_get_screen_size (manager, &width, &height);
|
|
||||||
|
|
||||||
/* 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.
|
|
||||||
|
|
||||||
And because for now clutter does not do sliced, we use one
|
|
||||||
framebuffer the size of the whole screen, and when running on
|
|
||||||
bare metal MetaMonitorManager will do the necessary tricks to
|
|
||||||
show the right portions on the right screens.
|
|
||||||
*/
|
|
||||||
clutter_actor_set_size (CLUTTER_ACTOR (stage), width, height);
|
|
||||||
}
|
|
||||||
|
@ -65,8 +65,6 @@ GType meta_wayland_stage_get_type (void) G_GNUC_CONST
|
|||||||
|
|
||||||
ClutterActor *meta_wayland_stage_new (void);
|
ClutterActor *meta_wayland_stage_new (void);
|
||||||
|
|
||||||
void meta_wayland_stage_apply_monitor_config (MetaWaylandStage *self);
|
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* META_WAYLAND_STAGE_H */
|
#endif /* META_WAYLAND_STAGE_H */
|
||||||
|
@ -1441,7 +1441,6 @@ on_monitors_changed (MetaMonitorManager *monitors,
|
|||||||
g_list_free_full (compositor->outputs, (GDestroyNotify) wl_global_destroy);
|
g_list_free_full (compositor->outputs, (GDestroyNotify) wl_global_destroy);
|
||||||
compositor->outputs = NULL;
|
compositor->outputs = NULL;
|
||||||
meta_wayland_compositor_create_outputs (compositor, monitors);
|
meta_wayland_compositor_create_outputs (compositor, monitors);
|
||||||
meta_wayland_stage_apply_monitor_config (META_WAYLAND_STAGE (compositor->stage));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -1557,7 +1556,6 @@ meta_wayland_init (void)
|
|||||||
meta_wayland_compositor_create_outputs (compositor, monitors);
|
meta_wayland_compositor_create_outputs (compositor, monitors);
|
||||||
|
|
||||||
compositor->stage = meta_wayland_stage_new ();
|
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_signal_connect_after (compositor->stage, "paint",
|
||||||
G_CALLBACK (paint_finished_cb), compositor);
|
G_CALLBACK (paint_finished_cb), compositor);
|
||||||
@ -1589,8 +1587,6 @@ meta_wayland_init (void)
|
|||||||
compositor, bind_shell) == NULL)
|
compositor, bind_shell) == NULL)
|
||||||
g_error ("Failed to register a global shell object");
|
g_error ("Failed to register a global shell object");
|
||||||
|
|
||||||
clutter_actor_show (compositor->stage);
|
|
||||||
|
|
||||||
if (wl_display_add_socket (compositor->wayland_display, "wayland-0"))
|
if (wl_display_add_socket (compositor->wayland_display, "wayland-0"))
|
||||||
g_error ("Failed to create socket");
|
g_error ("Failed to create socket");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user