summaryrefslogtreecommitdiff
path: root/x11-drivers/xlibre-xf86-input-keyboard/files/patch-src__kbd.c
blob: e9b0397baea78bbf8fc53231820b164b25af59dd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Index: src/kbd.c
@@ -25,6 +25,7 @@
 
 #include "xf86.h"
 #include "atKeynames.h"
+#include "xf86Priv.h"
 #include "xf86Privstr.h"
 
 #include <X11/extensions/XI.h>
@@ -392,6 +393,14 @@
       RemoveEnabledDevice(pInfo->fd);
     pKbd->KbdOff(pInfo, what);
     device->public.on = FALSE;
+	/*
+	 * Close device file for keyboards which are not attached
+	 * to console, otherwise they can't be opened again after
+	 * relogin when using session manager like xdm.
+	 * X server will take care about console attached keyboards.
+	 */
+	if (pInfo->fd != xf86Info.consoleFd)
+		close(pInfo->fd);
     break;
 
   default: