From 31907986a6d4dc726d8ce0071f5884ce6cfea33b Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Fri, 31 Oct 2008 12:37:32 -0700 Subject: [PATCH] XQuartz: Fixed Xplugin thread safety issues, so rea-enable background window check (cherry picked from commit 5fc73b1141eca8b678e54412ca33afa31a76d088) --- hw/xquartz/X11Application.m | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m index b882b5589..cd77b63f4 100644 --- a/hw/xquartz/X11Application.m +++ b/hw/xquartz/X11Application.m @@ -967,23 +967,21 @@ static void send_nsevent(NSEvent *e) { pDev = darwinTabletCurrent; } -#if 0 // XPlugin isn't thread safe ... sigh if(!quartzServerVisible) { xp_window_id wid; - + /* Sigh. Need to check that we're really over one of * our windows. (We need to receive pointer events while - * not in the foreground, and the only way to do that - * right now is to ask for _all_ pointer events..) + * not in the foreground, but we don't want to receive them + * when another window is over us or we might show a tooltip) */ wid = 0; - xp_find_window(pointer_x, pointer_y, 0, &wid); - if (wid == 0) + if (xp_find_window(pointer_x, pointer_y, 0, &wid) == XP_Success && + wid == 0) return; } -#endif DarwinSendPointerEvents(pDev, ev_type, ev_button, pointer_x, pointer_y, pressure, tilt_x, tilt_y);