From a43eb7357328fbd6666cbab459dcf074f99c6136 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Fri, 17 Feb 2012 13:44:12 -0800 Subject: [PATCH] XQuartz: Short-circuit activateX: This also avoids a deadlock when calling activateX: before the server thread has initialized Signed-off-by: Jeremy Huddleston (cherry picked from commit cb6a32da27f09261c4d561c19d1877c750d98cc3) Conflicts: hw/xquartz/X11Application.m --- hw/xquartz/X11Application.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m index b64ca1dce..213618aaa 100644 --- a/hw/xquartz/X11Application.m +++ b/hw/xquartz/X11Application.m @@ -190,7 +190,11 @@ static void message_kit_thread (SEL selector, NSObject *arg) { - (void) activateX:(OSX_BOOL)state { size_t i; - DEBUG_LOG("state=%d, _x_active=%d, \n", state, _x_active) + + if (_x_active == state) + return; + + DEBUG_LOG("state=%d, _x_active=%d, \n", state, _x_active); if (state) { if(bgMouseLocationUpdated) { DarwinSendPointerEvents(darwinPointer, MotionNotify, 0, bgMouseLocation.x, bgMouseLocation.y, 0.0, 0.0, 0.0);