Commit 68220dba authored by nerdopolis's avatar nerdopolis Committed by Pekka Paalanen

launcher-logind: only get a VT on seat0, as only seat0 supports VTs

As only seat0 supports TTYs, this changes the logind launcher where
it detects a TTY, only if the seat is seat0. This has only been
tested for logind
Reviewed-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: default avatarEmil Velikov <emil.velikov@collabora.com>
parent d68109b9
...@@ -762,8 +762,10 @@ launcher_logind_connect(struct weston_launcher **out, struct weston_compositor * ...@@ -762,8 +762,10 @@ launcher_logind_connect(struct weston_launcher **out, struct weston_compositor *
free(t); free(t);
goto err_session; goto err_session;
} }
free(t);
r = strcmp(t, "seat0");
free(t);
if (r == 0) {
r = weston_sd_session_get_vt(wl->sid, &wl->vtnr); r = weston_sd_session_get_vt(wl->sid, &wl->vtnr);
if (r < 0) { if (r < 0) {
weston_log("logind: session not running on a VT\n"); weston_log("logind: session not running on a VT\n");
...@@ -774,6 +776,7 @@ launcher_logind_connect(struct weston_launcher **out, struct weston_compositor * ...@@ -774,6 +776,7 @@ launcher_logind_connect(struct weston_launcher **out, struct weston_compositor *
r = -EINVAL; r = -EINVAL;
goto err_session; goto err_session;
} }
}
loop = wl_display_get_event_loop(compositor->wl_display); loop = wl_display_get_event_loop(compositor->wl_display);
r = weston_dbus_open(loop, DBUS_BUS_SYSTEM, &wl->dbus, &wl->dbus_ctx); r = weston_dbus_open(loop, DBUS_BUS_SYSTEM, &wl->dbus, &wl->dbus_ctx);
......
...@@ -104,6 +104,10 @@ WL_EXPORT void ...@@ -104,6 +104,10 @@ WL_EXPORT void
weston_setup_vt_switch_bindings(struct weston_compositor *compositor) weston_setup_vt_switch_bindings(struct weston_compositor *compositor)
{ {
uint32_t key; uint32_t key;
struct weston_launcher *launcher = compositor->launcher;
if (launcher->iface->get_vt(launcher) <= 0)
return;
if (compositor->vt_switching == false) if (compositor->vt_switching == false)
return; return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment