Take into account window visibility when searching for a target for a hardware mouse message

Dmitry Timoshkov dmitry at baikal.ru
Tue Oct 19 19:23:44 CDT 2004


Hello,

this patch fixes a crash in the app I'm working on.

Changelog:
    Dmitry Timoshkov <dmitry at codeweavers.com>
    Take into account window visibility when searching for a target
    for a hardware mouse message.

diff -u cvs/hq/wine/server/queue.c wine/server/queue.c
--- cvs/hq/wine/server/queue.c	2004-06-23 15:42:38.000000000 +0900
+++ wine/server/queue.c	2004-10-20 09:10:20.000000000 +0900
@@ -1083,7 +1083,8 @@ static user_handle_t find_hardware_messa
     {
         if (!input || !(win = input->capture))
         {
-            if (!(win = msg->win)) win = window_from_point( msg->x, msg->y );
+            if (!(win = msg->win) || !is_visible_window( win ))
+                win = window_from_point( msg->x, msg->y );
         }
     }
     return win;
diff -u cvs/hq/wine/server/user.h wine/server/user.h
--- cvs/hq/wine/server/user.h	2004-09-20 14:26:54.000000000 +0900
+++ wine/server/user.h	2004-10-19 16:19:08.000000000 +0900
@@ -96,6 +96,7 @@ static inline struct region *create_empt
 extern void destroy_thread_windows( struct thread *thread );
 extern int is_child_window( user_handle_t parent, user_handle_t child );
 extern int is_top_level_window( user_handle_t window );
+extern int is_visible_window( user_handle_t window );
 extern int make_window_active( user_handle_t window );
 extern struct thread *get_window_thread( user_handle_t handle );
 extern user_handle_t window_from_point( int x, int y );
diff -u cvs/hq/wine/server/window.c wine/server/window.c
--- cvs/hq/wine/server/window.c	2004-09-20 14:26:54.000000000 +0900
+++ wine/server/window.c	2004-10-19 16:20:15.000000000 +0900
@@ -392,6 +392,13 @@ int is_top_level_window( user_handle_t w
     return (win && win->parent == top_window);
 }
 
+/* check whether window is visible */
+int is_visible_window( user_handle_t window )
+{
+    struct window *win = get_user_object( window, USER_WINDOW );
+    return (win && (win->style & WS_VISIBLE));
+}
+
 /* make a window active if possible */
 int make_window_active( user_handle_t window )
 {






More information about the wine-patches mailing list