From fa9847aeb9094aafc3798aee1fc8379e77a18d6a Mon Sep 17 00:00:00 2001 From: Torrey Lyons Date: Fri, 8 Oct 2004 00:35:08 +0000 Subject: Allow rootless implementations to override frame reordering. This is used on Mac OS X when genie-restoring from the Dock to ensure that the animation completes before drawing the frame. --- miext/rootless/rootless.h | 15 +++++++++++++++ miext/rootless/rootlessWindow.c | 13 +++++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) (limited to 'miext') diff --git a/miext/rootless/rootless.h b/miext/rootless/rootless.h index d87b08da1..7612f00fa 100644 --- a/miext/rootless/rootless.h +++ b/miext/rootless/rootless.h @@ -266,6 +266,20 @@ typedef void (*RootlessDamageRectsProc) typedef void (*RootlessSwitchWindowProc) (RootlessWindowPtr pFrame, WindowPtr oldWin); +/* + * Check if window should be reordered. (Optional) + * The underlying window system may animate windows being ordered in. + * We want them to be mapped but remain ordered out until the animation + * completes. If defined this function will be called to check if a + * framed window should be reordered now. If this function returns + * FALSE, the window will still be mapped from the X11 perspective, but + * the RestackFrame function will not be called for its frame. + * + * pFrame Frame to reorder + */ +typedef Bool (*RootlessDoReorderWindowProc) + (RootlessWindowPtr pFrame); + /* * Copy bytes. (Optional) * Source and destinate may overlap and the right thing should happen. @@ -354,6 +368,7 @@ typedef struct _RootlessFrameProcs { /* Optional frame functions */ RootlessSwitchWindowProc SwitchWindow; + RootlessDoReorderWindowProc DoReorderWindow; /* Optional acceleration functions */ RootlessCopyBytesProc CopyBytes; diff --git a/miext/rootless/rootlessWindow.c b/miext/rootless/rootlessWindow.c index e8071bf02..334ac3f5e 100644 --- a/miext/rootless/rootlessWindow.c +++ b/miext/rootless/rootlessWindow.c @@ -1,4 +1,4 @@ -/* $XdotOrg: xc/programs/Xserver/miext/rootless/rootlessWindow.c,v 1.2 2004/04/23 19:54:27 eich Exp $ */ +/* $XdotOrg: xc/programs/Xserver/miext/rootless/rootlessWindow.c,v 1.3 2004/07/30 19:12:17 torrey Exp $ */ /* * Rootless window management */ @@ -481,7 +481,7 @@ RootlessUnrealizeWindow(WindowPtr pWin) /* * RootlessReorderWindow - * Reorder the window associated with the given frame so that it's + * Reorder the frame associated with the given window so that it's * physically above the window below it in the X stacking order. */ void @@ -495,6 +495,15 @@ RootlessReorderWindow(WindowPtr pWin) RootlessFrameID newPrevID; ScreenPtr pScreen = pWin->drawable.pScreen; + /* Check if the implementation wants the frame to not be reordered + even though the X11 window is restacked. This can be useful if + frames are ordered-in with animation so that the reordering is not + done until the animation is complete. */ + if (SCREENREC(pScreen)->imp->DoReorderWindow) { + if (!SCREENREC(pScreen)->imp->DoReorderWindow(winRec)) + return; + } + RootlessStopDrawing(pWin, FALSE); /* Find the next window above this one that has a mapped frame. */ -- cgit v1.2.3