[xorg-commit-diffs] xc/programs/Xserver/hw/xwin winkeybd.c, 1.1.4.1.2.8, 1.1.4.1.2.9

Alexander Gottwald xorg-commit at pdx.freedesktop.org
Mon Apr 12 14:49:06 PDT 2004


Committed by: ago

Update of /cvs/xorg/xc/programs/Xserver/hw/xwin
In directory pdx:/tmp/cvs-serv15699

Modified Files:
      Tag: CYGWIN
	winkeybd.c 
Log Message:
fix rare segfault caused by uninitialized event queue.
Happend if FatalError Messagebox appeared because of missing font "fixed"


Index: winkeybd.c
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/winkeybd.c,v
retrieving revision 1.1.4.1.2.8
retrieving revision 1.1.4.1.2.9
diff -u -d -r1.1.4.1.2.8 -r1.1.4.1.2.9
--- a/winkeybd.c	10 Apr 2004 06:18:29 -0000	1.1.4.1.2.8
+++ b/winkeybd.c	12 Apr 2004 21:49:04 -0000	1.1.4.1.2.9
@@ -359,14 +359,21 @@
 winRestoreModeKeyStates ()
 {
   DWORD			dwKeyState;
+  BOOL			processEvents = TRUE;
   unsigned short	internalKeyStates;
 
   /* X server is being initialized */
   if (!g_winInternalModeKeyStatesPtr)
     return;
 
+  /* Only process events if the rootwindow is mapped. The keyboard events
+   * will cause segfaults otherwise */
+  if (WindowTable && WindowTable[0] && WindowTable[0]->mapped == FALSE)
+    processEvents = FALSE;    
+  
   /* Force to process all pending events in the mi event queue */
-  mieqProcessInputEvents ();
+  if (processEvents)
+    mieqProcessInputEvents ();
   
   /* Read the mode key states of our X server */
   internalKeyStates = *g_winInternalModeKeyStatesPtr;




More information about the xorg-commit-diffs mailing list