diff options
author | Jeremy Huddleston Sequoia <jeremyhu@apple.com> | 2012-08-01 18:46:08 -0700 |
---|---|---|
committer | Jeremy Huddleston Sequoia <jeremyhu@apple.com> | 2012-08-03 10:16:28 -0700 |
commit | 631715e12953a392066ca2a0787b37471747f879 (patch) | |
tree | 5641db7fa87db4b2de1dc315eecd290756c99d51 | |
parent | e2df31de390f58211029bd975e8af0169d121737 (diff) |
XQuartz: Fix xp_window_bring_all_to_front linking on OS versions with older libXplugin
Found-by: Tinderbox
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
(cherry picked from commit 884f51e9770c9ccd3b38a14ea393ea2c7a5ef235)
-rw-r--r-- | hw/xquartz/xpr/xprEvent.c | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/hw/xquartz/xpr/xprEvent.c b/hw/xquartz/xpr/xprEvent.c index 73bcc930d..398177ca8 100644 --- a/hw/xquartz/xpr/xprEvent.c +++ b/hw/xquartz/xpr/xprEvent.c @@ -59,13 +59,6 @@ #include "rootlessWindow.h" #include "xprEvent.h" -/* This is important enough to declare here if building against an old - * libXplugin, so we pick it up whenever libXplugin starts to support it. - */ -#if !defined(XPLUGIN_VERSION) || XPLUGIN_VERSION < 6 -extern xp_error xp_window_bring_all_to_front(void) __attribute__((weak_import)); -#endif - Bool QuartzModeEventHandler(int screenNum, XQuartzEvent *e, DeviceIntPtr dev) { @@ -86,21 +79,18 @@ QuartzModeEventHandler(int screenNum, XQuartzEvent *e, DeviceIntPtr dev) /* 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) -#if (defined(XPLUGIN_VERSION_MIN_REQUIRED) && XPLUGIN_VERSION_MIN_REQUIRED >= 6) || \ - (!defined(XPLUGIN_VERSION_MIN_REQUIRED) && defined(XPLUGIN_VERSION) && XPLUGIN_VERSION >= 6) - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ - xp_window_bring_all_to_front(); - }); -#else - if (&xp_window_bring_all_to_front) { - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ - xp_window_bring_all_to_front(); - }); - } else { - RootlessOrderAllWindows(e->data[0]); - } -#endif +#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 |