Quick fix for crashing menus

Jukka Heinonen jhei at iki.fi
Fri Nov 23 15:32:51 CST 2001


Here is a simple patch that prevents menus from crashing 
(see wine-devel for details). This patch is quite hacky but
it does fix a single real, verified problem and likely a bunch
of unverified problems. Proper fix would be quite complicated,
at least process_cooked_mouse_message and process_raw_mouse_message
need to be redesigned and possibly also wineserver message queue
routines.

Changelog:
  Prevent some illegal messages when mouse has been captured.


Index: wine/windows/message.c
===================================================================
RCS file: /home/wine/wine/windows/message.c,v
retrieving revision 1.129
diff -u -r1.129 message.c
--- wine/windows/message.c      2001/11/06 22:28:20     1.129
+++ wine/windows/message.c      2001/11/23 19:59:13
@@ -458,6 +458,21 @@
 
     if (remove) update_queue_key_state( raw_message, 0 );
 
+    /*
+     * FIXME: Workaround that prevents some illegal messages
+     *        when enabling capture mode. Real fix should handle
+     *        every different class of illegal messages that can 
+     *        be received when enabling/disabling capture.
+     *        (Hint: These happen because many raw messages
+     *         can be cooked before a cooked message is processed.)
+     */
+    if (GetCapture() &&
+       msg->message >= WM_NCMOUSEFIRST && 
+       msg->message <= WM_NCMOUSELAST)
+    {
+      return FALSE;
+    }
+
     if (HOOK_IsHooked( WH_MOUSE ))
     {
         MOUSEHOOKSTRUCT hook;


-- 
Jukka Heinonen <http://www.iki.fi/jhei/>




More information about the wine-patches mailing list