Skip to content

Commit

Permalink
Fixed VT issues
Browse files Browse the repository at this point in the history
The root cause of VT related crashes appears to be the implicit
ungrabbing of xinput devices.

(see https://gitlab.freedesktop.org/xorg/lib/libxi/-/issues/11)
  • Loading branch information
rvaiya committed Sep 15, 2020
1 parent 67c3716 commit 08ed81a
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/input.c
Expand Up @@ -429,9 +429,17 @@ void input_ungrab_keyboard(int wait_for_keyboard)
}

for (i = 0; i < nkbds; i++) {
dbg("Ungrabbing %d", kbds[i]);
XIUngrabDevice(dpy, kbds[i], CurrentTime);
dbg("Done");
int n;
XIDeviceInfo *info = XIQueryDevice(dpy, kbds[i], &n);
assert(n == 1);

//Attempting to ungrab a disabled xinput device causes X to crash.
//(see https://gitlab.freedesktop.org/xorg/lib/libxi/-/issues/11)
if(info->enabled) {
dbg("Ungrabbing %d\n", kbds[i]);
XIUngrabDevice(dpy, kbds[i], CurrentTime);
dbg("Done");
}
}

sync_state();
Expand Down

0 comments on commit 08ed81a

Please sign in to comment.