[mutter/wip/login1: 138/139] Replace mutter-launch with logind integration



commit 3b6e73686a5d64c62853698d5204141e113de076
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Tue Dec 31 17:44:45 2013 -0500

    Replace mutter-launch with logind integration
    
    This uses David Herrmann's new logind sessions interface to retrieve
    fds for input devices, rather than using a custom setuid helper to do
    the management. This vastly simplifies the interface.
    
    This requires systemd v210, at least.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=724604

 .gitignore                                         |    2 +-
 configure.ac                                       |    3 +-
 src/Makefile.am                                    |   25 +-
 src/mutter-wayland.desktop.in                      |    2 +-
 src/org.freedesktop.login1.xml                     |   44 ++
 src/wayland/meta-login1.c                          |  439 ++++++++++++
 .../{meta-weston-launch.h => meta-login1.h}        |   21 +-
 src/wayland/meta-wayland-private.h                 |    4 +-
 src/wayland/meta-wayland.c                         |   18 +-
 src/wayland/meta-weston-launch.c                   |  382 -----------
 src/wayland/weston-launch.c                        |  711 --------------------
 src/wayland/weston-launch.h                        |   68 --
 12 files changed, 520 insertions(+), 1199 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index ba75840..6970ca4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -48,7 +48,6 @@ po/*.pot
 50-metacity-key.xml
 libmutter-wayland.pc
 mutter-wayland
-mutter-launch
 org.gnome.mutter.gschema.valid
 org.gnome.mutter.gschema.xml
 org.gnome.mutter.wayland.gschema.valid
@@ -77,6 +76,7 @@ src/mutter-marshal.[ch]
 src/stamp-mutter-marshal.h
 src/meta-dbus-xrandr.[ch]
 src/meta-dbus-idle-monitor.[ch]
+src/meta-dbus-login1.[ch]
 src/mutter-plugins.pc
 src/wayland/gtk-shell-protocol.c
 src/wayland/gtk-shell-server-protocol.h
diff --git a/configure.ac b/configure.ac
index 6bc1ab4..f30fd06 100644
--- a/configure.ac
+++ b/configure.ac
@@ -140,7 +140,6 @@ AM_GLIB_GNU_GETTEXT
 ## here we get the flags we'll actually use
 # GRegex requires Glib-2.14.0
 PKG_CHECK_MODULES(ALL, glib-2.0 >= 2.14.0)
-PKG_CHECK_MODULES(MUTTER_LAUNCH, libdrm libsystemd-login)
 
 # Unconditionally use this dir to avoid a circular dep with gnomecc
 GNOME_KEYBINDINGS_KEYSDIR="${datadir}/gnome-control-center/keybindings"
@@ -213,7 +212,7 @@ AS_IF([test "x$WAYLAND_SCANNER" = "xno"],
 AC_SUBST([WAYLAND_SCANNER])
 AC_SUBST(XWAYLAND_PATH)
 
-MUTTER_PC_MODULES="$MUTTER_PC_MODULES clutter-wayland-1.0 clutter-wayland-compositor-1.0 clutter-egl-1.0 
wayland-server libdrm"
+MUTTER_PC_MODULES="$MUTTER_PC_MODULES clutter-wayland-1.0 clutter-wayland-compositor-1.0 clutter-egl-1.0 
wayland-server libdrm libsystemd"
 PKG_CHECK_MODULES(MUTTER, $MUTTER_PC_MODULES)
 
 PKG_CHECK_EXISTS([xi >= 1.6.99.1],
diff --git a/src/Makefile.am b/src/Makefile.am
index 8df85fb..d2daf08 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -39,6 +39,7 @@ INCLUDES += \
 mutter_built_sources = \
        $(dbus_idle_built_sources)              \
        $(dbus_xrandr_built_sources)            \
+       $(dbus_login1_built_sources)            \
        mutter-enum-types.h                     \
        mutter-enum-types.c                     \
        wayland/gtk-shell-protocol.c            \
@@ -207,8 +208,8 @@ libmutter_wayland_la_SOURCES =                      \
        wayland/meta-wayland-surface.h          \
        wayland/meta-wayland-types.h            \
        wayland/meta-wayland-versions.h         \
-       wayland/meta-weston-launch.c            \
-       wayland/meta-weston-launch.h
+       wayland/meta-login1.c                   \
+       wayland/meta-login1.h
 
 nodist_libmutter_wayland_la_SOURCES =          \
        $(mutter_built_sources)
@@ -263,17 +264,6 @@ bin_PROGRAMS=mutter-wayland
 mutter_wayland_SOURCES = core/mutter.c
 mutter_wayland_LDADD = $(MUTTER_LIBS) libmutter-wayland.la
 
-bin_PROGRAMS+=mutter-launch
-
-mutter_launch_SOURCES = wayland/weston-launch.c wayland/weston-launch.h
-
-mutter_launch_CFLAGS = $(MUTTER_LAUNCH_CFLAGS) -DLIBDIR=\"$(libdir)\"
-mutter_launch_LDFLAGS = $(MUTTER_LAUNCH_LIBS) -lpam
-
-install-exec-hook:
-       -chown root $(DESTDIR)$(bindir)/mutter-launch
-       -chmod u+s $(DESTDIR)$(bindir)/mutter-launch
-
 if HAVE_INTROSPECTION
 include $(INTROSPECTION_MAKEFILE)
 
@@ -409,6 +399,15 @@ $(dbus_idle_built_sources) : Makefile.am idle-monitor.xml
                --c-generate-object-manager                                             \
                $(srcdir)/idle-monitor.xml
 
+dbus_login1_built_sources = meta-dbus-login1.c meta-dbus-login1.h
+
+$(dbus_login1_built_sources) : Makefile.am org.freedesktop.login1.xml
+       $(AM_V_GEN)gdbus-codegen                                                        \
+               --interface-prefix org.freedesktop.login1                               \
+               --c-namespace Login1                                                    \
+               --generate-c-code meta-dbus-login1                                      \
+               $(srcdir)/org.freedesktop.login1.xml
+
 wayland/%-protocol.c : $(top_builddir)/protocol/%.xml
        mkdir -p wayland
        $(AM_V_GEN)$(WAYLAND_SCANNER) code < $< > $@
diff --git a/src/mutter-wayland.desktop.in b/src/mutter-wayland.desktop.in
index 9f21316..3bf5f23 100644
--- a/src/mutter-wayland.desktop.in
+++ b/src/mutter-wayland.desktop.in
@@ -1,7 +1,7 @@
 [Desktop Entry]
 Type=Application
 _Name=Mutter (wayland compositor)
-Exec=mutter-launch -- mutter --wayland --display-server
+Exec=mutter --wayland --display-server
 NoDisplay=true
 # name of loadable control center module
 X-GNOME-WMSettingsModule=metacity
diff --git a/src/org.freedesktop.login1.xml b/src/org.freedesktop.login1.xml
new file mode 100644
index 0000000..924e397
--- /dev/null
+++ b/src/org.freedesktop.login1.xml
@@ -0,0 +1,44 @@
+<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
+"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd";>
+<node>
+  <interface name="org.freedesktop.login1.Session">
+    <property name="Active" type="b" access="read" />
+
+    <method name="Activate">
+    </method>
+    <method name="TakeControl">
+      <arg name="force" type="b"/>
+    </method>
+    <method name="TakeDevice">
+      <annotation name="org.gtk.GDBus.C.UnixFD" value="true"/>
+      <arg name="major" type="u" direction="in"/>
+      <arg name="minor" type="u" direction="in"/>
+      <arg name="fd" type="h" direction="out"/>
+      <arg name="paused" type="b" direction="out"/>
+    </method>
+    <method name="ReleaseDevice">
+      <arg name="major" type="u"/>
+      <arg name="minor" type="u"/>
+    </method>
+    <method name="PauseDeviceComplete">
+      <arg name="major" type="u"/>
+      <arg name="minor" type="u"/>
+    </method>
+    <signal name="PauseDevice">
+      <arg name="major" type="u"/>
+      <arg name="minor" type="u"/>
+      <arg name="type" type="s"/>
+    </signal>
+    <signal name="ResumeDevice">
+      <arg name="major" type="u"/>
+      <arg name="minor" type="u"/>
+      <arg name="fd" type="h"/>
+    </signal>
+  </interface>
+
+  <interface name="org.freedesktop.login1.Seat">
+    <method name="SwitchTo">
+      <arg name="vt" type="u"/>
+    </method>
+  </interface>
+</node>
diff --git a/src/wayland/meta-login1.c b/src/wayland/meta-login1.c
new file mode 100644
index 0000000..024fd00
--- /dev/null
+++ b/src/wayland/meta-login1.c
@@ -0,0 +1,439 @@
+/*
+ * Copyright (C) 2014 Red Hat, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#include "config.h"
+
+#include "meta-login1.h"
+
+#include "meta-dbus-login1.h"
+
+#include "meta-wayland-private.h"
+#include "meta-cursor-tracker-private.h"
+
+#include <gio/gunixfdlist.h>
+
+#include <clutter/clutter.h>
+#include <clutter/evdev/clutter-evdev.h>
+#include <clutter/egl/clutter-egl.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <malloc.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+#include <systemd/sd-login.h>
+
+struct _MetaLogin1
+{
+  Login1Session *session_proxy;
+  Login1Seat *seat_proxy;
+
+  gboolean session_active;
+};
+
+/* Stolen from tp_escape_as_identifier, from tp-glib,
+ * which follows the same escaping convention as systemd.
+ */
+static inline gboolean
+_esc_ident_bad (gchar c, gboolean is_first)
+{
+  return ((c < 'a' || c > 'z') &&
+          (c < 'A' || c > 'Z') &&
+          (c < '0' || c > '9' || is_first));
+}
+
+static gchar *
+escape_dbus_component (const gchar *name)
+{
+  gboolean bad = FALSE;
+  size_t len = 0;
+  GString *op;
+  const gchar *ptr, *first_ok;
+
+  g_return_val_if_fail (name != NULL, NULL);
+
+  /* fast path for empty name */
+  if (name[0] == '\0')
+    return g_strdup ("_");
+
+  for (ptr = name; *ptr; ptr++)
+    {
+      if (_esc_ident_bad (*ptr, ptr == name))
+        {
+          bad = TRUE;
+          len += 3;
+        }
+      else
+        len++;
+    }
+
+  /* fast path if it's clean */
+  if (!bad)
+    return g_strdup (name);
+
+  /* If strictly less than ptr, first_ok is the first uncopied safe character.
+   */
+  first_ok = name;
+  op = g_string_sized_new (len);
+  for (ptr = name; *ptr; ptr++)
+    {
+      if (_esc_ident_bad (*ptr, ptr == name))
+        {
+          /* copy preceding safe characters if any */
+          if (first_ok < ptr)
+            {
+              g_string_append_len (op, first_ok, ptr - first_ok);
+            }
+          /* escape the unsafe character */
+          g_string_append_printf (op, "_%02x", (unsigned char)(*ptr));
+          /* restart after it */
+          first_ok = ptr + 1;
+        }
+    }
+  /* copy trailing safe characters if any */
+  if (first_ok < ptr)
+    {
+      g_string_append_len (op, first_ok, ptr - first_ok);
+    }
+  return g_string_free (op, FALSE);
+}
+
+static char *
+get_escaped_dbus_path (const char *prefix,
+                       const char *component)
+{
+  char *escaped_component = escape_dbus_component (component);
+  char *path = g_strconcat (prefix, "/", component, NULL);
+
+  g_free (escaped_component);
+  return path;
+}
+
+static Login1Session *
+get_session_proxy (GCancellable *cancellable)
+{
+  char *proxy_path;
+  char *session_id;
+  Login1Session *session_proxy;
+
+  if (sd_pid_get_session (getpid (), &session_id) < 0)
+    return NULL;
+
+  proxy_path = get_escaped_dbus_path ("/org/freedesktop/login1/session", session_id);
+
+  session_proxy = login1_session_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
+                                                         G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START,
+                                                         "org.freedesktop.login1",
+                                                         proxy_path,
+                                                         cancellable, NULL);
+  free (proxy_path);
+
+  return session_proxy;
+}
+
+static Login1Seat *
+get_seat_proxy (GCancellable *cancellable)
+{
+  return login1_seat_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
+                                             G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START,
+                                             "org.freedesktop.login1",
+                                             "/org/freedesktop/login1/seat/self",
+                                             cancellable, NULL);
+}
+
+static void
+session_unpause (void)
+{
+  ClutterBackend *backend;
+  CoglContext *cogl_context;
+  CoglDisplay *cogl_display;
+
+  backend = clutter_get_default_backend ();
+  cogl_context = clutter_backend_get_cogl_context (backend);
+  cogl_display = cogl_context_get_display (cogl_context);
+  cogl_kms_display_queue_modes_reset (cogl_display);
+
+  clutter_set_paused (FALSE);
+  clutter_evdev_reclaim_devices ();
+
+  {
+    MetaWaylandCompositor *compositor = meta_wayland_compositor_get_default ();
+
+    /* When we mode-switch back, we need to immediately queue a redraw
+     * in case nothing else quueed one for us, and force the cursor to
+     * update. */
+
+    clutter_actor_queue_redraw (compositor->stage);
+    meta_cursor_tracker_force_update (compositor->seat->cursor_tracker);
+  }
+}
+
+static void
+session_pause (void)
+{
+  clutter_set_paused (TRUE);
+  clutter_evdev_release_devices ();
+}
+
+static void
+sync_active (MetaLogin1 *self)
+{
+  gboolean active = login1_session_get_active (LOGIN1_SESSION (self->session_proxy));
+
+  if (active == self->session_active)
+    return;
+
+  self->session_active = active;
+
+  if (active)
+    session_unpause ();
+  else
+    session_pause ();
+}
+
+static void
+on_active_changed (Login1Session *session,
+                   GParamSpec    *pspec,
+                   gpointer       user_data)
+{
+  MetaLogin1 *self = user_data;
+  sync_active (self);
+}
+
+static gboolean
+take_device (Login1Session *session_proxy,
+             int            dev_major,
+             int            dev_minor,
+             int           *out_fd,
+             GCancellable  *cancellable,
+             GError       **error)
+{
+  gboolean ret = FALSE;
+  GVariant *fd_variant = NULL;
+  int fd = -1;
+  GUnixFDList *fd_list;
+
+  if (!login1_session_call_take_device_sync (session_proxy,
+                                             dev_major,
+                                             dev_minor,
+                                             NULL,
+                                             &fd_variant,
+                                             NULL, /* paused */
+                                             &fd_list,
+                                             cancellable,
+                                             error))
+    goto out;
+
+  fd = g_unix_fd_list_get (fd_list, g_variant_get_handle (fd_variant), error);
+  if (fd == -1)
+    goto out;
+
+  *out_fd = fd;
+  ret = TRUE;
+
+ out:
+  if (fd_variant)
+    g_variant_unref (fd_variant);
+  if (fd_list)
+    g_object_unref (fd_list);
+  return ret;
+}
+
+static gboolean
+get_device_info_from_path (const char *path,
+                           int        *out_major,
+                           int        *out_minor)
+{
+  gboolean ret = FALSE;
+  int r;
+  struct stat st;
+
+  r = stat (path, &st);
+  if (r < 0)
+    goto out;
+  if (!S_ISCHR (st.st_mode))
+    goto out;
+
+  *out_major = major (st.st_rdev);
+  *out_minor = minor (st.st_rdev);
+  ret = TRUE;
+
+ out:
+  return ret;
+}
+
+static gboolean
+get_device_info_from_fd (int  fd,
+                         int *out_major,
+                         int *out_minor)
+{
+  gboolean ret = FALSE;
+  int r;
+  struct stat st;
+
+  r = fstat (fd, &st);
+  if (r < 0)
+    goto out;
+  if (!S_ISCHR (st.st_mode))
+    goto out;
+
+  *out_major = major (st.st_rdev);
+  *out_minor = minor (st.st_rdev);
+  ret = TRUE;
+
+ out:
+  return ret;
+}
+
+static int
+open_evdev_device (const char  *path,
+                   int          flags,
+                   gpointer     user_data,
+                   GError     **error)
+{
+  MetaLogin1 *self = user_data;
+  int fd;
+  int major, minor;
+
+  if (!get_device_info_from_path (path, &major, &minor))
+    {
+      g_set_error (error,
+                   G_IO_ERROR,
+                   G_IO_ERROR_NOT_FOUND,
+                   "Could not get device info for path %s: %m", path);
+      return -1;
+    }
+
+  if (!take_device (self->session_proxy, major, minor, &fd, NULL, error))
+    return -1;
+
+  return fd;
+}
+
+static void
+close_evdev_device (int      fd,
+                    gpointer user_data)
+{
+  MetaLogin1 *self = user_data;
+  int major, minor;
+  GError *error = NULL;
+
+  if (!get_device_info_from_fd (fd, &major, &minor))
+    {
+      g_warning ("Could not get device info for fd %d: %m", fd);
+      return;
+    }
+
+  if (!login1_session_call_release_device_sync (self->session_proxy,
+                                                major, minor,
+                                                NULL, &error))
+    {
+      g_warning ("Could not release device %d,%d: %s", major, minor, error->message);
+    }
+}
+
+static gboolean
+get_kms_fd (Login1Session *session_proxy,
+            int *fd_out)
+{
+  int major, minor;
+  int fd;
+  GError *error = NULL;
+
+  /* XXX -- use udev to find the DRM master device */
+  if (!get_device_info_from_path ("/dev/dri/card0", &major, &minor))
+    {
+      g_warning ("Could not stat /dev/dri/card0: %m");
+      return FALSE;
+    }
+
+  if (!take_device (session_proxy, major, minor, &fd, NULL, &error))
+    {
+      g_warning ("Could not open DRM device: %s\n", error->message);
+      g_error_free (error);
+      return FALSE;
+    }
+
+  *fd_out = fd;
+
+  return TRUE;
+}
+
+MetaLogin1 *
+meta_login1_new (void)
+{
+  MetaLogin1 *self;
+  Login1Session *session_proxy;
+  GError *error = NULL;
+  int kms_fd;
+
+  session_proxy = get_session_proxy (NULL);
+  if (!login1_session_call_take_control_sync (session_proxy, FALSE, NULL, &error))
+    {
+      g_warning ("Could not take control: %s", error->message);
+      g_error_free (error);
+      return NULL;
+    }
+
+  if (!get_kms_fd (session_proxy, &kms_fd))
+    return NULL;
+
+  self = g_slice_new0 (MetaLogin1);
+  self->session_proxy = session_proxy;
+  self->seat_proxy = get_seat_proxy (NULL);
+
+  self->session_active = TRUE;
+
+  clutter_egl_native_set_kms_fd (kms_fd);
+  clutter_evdev_set_open_callback (open_evdev_device,
+                                   close_evdev_device,
+                                   self);
+
+  g_signal_connect (self->session_proxy, "notify::active", G_CALLBACK (on_active_changed), self);
+
+  return self;
+}
+
+void
+meta_login1_free (MetaLogin1 *self)
+{
+  g_object_unref (self->seat_proxy);
+  g_object_unref (self->session_proxy);
+  g_slice_free (MetaLogin1, self);
+}
+
+gboolean
+meta_login1_activate_session (MetaLogin1  *self,
+                              GError     **error)
+{
+  if (!login1_session_call_activate_sync (self->session_proxy, NULL, error))
+    return FALSE;
+
+  sync_active (self);
+  return TRUE;
+}
+
+gboolean
+meta_login1_activate_vt (MetaLogin1  *self,
+                         int          vt,
+                         GError     **error)
+{
+  return login1_seat_call_switch_to_sync (self->seat_proxy, vt, NULL, error);
+}
diff --git a/src/wayland/meta-weston-launch.h b/src/wayland/meta-login1.h
similarity index 58%
rename from src/wayland/meta-weston-launch.h
rename to src/wayland/meta-login1.h
index b70faf8..0fed205 100644
--- a/src/wayland/meta-weston-launch.h
+++ b/src/wayland/meta-login1.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013 Red Hat, Inc.
+ * Copyright (C) 2014 Red Hat, Inc.
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
@@ -17,18 +17,19 @@
  * 02111-1307, USA.
  */
 
-#ifndef META_WESTON_LAUNCH_H
-#define META_WESTON_LAUNCH_H
+#ifndef META_LOGIN1_H
+#define META_LOGIN1_H
 
 #include <glib-object.h>
-#include "weston-launch.h"
 
-typedef struct _MetaLauncher MetaLauncher;
+typedef struct _MetaLogin1 MetaLogin1;
 
-MetaLauncher     *meta_launcher_new                     (void);
-void              meta_launcher_free                    (MetaLauncher  *self);
+MetaLogin1 *meta_login1_new              (void);
+void        meta_login1_free             (MetaLogin1  *self);
+gboolean    meta_login1_activate_session (MetaLogin1  *self,
+                                          GError     **error);
+gboolean    meta_login1_activate_vt      (MetaLogin1  *self,
+                                          int          vt,
+                                          GError     **error);
 
-gboolean          meta_launcher_activate_vt             (MetaLauncher  *self,
-                                                        signed char    vt,
-                                                        GError       **error);
 #endif
diff --git a/src/wayland/meta-wayland-private.h b/src/wayland/meta-wayland-private.h
index a2a2b90..d9120b1 100644
--- a/src/wayland/meta-wayland-private.h
+++ b/src/wayland/meta-wayland-private.h
@@ -27,7 +27,7 @@
 #include <cairo.h>
 
 #include "window-private.h"
-#include "meta-weston-launch.h"
+#include "meta-login1.h"
 #include <meta/meta-cursor-tracker.h>
 
 #include "meta-wayland.h"
@@ -85,7 +85,7 @@ struct _MetaWaylandCompositor
 
   MetaXWaylandManager xwayland_manager;
 
-  MetaLauncher *launcher;
+  MetaLogin1 *login1;
 
   MetaWaylandSeat *seat;
 };
diff --git a/src/wayland/meta-wayland.c b/src/wayland/meta-wayland.c
index a13a920..d6ff43f 100644
--- a/src/wayland/meta-wayland.c
+++ b/src/wayland/meta-wayland.c
@@ -52,7 +52,7 @@
 #include <meta/main.h>
 #include "frame.h"
 #include "meta-idle-monitor-private.h"
-#include "meta-weston-launch.h"
+#include "meta-login1.h"
 #include "monitor-private.h"
 
 static MetaWaylandCompositor _meta_wayland_compositor;
@@ -644,10 +644,10 @@ meta_wayland_init (void)
   clutter_wayland_set_compositor_display (compositor->wayland_display);
 
   /* If we're running on bare metal, we're a display server,
-   * so start talking to weston-launch. */
+   * so start talking to logind. */
 #if defined(CLUTTER_WINDOWING_EGL)
   if (clutter_check_windowing_backend (CLUTTER_WINDOWING_EGL))
-    compositor->launcher = meta_launcher_new ();
+    compositor->login1 = meta_login1_new ();
 #endif
 
   if (clutter_init (NULL, NULL) != CLUTTER_INIT_SUCCESS)
@@ -704,8 +704,8 @@ meta_wayland_finalize (void)
 
   meta_xwayland_stop (&compositor->xwayland_manager);
 
-  if (compositor->launcher)
-    meta_launcher_free (compositor->launcher);
+  if (compositor->login1)
+    meta_login1_free (compositor->login1);
 }
 
 gboolean
@@ -713,9 +713,9 @@ meta_wayland_compositor_activate_vt (MetaWaylandCompositor  *compositor,
                                      int                     vt,
                                      GError                **error)
 {
-  if (compositor->launcher)
+  if (compositor->login1)
     {
-      return meta_launcher_activate_vt (compositor->launcher, vt, error);
+      return meta_login1_activate_vt (compositor->login1, vt, error);
     }
   else
     {
@@ -728,9 +728,9 @@ gboolean
 meta_wayland_compositor_activate_session (MetaWaylandCompositor  *compositor,
                                           GError                **error)
 {
-  if (compositor->launcher)
+  if (compositor->login1)
     {
-      return meta_launcher_activate_vt (compositor->launcher, -1, error);
+      return meta_login1_activate_session (compositor->login1, error);
     }
   else
     {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]