Comment 1 for bug 194214

Revision history for this message
In , Peter Hutterer (peter-hutterer) wrote :

(In reply to comment #0)
> When some window is opened by some grabbed key, grabbing all keys and they
> destroyed (like the window ratpoison opened uppon C-t :, or the window icewm
> shows when doing Alt-Tab), the xserver is caught in an endless loop within
> PlayReleasedEvents in dix/events.c.

interesting bug... tricky to track down.

The bug only occurs if Xkb triggers an autorepeat. In this case, XkbHandleActions overwrites dev->public.realInputProc with EnqueueEvent. When the device is unfrozen, the realInputProc is written back to the processInputProc and the whole thing craps out.

Here's a preliminary hack to fix it. It stops the loop occuring (tested with ratpoison) but I'm not sure what other implications it has. It most probably is not the correct solution.

diff --git a/include/xkbsrv.h b/include/xkbsrv.h
index 167dbec..9f7f0d6 100644
--- a/include/xkbsrv.h
+++ b/include/xkbsrv.h
@@ -258,7 +258,8 @@ typedef struct
      device->public.processInputProc = proc; \
  oldprocs->processInputProc = \
  oldprocs->realInputProc = device->public.realInputProc; \
- device->public.realInputProc = proc; \
+ if (proc != device->public.enqueueInputProc) \
+ device->public.realInputProc = proc; \
  oldprocs->unwrapProc = device->unwrapProc; \
  device->unwrapProc = unwrapproc;