Page MenuHomeFreeBSD

vt: fix window switching w.r.t. cngrab/cnungrab
ClosedPublic

Authored by kevans on Nov 6 2020, 3:14 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Jul 24, 11:30 AM
Unknown Object (File)
Tue, Jul 23, 7:46 AM
Unknown Object (File)
Sat, Jul 20, 2:20 PM
Unknown Object (File)
Sun, Jun 30, 9:03 AM
Unknown Object (File)
Jun 26 2024, 1:20 AM
Unknown Object (File)
Jun 26 2024, 12:09 AM
Unknown Object (File)
Jun 20 2024, 11:14 PM
Unknown Object (File)
Jun 16 2024, 12:24 AM
Subscribers

Details

Summary

Noticed while investigating the situation that lead to D27109, vt(4) will switch away from the current window but never switch back if the console ends up being ungrabbed.

Resolve this by recording the active window in cngrab(), and restore it on the last cnungrab() if we actually switched away.

While I was hacking on this, I noticed that vt_allocate_keyboard will do a cnungrab/cngrab dance if it needs to. Yank out basically just the parts it needs and use those directly to avoid clobbering the pre-grab window state -- it just wants the keyboard restored.

Test Plan

Switch to ttyv1, break to debugger, continue; observe it switching back to a functional ttyv1.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable