[Xquartz-changes] xserver: Branch 'master'

Jeremy Huddleston jeremyhu at freedesktop.org
Wed Jul 25 12:05:24 PDT 2012


 hw/xquartz/xpr/xprEvent.c |   20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

New commits:
commit 0efd6d9a1217aa6da84d0dd509f219b338ee434b
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Wed Jul 25 11:40:33 2012 -0700

    XQuartz: Call xp_window_bring_all_to_front if available in libXplugin
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/hw/xquartz/xpr/xprEvent.c b/hw/xquartz/xpr/xprEvent.c
index 106a919..ffbc4f6 100644
--- a/hw/xquartz/xpr/xprEvent.c
+++ b/hw/xquartz/xpr/xprEvent.c
@@ -52,6 +52,10 @@
 #include <sys/uio.h>
 #include <unistd.h>
 
+#ifdef HAVE_LIBDISPATCH
+#include <dispatch/dispatch.h>
+#endif
+
 #include "rootlessWindow.h"
 #include "xprEvent.h"
 
@@ -73,6 +77,22 @@ QuartzModeEventHandler(int screenNum, XQuartzEvent *e, DeviceIntPtr dev)
     case kXquartzBringAllToFront:
         DEBUG_LOG("kXquartzBringAllToFront\n");
         RootlessOrderAllWindows(e->data[0]);
+
+        /* There's no need to do xp_window_bring_all_to_front on Leopard,
+         * and we don't care about the result, so just do it async.
+         */
+#if defined(HAVE_LIBDISPATCH) && defined(XPLUGIN_VERSION) && XPLUGIN_VERSION >= 6
+        dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+#if !defined(XPLUGIN_VERSION_MIN_REQUIRED) || XPLUGIN_VERSION_MIN_REQUIRED >= 6
+            xp_window_bring_all_to_front();
+#else
+            if (&xp_window_bring_all_to_front) {
+                xp_window_bring_all_to_front();
+            }
+#endif
+        });
+#endif
+
         return TRUE;
 
     default:


More information about the Xquartz-changes mailing list