From a54addaa25769da1df006562974f699319bf1172 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Mon, 4 Mar 2019 06:39:15 +0100 Subject: move logind code to separate file --- fbcon.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'fbcon.c') diff --git a/fbcon.c b/fbcon.c index 94b060d..2f2f99f 100644 --- a/fbcon.c +++ b/fbcon.c @@ -33,6 +33,7 @@ #include "drmtools.h" #include "vt.h" #include "kbd.h" +#include "logind.h" /* ---------------------------------------------------------------------- */ @@ -519,6 +520,7 @@ int main(int argc, char *argv[]) const char *drm_node = NULL; const char *fb_node = NULL; const char *xdg_seat, *xdg_session_id; + bool logind = false; int input; pid_t child; @@ -530,7 +532,8 @@ int main(int argc, char *argv[]) if (xdg_seat) seat_name = xdg_seat; if (xdg_seat && xdg_session_id) - logind_init(); + if (logind_init() == 0) + logind = true; /* look for gfx devices */ udev = udev_new(); @@ -594,7 +597,10 @@ int main(int argc, char *argv[]) fbcon_cairo_update(font_name, font_size); /* init libinput */ - kbd = libinput_udev_create_context(&libinput_interface, NULL, udev); + kbd = libinput_udev_create_context(logind + ? &libinput_if_logind + : &libinput_if_default, + NULL, udev); libinput_udev_assign_seat(kbd, seat_name); input = libinput_get_fd(kbd); -- cgit