diff options
Diffstat (limited to 'hw/xquartz/xpr/xprEvent.c')
-rw-r--r-- | hw/xquartz/xpr/xprEvent.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/hw/xquartz/xpr/xprEvent.c b/hw/xquartz/xpr/xprEvent.c index 106a91931..398177ca8 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" @@ -72,7 +76,25 @@ QuartzModeEventHandler(int screenNum, XQuartzEvent *e, DeviceIntPtr dev) case kXquartzBringAllToFront: DEBUG_LOG("kXquartzBringAllToFront\n"); + /* 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 +# if defined(XPLUGIN_VERSION_MIN_REQUIRED) && XPLUGIN_VERSION_MIN_REQUIRED < 6 + if (&xp_window_bring_all_to_front) { +# endif + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ + xp_window_bring_all_to_front(); + }); +# if defined(XPLUGIN_VERSION_MIN_REQUIRED) && XPLUGIN_VERSION_MIN_REQUIRED < 6 + } else { + RootlessOrderAllWindows(e->data[0]); + } +# endif +#else RootlessOrderAllWindows(e->data[0]); +#endif + return TRUE; default: |