XQuartz: ProcAppleWMAttachTransient to play nice with the new Dock in SL
This commit is contained in:
parent
f651d98db5
commit
ddc0242d8f
|
@ -1678,7 +1678,7 @@ if test "x$XQUARTZ" = xyes; then
|
||||||
|
|
||||||
CFLAGS="${CFLAGS} -DROOTLESS_WORKAROUND -DROOTLESS_SAFEALPHA -DNO_ALLOCA"
|
CFLAGS="${CFLAGS} -DROOTLESS_WORKAROUND -DROOTLESS_SAFEALPHA -DNO_ALLOCA"
|
||||||
|
|
||||||
PKG_CHECK_MODULES(XPBPROXY, [applewmproto >= 1.2] [applewm >= 1.2] xfixes fixesproto x11)
|
PKG_CHECK_MODULES(XPBPROXY, [applewmproto >= 1.3] [applewm >= 1.3] xfixes fixesproto x11)
|
||||||
|
|
||||||
if test "x$STANDALONE_XPBPROXY" = xyes ; then
|
if test "x$STANDALONE_XPBPROXY" = xyes ; then
|
||||||
AC_DEFINE(STANDALONE_XPBPROXY,1,[Build a standalone xpbproxy])
|
AC_DEFINE(STANDALONE_XPBPROXY,1,[Build a standalone xpbproxy])
|
||||||
|
|
|
@ -523,6 +523,36 @@ ProcAppleWMSendPSN(register ClientPtr client)
|
||||||
return (client->noClientException);
|
return (client->noClientException);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
ProcAppleWMAttachTransient(register ClientPtr client)
|
||||||
|
{
|
||||||
|
WindowPtr pWinChild, pWinParent;
|
||||||
|
REQUEST(xAppleWMAttachTransientReq);
|
||||||
|
int err;
|
||||||
|
|
||||||
|
REQUEST_SIZE_MATCH(xAppleWMAttachTransientReq);
|
||||||
|
|
||||||
|
if(!appleWMProcs->AttachTransient)
|
||||||
|
return BadRequest;
|
||||||
|
|
||||||
|
if (Success != dixLookupWindow(&pWinChild, stuff->child, client, DixReadAccess))
|
||||||
|
return BadValue;
|
||||||
|
|
||||||
|
if(stuff->parent) {
|
||||||
|
if(Success != dixLookupWindow(&pWinParent, stuff->parent, client, DixReadAccess))
|
||||||
|
return BadValue;
|
||||||
|
} else {
|
||||||
|
pWinParent = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
err = appleWMProcs->AttachTransient(pWinChild, pWinParent);
|
||||||
|
if (err != Success) {
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (client->noClientException);
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcAppleWMSetCanQuit(
|
ProcAppleWMSetCanQuit(
|
||||||
register ClientPtr client
|
register ClientPtr client
|
||||||
|
@ -685,6 +715,8 @@ ProcAppleWMDispatch (
|
||||||
return ProcAppleWMFrameDraw(client);
|
return ProcAppleWMFrameDraw(client);
|
||||||
case X_AppleWMSendPSN:
|
case X_AppleWMSendPSN:
|
||||||
return ProcAppleWMSendPSN(client);
|
return ProcAppleWMSendPSN(client);
|
||||||
|
case X_AppleWMAttachTransient:
|
||||||
|
return ProcAppleWMAttachTransient(client);
|
||||||
default:
|
default:
|
||||||
return BadRequest;
|
return BadRequest;
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,6 +46,7 @@ typedef int (*FrameDrawProc)(WindowPtr pWin, int class, unsigned int attr,
|
||||||
unsigned int title_len,
|
unsigned int title_len,
|
||||||
const unsigned char *title_bytes);
|
const unsigned char *title_bytes);
|
||||||
typedef int (*SendPSNProc)(uint32_t hi, uint32_t lo);
|
typedef int (*SendPSNProc)(uint32_t hi, uint32_t lo);
|
||||||
|
typedef int (*AttachTransientProc)(WindowPtr pWinChild, WindowPtr pWinParent);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* AppleWM implementation function list
|
* AppleWM implementation function list
|
||||||
|
@ -58,6 +59,7 @@ typedef struct _AppleWMProcs {
|
||||||
FrameHitTestProc FrameHitTest;
|
FrameHitTestProc FrameHitTest;
|
||||||
FrameDrawProc FrameDraw;
|
FrameDrawProc FrameDraw;
|
||||||
SendPSNProc SendPSN;
|
SendPSNProc SendPSN;
|
||||||
|
AttachTransientProc AttachTransient;
|
||||||
} AppleWMProcsRec, *AppleWMProcsPtr;
|
} AppleWMProcsRec, *AppleWMProcsPtr;
|
||||||
|
|
||||||
void AppleWMExtensionInit(
|
void AppleWMExtensionInit(
|
||||||
|
|
|
@ -82,6 +82,34 @@ static int xprSetWindowLevel(
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(XPLUGIN_VERSION) && XPLUGIN_VERSION >= 3
|
||||||
|
static int xprAttachTransient(WindowPtr pWinChild, WindowPtr pWinParent) {
|
||||||
|
xp_window_id child_wid, parent_wid;
|
||||||
|
xp_window_changes wc;
|
||||||
|
|
||||||
|
child_wid = x_cvt_vptr_to_uint(RootlessFrameForWindow(pWinChild, TRUE));
|
||||||
|
if (child_wid == 0)
|
||||||
|
return BadWindow;
|
||||||
|
|
||||||
|
if(pWinParent) {
|
||||||
|
parent_wid = x_cvt_vptr_to_uint(RootlessFrameForWindow(pWinParent, TRUE));
|
||||||
|
if (parent_wid == 0)
|
||||||
|
return BadWindow;
|
||||||
|
} else {
|
||||||
|
parent_wid = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
wc.transient_for = parent_wid;
|
||||||
|
|
||||||
|
RootlessStopDrawing (pWinChild, FALSE);
|
||||||
|
|
||||||
|
if (xp_configure_window(child_wid, XP_ATTACH_TRANSIENT, &wc) != Success) {
|
||||||
|
return BadValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Success;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static int xprFrameDraw(
|
static int xprFrameDraw(
|
||||||
WindowPtr pWin,
|
WindowPtr pWin,
|
||||||
|
@ -114,9 +142,14 @@ static AppleWMProcsRec xprAppleWMProcs = {
|
||||||
xp_frame_get_rect,
|
xp_frame_get_rect,
|
||||||
xp_frame_hit_test,
|
xp_frame_hit_test,
|
||||||
xprFrameDraw,
|
xprFrameDraw,
|
||||||
#if defined(XPLUGIN_VERSION) && XPLUGIN_VERSION >= 2
|
#if defined(XPLUGIN_VERSION) && XPLUGIN_VERSION >= 3
|
||||||
xp_set_dock_proxy
|
xp_set_dock_proxy,
|
||||||
|
xprAttachTransient
|
||||||
|
#elif defined(XPLUGIN_VERSION) && XPLUGIN_VERSION >= 2
|
||||||
|
xp_set_dock_proxy,
|
||||||
|
NULL
|
||||||
#else
|
#else
|
||||||
|
NULL,
|
||||||
NULL
|
NULL
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user