From daa9727a02701cfac7b92f3e61d752be6fcc005e Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Wed, 4 Mar 2009 11:33:00 -0800 Subject: XQuartz: Implement SendPSN for AppleWM (cherry picked from commit 779e9fdc2de9bfebc5f0a4c9d5f42e389fdd8593) --- configure.ac | 2 +- hw/xquartz/applewm.c | 20 ++++++++++++++++++++ hw/xquartz/applewmExt.h | 2 ++ hw/xquartz/xpr/xprAppleWM.c | 8 ++++++-- 4 files changed, 29 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index affbea07b..f68843f03 100644 --- a/configure.ac +++ b/configure.ac @@ -1634,7 +1634,7 @@ if test "x$XQUARTZ" = xyes; then CFLAGS="${CFLAGS} -DROOTLESS_WORKAROUND -DNO_ALLOCA" - PKG_CHECK_MODULES(XPBPROXY, [applewmproto >= 1.1.1] [applewm >= 1.0.0] xfixes fixesproto x11) + PKG_CHECK_MODULES(XPBPROXY, [applewmproto >= 1.2] [applewm >= 1.2] xfixes fixesproto x11) if test "x$STANDALONE_XPBPROXY" = xyes ; then AC_DEFINE(STANDALONE_XPBPROXY,1,[Build a standalone xpbproxy]) diff --git a/hw/xquartz/applewm.c b/hw/xquartz/applewm.c index 238b90d50..ef67dd482 100644 --- a/hw/xquartz/applewm.c +++ b/hw/xquartz/applewm.c @@ -492,6 +492,24 @@ ProcAppleWMSetWindowLevel(register ClientPtr client) return (client->noClientException); } +static int +ProcAppleWMSendPSN(register ClientPtr client) +{ + REQUEST(xAppleWMSendPSNReq); + int err; + + REQUEST_SIZE_MATCH(xAppleWMSendPSNReq); + + if(appleWMProcs->SendPSN) { + err = appleWMProcs->SendPSN(stuff->psn_hi, stuff->psn_lo); + if (err != Success) { + return err; + } + } + + return (client->noClientException); +} + static int ProcAppleWMSetCanQuit( register ClientPtr client @@ -652,6 +670,8 @@ ProcAppleWMDispatch ( return ProcAppleWMFrameHitTest(client); case X_AppleWMFrameDraw: return ProcAppleWMFrameDraw(client); + case X_AppleWMSendPSN: + return ProcAppleWMSendPSN(client); default: return BadRequest; } diff --git a/hw/xquartz/applewmExt.h b/hw/xquartz/applewmExt.h index 60d49ef59..3fc376639 100644 --- a/hw/xquartz/applewmExt.h +++ b/hw/xquartz/applewmExt.h @@ -45,6 +45,7 @@ typedef int (*FrameDrawProc)(WindowPtr pWin, int class, unsigned int attr, const BoxRec *outer, const BoxRec *inner, unsigned int title_len, const unsigned char *title_bytes); +typedef int (*SendPSNProc)(uint32_t hi, uint32_t lo); /* * AppleWM implementation function list @@ -56,6 +57,7 @@ typedef struct _AppleWMProcs { FrameGetRectProc FrameGetRect; FrameHitTestProc FrameHitTest; FrameDrawProc FrameDraw; + SendPSNProc SendPSN; } AppleWMProcsRec, *AppleWMProcsPtr; void AppleWMExtensionInit( diff --git a/hw/xquartz/xpr/xprAppleWM.c b/hw/xquartz/xpr/xprAppleWM.c index fae9a0422..fb506986c 100644 --- a/hw/xquartz/xpr/xprAppleWM.c +++ b/hw/xquartz/xpr/xprAppleWM.c @@ -104,14 +104,18 @@ static int xprFrameDraw( return Success; } - static AppleWMProcsRec xprAppleWMProcs = { xp_disable_update, xp_reenable_update, xprSetWindowLevel, xp_frame_get_rect, xp_frame_hit_test, - xprFrameDraw + xprFrameDraw, +#if defined(XPLUGIN_VERSION) && XPLUGIN_VERSION >= 2 + xp_set_dock_proxy +#else + NULL +#endif }; -- cgit v1.2.3