summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremyhu@freedesktop.org>2009-03-04 11:33:00 -0800
committerJeremy Huddleston <jeremyhu@freedesktop.org>2009-03-04 13:39:43 -0800
commitdaa9727a02701cfac7b92f3e61d752be6fcc005e (patch)
treef6d5e1d07f93c5cde1bc5d8b277d65b8e9d8cc19
parentce6e1771be5f2c21af6f72a9705795df26210413 (diff)
XQuartz: Implement SendPSN for AppleWM
(cherry picked from commit 779e9fdc2de9bfebc5f0a4c9d5f42e389fdd8593)
-rw-r--r--configure.ac2
-rw-r--r--hw/xquartz/applewm.c20
-rw-r--r--hw/xquartz/applewmExt.h2
-rw-r--r--hw/xquartz/xpr/xprAppleWM.c8
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
@@ -493,6 +493,24 @@ ProcAppleWMSetWindowLevel(register ClientPtr client)
}
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
};