[PATCH] winex11.drv: Stop assuming that GenericEvent has a window.

Rémi Bernon rbernon at codeweavers.com
Mon Feb 15 04:17:51 CST 2021


It doesn't, and we then lookup HWND from an invalid Window value.

Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---
 dlls/winex11.drv/event.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c
index d21d2a7fb1b..695e71b690f 100644
--- a/dlls/winex11.drv/event.c
+++ b/dlls/winex11.drv/event.c
@@ -390,8 +390,8 @@ static inline BOOL call_event_handler( Display *display, XEvent *event )
         return FALSE;  /* no handler, ignore it */
     }
 
-    if (XFindContext( display, event->xany.window, winContext, (char **)&hwnd ) != 0)
-        hwnd = 0;  /* not for a registered window */
+    if (event->type == GenericEvent || XFindContext( display, event->xany.window, winContext, (char **)&hwnd ))
+        hwnd = NULL;  /* not for a registered window */
     if (!hwnd && event->xany.window == root_window) hwnd = GetDesktopWindow();
 
     TRACE( "%lu %s for hwnd/window %p/%lx\n",
-- 
2.30.0




More information about the wine-devel mailing list