Subject: xsrc/9127: CapsLock not properly handled between virtual consoles with X
To: None <gnats-bugs@gnats.netbsd.org>
From: Richard Rauch <rkr@rkr.kcnet.com>
List: netbsd-bugs
Date: 01/08/2000 02:27:48
>Number:         9127
>Category:       xsrc
>Synopsis:       CapsLock not properly handled between virtual consoles with X
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    xsrc-manager (NetBSD X11 bug manager)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jan  6 02:50:59 2000
>Last-Modified:
>Originator:     Richard Rauch
>Organization:
  "I probably don't know what I'm talking about."  --rkr@rkr.kcnet.com
>Release:        NetBSD/i386 1.4.1 (1.4 userland)
>Environment:
	
System: NetBSD rkr.kcnet.com 1.4.1 NetBSD 1.4.1 (olibGENERIC) #3: Tue Nov 30 01:09:25 CST 1999 root@rkr.kcnet.com:/usr/src/sys/arch/i386/compile/olibGENERIC i386


>Description:
	With multiple X servers running on virtual consoles, I notice that
	if I enable CapsLock in one server, then flip to another, the LED on
	the keyboard stays on, but the other server misses the CapsLock key.

	Either of two behaviors would seem a fix: Either track the state of
	CapsLock and toggle the LED under virtual console control (probably
	not a portable solution), or else track the state of CapsLock, and send
	necessary state-change events to the console/server when switching.

	NOTE that the text-based consoles appear to correctly do the latter
	option already.  But if switching to, from, or between X servers,
	the CapsLock enable/release events are not passed along.

	Obviously, this may also affect ScrollLock and NumLock; since I never
	use those, I'm not sure if they are affected.

	I tentativelyh put this as an X11 problem since the text consoles are
	not affected by this bug.

>How-To-Repeat:
	With virtual consoles up and running, start at least one X server.
	Then, just to be concrete, in a text console enable CapsLock and type
	a character or two to verify that it's on.  Then switch to the X
	server and type a character.  The LED should still be on, but the
	character should come out lower-case.

	Hit the CapsLock.  Apparently, something in the system knew that the
	current console thought that the CapsLock was released, so the LED
	stays on, and now typing is in all caps...

	I notice some #ifdef's in the code for console switching.  It may be
	useful for you to know that I have all WSDISPLAY_COMPAT_* options
	enabled.

>Fix:
	No fix is available to me.

	The closest thing to a workaround is to hit CapsLock a time or two
	after any console switch.  This at least will force the LED to agree
	with the internal state.  But, since the state is correctly carried
	between text consoles, you still get varying effect after the switch.
>Audit-Trail:
>Unformatted: