Integrate the monitor manager with wayland

Use the right backend when running as a wayland compositor,
export the data to wayland clients, and use it to keep the stage
appropriately sized.
This commit is contained in:
Giovanni Campagna
2013-08-19 11:12:42 +02:00
parent aa15c09d54
commit 9a4783e364
6 changed files with 209 additions and 92 deletions

View File

@ -474,6 +474,15 @@ make_logical_config (MetaMonitorManager *manager)
manager->monitor_infos = (void*)g_array_free (monitor_infos, FALSE);
}
static GType
get_default_backend (void)
{
if (meta_is_wayland_compositor ())
return META_TYPE_MONITOR_MANAGER; /* FIXME: KMS */
else
return META_TYPE_MONITOR_MANAGER_XRANDR;
}
static MetaMonitorManager *
meta_monitor_manager_new (void)
{
@ -483,7 +492,7 @@ meta_monitor_manager_new (void)
env = g_getenv ("META_DEBUG_MULTIMONITOR");
if (env == NULL)
type = META_TYPE_MONITOR_MANAGER_XRANDR;
type = get_default_backend ();
else if (strcmp (env, "xrandr") == 0)
type = META_TYPE_MONITOR_MANAGER_XRANDR;
else

View File

@ -675,8 +675,9 @@ meta_screen_new (MetaDisplay *display,
screen->xscreen = ScreenOfDisplay (xdisplay, number);
screen->xroot = xroot;
screen->rect.x = screen->rect.y = 0;
meta_monitor_manager_initialize ();
if (!meta_is_wayland_compositor ())
meta_monitor_manager_initialize ();
manager = meta_monitor_manager_get ();
g_signal_connect (manager, "monitors-changed",