From 1388e8b13e19d13839b98046f332d98232f084c2 Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Mon, 15 Aug 2016 17:11:05 +0000 Subject: [PATCH] [Oops, the previous commit was missing the update to syscons.h.] Like scr_lock, the grab count needs to be per-physical-device to work. This bug corrupted the grab count on both vtys if the ungrabbed vty is different from the console, and failed to restore the keyboard state on the ungrabbed vty, but not restoring it usually left the keyboard mode part of the keyboard state uncorrupted at 1 (K_XLATE), while after this fix the keyboard mode part is usually corrupted to 0 (K_RAW). While here, rename the grab count from grabbed to grab_level. --- sys/dev/syscons/syscons.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/syscons/syscons.h b/sys/dev/syscons/syscons.h index 077a1067539e..af5fb9f45acf 100644 --- a/sys/dev/syscons/syscons.h +++ b/sys/dev/syscons/syscons.h @@ -230,6 +230,7 @@ typedef struct sc_softc { char switch_in_progress; char write_in_progress; char blink_in_progress; + int grab_level; struct mtx scr_lock; /* mutex for sc_puts() */ struct mtx video_mtx; @@ -304,7 +305,6 @@ typedef struct scr_stat { void *ts; int status; /* status (bitfield) */ - int grabbed; int kbd_mode; /* keyboard I/O mode */ int kbd_prev_mode; /* keyboard I/O mode */