XkbSetDetectableAutoRepeat not working on some platforms

F Capela fabio.capela at yahoo.com
Sat Jul 18 21:57:29 CDT 2009


XkbSetDetectableAutoRepeat is not working correctly on some distributions, including Ubuntu 9.04. In practical terms, this means programs running under Wine on such distros are unable to ignore autorepeat, doing strange things to games that use keyboard controls, for example. One way to work around the problem is to manually filter out the key release messages, which can be done with a few extra lines in dlls/winex11.drv/event.c . My question is, should I send a patch enabling this filtering? From what I have seen, patches to work around bugs that are clearly outside Wine are usually not accepted.

I'm adding the patch inlined in this message for those that might want to look at it; if I feel the patch do have a chance to be accepted I will resend to wine-patches.

Fábio Oliveira Schmidt Capela
fabio.capela at yahoo.com

diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c
index a965b9f..793b842 100644
--- a/dlls/winex11.drv/event.c
+++ b/dlls/winex11.drv/event.c
@@ -283,6 +283,13 @@ static enum event_merge_action merge_events( XEvent *prev, XEvent *next )
             return MERGE_DISCARD;
         }
         break;
+    case KeyRelease:
+        if (prev->xany.window == next->xany.window && next->type == KeyPress && next->xkey.time == prev->xkey.time && next->xkey.keycode == prev->xkey.keycode && next->xkey.state == prev->xkey.state)
+        {
+            TRACE( "Discarding autorepeat key release for window %lx\n", prev->xany.window );
+            return MERGE_DISCARD;
+        }
+        break;
     }
     return MERGE_HANDLE;
 }


      



More information about the wine-devel mailing list