aboutsummaryrefslogtreecommitdiffstats
path: root/fbcon.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2019-03-04 09:55:43 +0100
committerGerd Hoffmann <kraxel@redhat.com>2019-03-04 09:55:43 +0100
commit446ead14577cf943459b5d29dee88a3b8c26abcc (patch)
treea9431771174a5632c4ff9618cc35ab4b0ec35f61 /fbcon.c
parenta54addaa25769da1df006562974f699319bf1172 (diff)
downloadfbida-446ead14577cf943459b5d29dee88a3b8c26abcc.tar.gz
logind improvements
Diffstat (limited to 'fbcon.c')
-rw-r--r--fbcon.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/fbcon.c b/fbcon.c
index 2f2f99f..d795b9f 100644
--- a/fbcon.c
+++ b/fbcon.c
@@ -521,7 +521,7 @@ int main(int argc, char *argv[])
const char *fb_node = NULL;
const char *xdg_seat, *xdg_session_id;
bool logind = false;
- int input;
+ int input, dbus;
pid_t child;
setlocale(LC_ALL,"");
@@ -531,9 +531,12 @@ int main(int argc, char *argv[])
xdg_session_id = getenv("XDG_SESSION_ID");
if (xdg_seat)
seat_name = xdg_seat;
- if (xdg_seat && xdg_session_id)
- if (logind_init() == 0)
+ if (xdg_seat && xdg_session_id) {
+ if (logind_init() == 0) {
+ dbus = logind_dbus_fd();
logind = true;
+ }
+ }
/* look for gfx devices */
udev = udev_new();
@@ -656,6 +659,11 @@ int main(int argc, char *argv[])
FD_SET(input, &set);
if (max < input)
max = input;
+ if (logind) {
+ FD_SET(dbus, &set);
+ if (max < dbus)
+ max = dbus;
+ }
rc = select(max+ 1, &set, NULL, NULL, NULL);
if (rc < 0)
@@ -701,6 +709,10 @@ int main(int argc, char *argv[])
libinput_event_destroy(evt);
}
}
+
+ if (logind && FD_ISSET(dbus, &set)) {
+ logind_dbus_input();
+ }
}
cleanup_and_exit(0);