This is the mail archive of the cygwin-xfree mailing list for the Cygwin XFree86 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH:


There seem to be a couple of reported problem which seem to be due to the fact that virtual core keyboard doesn't get the updated with the state of the windows keyboard device until the first keypress. This can lead to oddness in the behaviour of clients started from bash in a DOS window before the X server receives a keypress...

This seems to be responsible for the problem reported with xemacs[1], and a least part of the oddness with autorepeat reported in [2]

Attached patch works around this by forcing the state to be copied into the VCK at startup time.

[1] http://cygwin.com/ml/cygwin-xfree/2008-12/msg00048.html
[2] http://cygwin.com/ml/cygwin-xfree/2008-11/msg00392.html
Cygwin: Force keyboard state onto VCK at startup

Copy the state of the Windows keyboard device to the Virtual Core Keyboard at startup.

Otherwise, this happens lazily after the first keypress, which can lead to applications
which are started from a shell window and inspect the keyboard state before a character is
typed getting the wrong idea about the desired keymap (e.g. xemacs shows this behaviour)

Also give the native keyboard/mouse devices names

---
 xserver/hw/xwin/InitInput.c |    3 +++
 xserver/hw/xwin/winkeybd.c  |    6 ++++++
 2 files changed, 9 insertions(+)

Index: xorg-server-1.5.3/xserver/hw/xwin/InitInput.c
===================================================================
--- xorg-server-1.5.3.orig/xserver/hw/xwin/InitInput.c	2008-11-17 20:56:03.000000000 +0000
+++ xorg-server-1.5.3/xserver/hw/xwin/InitInput.c	2008-12-11 16:27:29.109375000 +0000
@@ -31,6 +31,7 @@
 #endif
 #include "win.h"
 #include "dixstruct.h"
+#include "inputstr.h"
 
 
 /*
@@ -149,6 +150,8 @@
   RegisterPointerDevice (pMouse);
   RegisterKeyboardDevice (pKeyboard);
 
+  pMouse->name = strdup("Windows mouse");
+  pKeyboard->name = strdup("Windows keyboard");
 
   mieqInit ();
 
Index: xorg-server-1.5.3/xserver/hw/xwin/winkeybd.c
===================================================================
--- xorg-server-1.5.3.orig/xserver/hw/xwin/winkeybd.c	2008-11-27 22:23:42.000000000 +0000
+++ xorg-server-1.5.3/xserver/hw/xwin/winkeybd.c	2008-12-16 18:20:35.015625000 +0000
@@ -288,12 +288,18 @@
             {  
               winErrorFVerb (1, "winKeybdProc - Error initializing keyboard AutoRepeat (No XKB)\n");
             }
+
+	  XkbSetExtension(pDeviceInt, ProcessKeyboardEvent);
         }
 #endif
       break;
       
     case DEVICE_ON: 
       pDevice->on = TRUE;
+
+      // immediately copy the state of this keyboard device to the VCK
+      // (which otherwise happens lazily after the first keypress)
+      SwitchCoreKeyboard(pDeviceInt);
       break;
 
     case DEVICE_CLOSE:

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://x.cygwin.com/docs/
FAQ:                   http://x.cygwin.com/docs/faq/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]