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.
This commit is contained in:
parent
d737bc3300
commit
fa9847aeb9
|
@ -40,6 +40,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
#include "windowstr.h"
|
#include "windowstr.h"
|
||||||
#include "servermd.h"
|
#include "servermd.h"
|
||||||
#include "swaprep.h"
|
#include "swaprep.h"
|
||||||
|
#include "propertyst.h"
|
||||||
#include "Xatom.h"
|
#include "Xatom.h"
|
||||||
#include "darwin.h"
|
#include "darwin.h"
|
||||||
#define _APPLEWM_SERVER_
|
#define _APPLEWM_SERVER_
|
||||||
|
@ -58,6 +59,7 @@ static Atom func (void) { \
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFINE_ATOM_HELPER(xa_native_screen_origin, "_NATIVE_SCREEN_ORIGIN")
|
DEFINE_ATOM_HELPER(xa_native_screen_origin, "_NATIVE_SCREEN_ORIGIN")
|
||||||
|
DEFINE_ATOM_HELPER (xa_apple_no_order_in, "_APPLE_NO_ORDER_IN")
|
||||||
|
|
||||||
static AppleWMProcsPtr appleWMProcs;
|
static AppleWMProcsPtr appleWMProcs;
|
||||||
|
|
||||||
|
@ -152,6 +154,29 @@ AppleWMSetScreenOrigin(
|
||||||
32, PropModeReplace, 2, data, TRUE);
|
32, PropModeReplace, 2, data, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Window managers can set the _APPLE_NO_ORDER_IN property on windows
|
||||||
|
that are being genie-restored from the Dock. We want them to
|
||||||
|
be mapped but remain ordered-out until the animation
|
||||||
|
completes (when the Dock will order them in). */
|
||||||
|
Bool
|
||||||
|
AppleWMDoReorderWindow(
|
||||||
|
WindowPtr pWin
|
||||||
|
)
|
||||||
|
{
|
||||||
|
Atom atom;
|
||||||
|
PropertyPtr prop;
|
||||||
|
|
||||||
|
atom = xa_apple_no_order_in();
|
||||||
|
for (prop = wUserProps(pWin); prop != NULL; prop = prop->next)
|
||||||
|
{
|
||||||
|
if (prop->propertyName == atom && prop->type == atom)
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcAppleWMQueryVersion(
|
ProcAppleWMQueryVersion(
|
||||||
register ClientPtr client
|
register ClientPtr client
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
|
||||||
Copyright (c) 2002 Apple Computer, Inc. All Rights Reserved.
|
Copyright (c) 2002 Apple Computer, Inc. All Rights Reserved.
|
||||||
Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved.
|
Copyright (c) 2003-2004 Torrey T. Lyons. All Rights Reserved.
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a
|
Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
copy of this software and associated documentation files (the
|
copy of this software and associated documentation files (the
|
||||||
|
@ -69,6 +69,10 @@ void AppleWMSetScreenOrigin(
|
||||||
WindowPtr pWin
|
WindowPtr pWin
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Bool AppleWMDoReorderWindow(
|
||||||
|
WindowPtr pWin
|
||||||
|
);
|
||||||
|
|
||||||
void AppleWMSendEvent(
|
void AppleWMSendEvent(
|
||||||
int /* type */,
|
int /* type */,
|
||||||
unsigned int /* mask */,
|
unsigned int /* mask */,
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
* holders shall not be used in advertising or otherwise to promote the sale,
|
* holders shall not be used in advertising or otherwise to promote the sale,
|
||||||
* use or other dealings in this Software without prior written authorization.
|
* use or other dealings in this Software without prior written authorization.
|
||||||
*/
|
*/
|
||||||
/* $XdotOrg$ */
|
/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/cr/crFrame.m,v 1.2 2004/04/23 19:15:51 eich Exp $ */
|
||||||
/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/cr/crFrame.m,v 1.9 2004/03/19 02:05:29 torrey Exp $ */
|
/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/cr/crFrame.m,v 1.9 2004/03/19 02:05:29 torrey Exp $ */
|
||||||
|
|
||||||
#include "quartzCommon.h"
|
#include "quartzCommon.h"
|
||||||
|
@ -36,6 +36,7 @@
|
||||||
#undef BOOL
|
#undef BOOL
|
||||||
#define BOOL xBOOL
|
#define BOOL xBOOL
|
||||||
#include "rootless.h"
|
#include "rootless.h"
|
||||||
|
#include "applewmExt.h"
|
||||||
#include "windowstr.h"
|
#include "windowstr.h"
|
||||||
#undef BOOL
|
#undef BOOL
|
||||||
|
|
||||||
|
@ -389,6 +390,17 @@ CRDamageRects(RootlessFrameID wid, int count, const BoxRec *rects,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Called to check if the frame should be reordered when it is restacked.
|
||||||
|
*/
|
||||||
|
Bool CRDoReorderWindow(RootlessWindowPtr pFrame)
|
||||||
|
{
|
||||||
|
WindowPtr pWin = pFrame->win;
|
||||||
|
|
||||||
|
return AppleWMDoReorderWindow(pWin);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static RootlessFrameProcsRec CRRootlessProcs = {
|
static RootlessFrameProcsRec CRRootlessProcs = {
|
||||||
CRCreateFrame,
|
CRCreateFrame,
|
||||||
CRDestroyFrame,
|
CRDestroyFrame,
|
||||||
|
@ -402,6 +414,8 @@ static RootlessFrameProcsRec CRRootlessProcs = {
|
||||||
CRUpdateRegion,
|
CRUpdateRegion,
|
||||||
CRDamageRects,
|
CRDamageRects,
|
||||||
NULL,
|
NULL,
|
||||||
|
CRDoReorderWindow,
|
||||||
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
NULL
|
NULL
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
* holders shall not be used in advertising or otherwise to promote the sale,
|
* holders shall not be used in advertising or otherwise to promote the sale,
|
||||||
* use or other dealings in this Software without prior written authorization.
|
* use or other dealings in this Software without prior written authorization.
|
||||||
*/
|
*/
|
||||||
/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/xpr/xprFrame.c,v 1.5 2003/11/27 01:59:53 torrey Exp $ */
|
/* $XdotOrg: xc/programs/Xserver/hw/darwin/quartz/xpr/xprFrame.c,v 1.2 2004/04/23 19:16:52 eich Exp $ */
|
||||||
/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/xprFrame.c,v 1.4 2003/11/12 20:21:52 torrey Exp $ */
|
/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/xpr/xprFrame.c,v 1.4 2003/11/12 20:21:52 torrey Exp $ */
|
||||||
|
|
||||||
#include "xpr.h"
|
#include "xpr.h"
|
||||||
|
@ -35,6 +35,7 @@
|
||||||
#include "Xplugin.h"
|
#include "Xplugin.h"
|
||||||
#include "x-hash.h"
|
#include "x-hash.h"
|
||||||
#include "x-list.h"
|
#include "x-list.h"
|
||||||
|
#include "applewmExt.h"
|
||||||
|
|
||||||
#include "propertyst.h"
|
#include "propertyst.h"
|
||||||
#include "dix.h"
|
#include "dix.h"
|
||||||
|
@ -342,6 +343,17 @@ xprSwitchWindow(RootlessWindowPtr pFrame, WindowPtr oldWin)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Called to check if the frame should be reordered when it is restacked.
|
||||||
|
*/
|
||||||
|
Bool xprDoReorderWindow(RootlessWindowPtr pFrame)
|
||||||
|
{
|
||||||
|
WindowPtr pWin = pFrame->win;
|
||||||
|
|
||||||
|
return AppleWMDoReorderWindow(pWin);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copy area in frame to another part of frame.
|
* Copy area in frame to another part of frame.
|
||||||
* Used to accelerate scrolling.
|
* Used to accelerate scrolling.
|
||||||
|
@ -368,6 +380,7 @@ static RootlessFrameProcsRec xprRootlessProcs = {
|
||||||
xprUpdateRegion,
|
xprUpdateRegion,
|
||||||
xprDamageRects,
|
xprDamageRects,
|
||||||
xprSwitchWindow,
|
xprSwitchWindow,
|
||||||
|
xprDoReorderWindow,
|
||||||
xp_copy_bytes,
|
xp_copy_bytes,
|
||||||
xp_fill_bytes,
|
xp_fill_bytes,
|
||||||
xp_composite_pixels,
|
xp_composite_pixels,
|
||||||
|
|
|
@ -1,3 +1,9 @@
|
||||||
|
2004-10-07 Torrey Lyons <torrey at freedesktop dot org>
|
||||||
|
|
||||||
|
* winscrinit.c:
|
||||||
|
Add compatibility with the generic rootless layer's new
|
||||||
|
DoReorderWindow function.
|
||||||
|
|
||||||
2004-09-17 Torrey Lyons <torrey at freedesktop dot org>
|
2004-09-17 Torrey Lyons <torrey at freedesktop dot org>
|
||||||
|
|
||||||
* winscrinit.c: (winFinishScreenInitFB):
|
* winscrinit.c: (winFinishScreenInitFB):
|
||||||
|
|
|
@ -57,6 +57,7 @@ winMWExtWMProcs = {
|
||||||
winMWExtWMDamageRects,
|
winMWExtWMDamageRects,
|
||||||
#endif
|
#endif
|
||||||
winMWExtWMRootlessSwitchWindow,
|
winMWExtWMRootlessSwitchWindow,
|
||||||
|
NULL,//winWMExtWMDoReorderWindow,
|
||||||
|
|
||||||
NULL,//winMWExtWMCopyBytes,
|
NULL,//winMWExtWMCopyBytes,
|
||||||
NULL,//winMWExtWMFillBytes,
|
NULL,//winMWExtWMFillBytes,
|
||||||
|
|
|
@ -266,6 +266,20 @@ typedef void (*RootlessDamageRectsProc)
|
||||||
typedef void (*RootlessSwitchWindowProc)
|
typedef void (*RootlessSwitchWindowProc)
|
||||||
(RootlessWindowPtr pFrame, WindowPtr oldWin);
|
(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)
|
* Copy bytes. (Optional)
|
||||||
* Source and destinate may overlap and the right thing should happen.
|
* Source and destinate may overlap and the right thing should happen.
|
||||||
|
@ -354,6 +368,7 @@ typedef struct _RootlessFrameProcs {
|
||||||
|
|
||||||
/* Optional frame functions */
|
/* Optional frame functions */
|
||||||
RootlessSwitchWindowProc SwitchWindow;
|
RootlessSwitchWindowProc SwitchWindow;
|
||||||
|
RootlessDoReorderWindowProc DoReorderWindow;
|
||||||
|
|
||||||
/* Optional acceleration functions */
|
/* Optional acceleration functions */
|
||||||
RootlessCopyBytesProc CopyBytes;
|
RootlessCopyBytesProc CopyBytes;
|
||||||
|
|
|
@ -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
|
* Rootless window management
|
||||||
*/
|
*/
|
||||||
|
@ -481,7 +481,7 @@ RootlessUnrealizeWindow(WindowPtr pWin)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* RootlessReorderWindow
|
* 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.
|
* physically above the window below it in the X stacking order.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
|
@ -495,6 +495,15 @@ RootlessReorderWindow(WindowPtr pWin)
|
||||||
RootlessFrameID newPrevID;
|
RootlessFrameID newPrevID;
|
||||||
ScreenPtr pScreen = pWin->drawable.pScreen;
|
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);
|
RootlessStopDrawing(pWin, FALSE);
|
||||||
|
|
||||||
/* Find the next window above this one that has a mapped frame. */
|
/* Find the next window above this one that has a mapped frame. */
|
||||||
|
|
Loading…
Reference in New Issue