Re: X and VT-switching bug? [anybody willing to fix X?]

Pavel Machek (
Fri, 12 Dec 1997 23:07:28 +0100

Hi, everyone!

> > Me did, sun ended with keyboard messed up. I managed little messed
> > graphics, too ;-).
> Do they HAVE virtual consoles that you can switch? I didn't notice,
> but then again, I haven't really worked much with Suns and SGIs the
> last year or so.

On sparclinux, yes. Sparclinux has really nice virtual consoles, just
like PC's but without scrollback. And it is one of its biggest
advantages over SunOS: its console is in fact usable.

And yes, if you run Xfree on sparclinux, you can get that box in
pretty bad problems.

> Indeed, you're right. Whenever possible, don't discard keystrokes. If
> it means a lockup/incorrect state of the screen, then that's better
> than nothing.
> To prevent the "discard of keystrokes" the X server should be able to
> keep the keystrokes in the queue, and they should suddenly come out
> "cooked" once the screen is back to "normal".

Which is impossible with current drivers/char/keyboard.c. Codes are
translated as soon as they are pressed, raw mode depends on setting of
console at time key was pressed, not at time character is read. Smells
like design bug?

> > > - on switch-to-X, first tell the kernel (keyboard->raw mode) and
> > > process keystrokes once your're fully switched.
> >
> > Here's race:
> >
> > Alt-F9: switch-to-X
> > X wake up and want to call switch to raw mode
> > Alt-F1: switch to tty1
> > X switch into raw mode, not knowing switch to tty1 happened,
> > yet, they start drawing themselves.
> So, the rules of the game are: If a program needs notifying of a
> console switch, the program notified suddenly is the only one
> responsible for switching away again.

Well, much simpler thing would suffice: X's set keyboard out of raw
mode when switching to other console. That is unneccessary, as
keyboard mode is local to console. If they did not do that, race would
go away. (But problem with discarded characters would remain, and
problem with forgotten shifts too...)

Anybody volunteering to fix X? [Really trivial change, but I do not
have 150Meg of free disk space to recompile X server.]


I'm really 	   Pavel
Look at ;-).