<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 3, 2017 at 7:28 PM, nerdopolis <span dir="ltr"><<a href="mailto:bluescreen_avenger@verizon.net" target="_blank">bluescreen_avenger@verizon.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">As only seat0 supports TTYs, this changes the logind launcher where<br>
it detects a TTY, only if the seat is seat0. This has only been<br>
tested for logind<br>
---<br>
 libweston/launcher-logind.c | 22 ++++++++++++----------<br>
 libweston/launcher-util.c   |  4 ++++<br>
 2 files changed, 16 insertions(+), 10 deletions(-)<br>
<br>
diff --git a/libweston/launcher-logind.c b/libweston/launcher-logind.c<br>
index a069bd4f..a94ec0e9 100644<br>
--- a/libweston/launcher-logind.c<br>
+++ b/libweston/launcher-logind.c<br>
@@ -762,18 +762,20 @@ launcher_logind_connect(struct weston_launcher **out, struct weston_compositor *<br>
                free(t);<br>
                goto err_session;<br>
        }<br>
-       free(t);<br>
<br>
-       r = weston_sd_session_get_vt(wl-><wbr>sid, &wl->vtnr);<br>
-       if (r < 0) {<br>
-               weston_log("logind: session not running on a VT\n");<br>
-               goto err_session;<br>
-       } else if (tty > 0 && wl->vtnr != (unsigned int )tty) {<br>
-               weston_log("logind: requested VT --tty=%d differs from real session VT %u\n",<br>
-                          tty, wl->vtnr);<br>
-               r = -EINVAL;<br>
-               goto err_session;<br>
+       if (!strcmp(t, "seat0")) {<br>
+               r = weston_sd_session_get_vt(wl-><wbr>sid, &wl->vtnr);<br>
+               if (r < 0) {<br>
+                       weston_log("logind: session not running on a VT\n");<br>
+                       goto err_session;<br>
+               } else if (tty > 0 && wl->vtnr != (unsigned int )tty) {<br>
+                       weston_log("logind: requested VT --tty=%d differs from real session VT %u\n",<br>
+                                  tty, wl->vtnr);<br>
+                       r = -EINVAL;<br>
+                       goto err_session;<br>
+               }<br>
        }<br>
+       free(t);<br></blockquote><div><br></div><div>You will now need to free it before the two "goto err_session;" statements above, too.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
        loop = wl_display_get_event_loop(<wbr>compositor->wl_display);<br>
        r = weston_dbus_open(loop, DBUS_BUS_SYSTEM, &wl->dbus, &wl->dbus_ctx);<br>
diff --git a/libweston/launcher-util.c b/libweston/launcher-util.c<br>
index fa3ed13b..848c6ade 100644<br>
--- a/libweston/launcher-util.c<br>
+++ b/libweston/launcher-util.c<br>
@@ -111,6 +111,10 @@ WL_EXPORT void<br>
 weston_setup_vt_switch_<wbr>bindings(struct weston_compositor *compositor)<br>
 {<br>
        uint32_t key;<br>
+       struct weston_launcher *launcher = compositor->launcher;<br>
+<br>
+       if (launcher->iface->get_vt(<wbr>launcher) == 0)<br>
+               return;<br>
<br>
        if (compositor->vt_switching == false)<br>
                return;<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.14.1<br>
<br>
______________________________<wbr>_________________<br>
wayland-devel mailing list<br>
<a href="mailto:wayland-devel@lists.freedesktop.org">wayland-devel@lists.<wbr>freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/wayland-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/wayland-devel</a><br>
</font></span></blockquote></div><br></div></div>