logo       

repeating keys problem SOLVED (bug in xfree86) ... new PROSPECT for Sawfish: msg#00159

window-managers.sawfish

Subject: repeating keys problem SOLVED (bug in xfree86) ... new PROSPECT for Sawfish!


after a frenzy (and very long, 18 months?) investigation, I've finally solved
the problem!



Explanation:
============

1/ XKB-enabled Xfree86 implements key repeating in software (w/ timers). When a
hardware Key Release arrives, the software timer is canceled.


2/
Xfree86 implements key(board) grabs in GrabModeSync w/ switching a pointer

dev->public.processInputProc to either
dev->public.enqueueInputProc ... events are put in a queue for later
processing
or
dev->public.realInputProc



The problem is, that the public.enqueueInputProc (which is EnqueueEvent() in
xc/programs/Xserver/dix/events.c) does not invoke function
AccessXCancelRepeatKey(), which cancels the timer.

So, if at the right time (i.e. when key Release is signalled from
hardware/kernel), the pointer still points at EnqueueEvent, the timer is not
cancelled, is (later) run, and generates a pair of Release/Press events, and
reschedules itself (so it can happen more times).

I've made a quick fix, basically adding into the EnqueueEvent:

if (xE->u.u.type==KeyRelease)
AccessXCancelRepeatKey(xkbi,key);

I'll post to Xfree86 mailing list, too.



New possibilities for Sawfish:
===============================

I'm very interested in incorporating (more) commands/functions equipped with
grab-keyboard into sawfish.

Input focus can be changed during GrabModeSync keyboard grab, and that can be
exploited in 'making sawfish reliable', i.e. avoid losing key events or having
them directed to wrong windows.

So, there needs to be direct access from scheme to XSetInputFocus
(commit_queued_focus_change is not good); XUngrabKeyboard (in on_idle() ) and
various XAllowEvents should be made conditional.

With those modifications, it is possibly to work without controlling (visually)
whether the xterm is already opened, focus is already changed etc....


i can be reached on irc: #sawfish irc.freenode.net


Michal Maruska

--
http://maruska.dyndns.org




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise