diff --git a/tdekbdledsync/main.cpp b/tdekbdledsync/main.cpp
index a439ebd..ccbb66b 100644
--- a/tdekbdledsync/main.cpp
+++ b/tdekbdledsync/main.cpp
@@ -440,6 +440,11 @@
}
}
}
+ else {
+ // Ensure the X server is still alive
+ // If the X server has terminated, this will fail and the program will terminate
+ XSync(display, False);
+ }
// Check the hotplug monitoring process to see if any keyboards were added or removed
fd_set readfds;
|
diff --git a/tdekbdledsync/main.cpp b/tdekbdledsync/main.cpp
index ccbb66b..42bb6c9 100644
--- a/tdekbdledsync/main.cpp
+++ b/tdekbdledsync/main.cpp
@@ -404,13 +404,11 @@
if (x11_vt_num == vtstat.v_active) {
// Get Virtual Core keyboard status
- if (XkbGetIndicatorState(display, XkbUseCoreKbd, &states) != Success) {
+ if (XkbGetState(display, XkbUseCoreKbd, &state) != Success) {
fprintf(stderr, "[tdekbdledsync] Unable to query X11 Virtual Core keyboard!\n");
releaseLock(lockfd, lockFileName);
return -7;
}
-
- XkbGetState(display, XkbUseCoreKbd, &state);
caps_lock_set = (state.mods & caps_lock_mask);
num_lock_set = (state.mods & num_lock_mask);
|