diff options
author | Jeremy Huddleston <jeremyhu@freedesktop.org> | 2009-07-03 19:25:33 -0700 |
---|---|---|
committer | Jeremy Huddleston <jeremyhu@freedesktop.org> | 2009-07-03 19:46:00 -0700 |
commit | d6b8205e699c0c62af76c4a9cbff1402337927b3 (patch) | |
tree | 51d37da6c8af9c8ce7f958c5e43f655bf9205e50 /hw | |
parent | a49ae50370ec94e08e7dec3c742d33e20e79ef36 (diff) |
XQuartz: ProcAppleWMAttachTransient to play nice with the new Dock in SL
(cherry picked from commit ddc0242d8f291d0f961ba9aa8c883e39861ce2ad)
Diffstat (limited to 'hw')
-rw-r--r-- | hw/xquartz/applewm.c | 32 | ||||
-rw-r--r-- | hw/xquartz/applewmExt.h | 2 | ||||
-rw-r--r-- | hw/xquartz/xpr/xprAppleWM.c | 37 |
3 files changed, 69 insertions, 2 deletions
diff --git a/hw/xquartz/applewm.c b/hw/xquartz/applewm.c index 418c5de74..ad3858372 100644 --- a/hw/xquartz/applewm.c +++ b/hw/xquartz/applewm.c @@ -512,6 +512,36 @@ ProcAppleWMSendPSN(register ClientPtr client) } 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 ProcAppleWMSetCanQuit( register ClientPtr client ) @@ -673,6 +703,8 @@ ProcAppleWMDispatch ( return ProcAppleWMFrameDraw(client); case X_AppleWMSendPSN: return ProcAppleWMSendPSN(client); + case X_AppleWMAttachTransient: + return ProcAppleWMAttachTransient(client); default: return BadRequest; } diff --git a/hw/xquartz/applewmExt.h b/hw/xquartz/applewmExt.h index 3fc376639..5ef8b5496 100644 --- a/hw/xquartz/applewmExt.h +++ b/hw/xquartz/applewmExt.h @@ -46,6 +46,7 @@ typedef int (*FrameDrawProc)(WindowPtr pWin, int class, unsigned int attr, unsigned int title_len, const unsigned char *title_bytes); typedef int (*SendPSNProc)(uint32_t hi, uint32_t lo); +typedef int (*AttachTransientProc)(WindowPtr pWinChild, WindowPtr pWinParent); /* * AppleWM implementation function list @@ -58,6 +59,7 @@ typedef struct _AppleWMProcs { FrameHitTestProc FrameHitTest; FrameDrawProc FrameDraw; SendPSNProc SendPSN; + AttachTransientProc AttachTransient; } AppleWMProcsRec, *AppleWMProcsPtr; void AppleWMExtensionInit( diff --git a/hw/xquartz/xpr/xprAppleWM.c b/hw/xquartz/xpr/xprAppleWM.c index 9c44e20a2..0a2571975 100644 --- a/hw/xquartz/xpr/xprAppleWM.c +++ b/hw/xquartz/xpr/xprAppleWM.c @@ -82,6 +82,34 @@ static int xprSetWindowLevel( 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( WindowPtr pWin, @@ -114,9 +142,14 @@ static AppleWMProcsRec xprAppleWMProcs = { xp_frame_get_rect, xp_frame_hit_test, xprFrameDraw, -#if defined(XPLUGIN_VERSION) && XPLUGIN_VERSION >= 2 - xp_set_dock_proxy +#if defined(XPLUGIN_VERSION) && XPLUGIN_VERSION >= 3 + xp_set_dock_proxy, + xprAttachTransient +#elif defined(XPLUGIN_VERSION) && XPLUGIN_VERSION >= 2 + xp_set_dock_proxy, + NULL #else + NULL, NULL #endif }; |