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,24 +40,26 @@ 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_
|
||||||
#include "applewmstr.h"
|
#include "applewmstr.h"
|
||||||
#include "applewmExt.h"
|
#include "applewmExt.h"
|
||||||
|
|
||||||
#define DEFINE_ATOM_HELPER(func,atom_name) \
|
#define DEFINE_ATOM_HELPER(func,atom_name) \
|
||||||
static Atom func (void) { \
|
static Atom func (void) { \
|
||||||
static int generation; \
|
static int generation; \
|
||||||
static Atom atom; \
|
static Atom atom; \
|
||||||
if (generation != serverGeneration) { \
|
if (generation != serverGeneration) { \
|
||||||
generation = serverGeneration; \
|
generation = serverGeneration; \
|
||||||
atom = MakeAtom (atom_name, strlen (atom_name), TRUE); \
|
atom = MakeAtom (atom_name, strlen (atom_name), TRUE); \
|
||||||
} \
|
} \
|
||||||
return atom; \
|
return atom; \
|
||||||
}
|
}
|
||||||
|
|
||||||
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;
|
||||||
|
|
||||||
|
@ -84,8 +86,8 @@ static void SNotifyEvent(xAppleWMNotifyEvent *from, xAppleWMNotifyEvent *to);
|
||||||
typedef struct _WMEvent *WMEventPtr;
|
typedef struct _WMEvent *WMEventPtr;
|
||||||
typedef struct _WMEvent {
|
typedef struct _WMEvent {
|
||||||
WMEventPtr next;
|
WMEventPtr next;
|
||||||
ClientPtr client;
|
ClientPtr client;
|
||||||
XID clientResource;
|
XID clientResource;
|
||||||
unsigned int mask;
|
unsigned int mask;
|
||||||
} WMEventRec;
|
} WMEventRec;
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
@ -191,8 +216,8 @@ updateEventMask (WMEventPtr *pHead)
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
static int
|
static int
|
||||||
WMFreeClient (data, id)
|
WMFreeClient (data, id)
|
||||||
pointer data;
|
pointer data;
|
||||||
XID id;
|
XID id;
|
||||||
{
|
{
|
||||||
WMEventPtr pEvent;
|
WMEventPtr pEvent;
|
||||||
WMEventPtr *pHead, pCur, pPrev;
|
WMEventPtr *pHead, pCur, pPrev;
|
||||||
|
@ -218,8 +243,8 @@ WMFreeClient (data, id)
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
static int
|
static int
|
||||||
WMFreeEvents (data, id)
|
WMFreeEvents (data, id)
|
||||||
pointer data;
|
pointer data;
|
||||||
XID id;
|
XID id;
|
||||||
{
|
{
|
||||||
WMEventPtr *pHead, pCur, pNext;
|
WMEventPtr *pHead, pCur, pNext;
|
||||||
|
|
||||||
|
@ -236,11 +261,11 @@ WMFreeEvents (data, id)
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcAppleWMSelectInput (client)
|
ProcAppleWMSelectInput (client)
|
||||||
register ClientPtr client;
|
register ClientPtr client;
|
||||||
{
|
{
|
||||||
REQUEST(xAppleWMSelectInputReq);
|
REQUEST(xAppleWMSelectInputReq);
|
||||||
WMEventPtr pEvent, pNewEvent, *pHead;
|
WMEventPtr pEvent, pNewEvent, *pHead;
|
||||||
XID clientResource;
|
XID clientResource;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH (xAppleWMSelectInputReq);
|
REQUEST_SIZE_MATCH (xAppleWMSelectInputReq);
|
||||||
pHead = (WMEventPtr *)SecurityLookupIDByType(client,
|
pHead = (WMEventPtr *)SecurityLookupIDByType(client,
|
||||||
|
@ -329,8 +354,8 @@ AppleWMSendEvent (type, mask, which, arg)
|
||||||
int type, which, arg;
|
int type, which, arg;
|
||||||
unsigned int mask;
|
unsigned int mask;
|
||||||
{
|
{
|
||||||
WMEventPtr *pHead, pEvent;
|
WMEventPtr *pHead, pEvent;
|
||||||
ClientPtr client;
|
ClientPtr client;
|
||||||
xAppleWMNotifyEvent se;
|
xAppleWMNotifyEvent se;
|
||||||
|
|
||||||
pHead = (WMEventPtr *) LookupIDByType(eventResource, EventType);
|
pHead = (WMEventPtr *) LookupIDByType(eventResource, EventType);
|
||||||
|
@ -610,7 +635,7 @@ ProcAppleWMFrameDraw(
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcAppleWMDispatch (
|
ProcAppleWMDispatch (
|
||||||
register ClientPtr client
|
register ClientPtr client
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
REQUEST(xReq);
|
REQUEST(xReq);
|
||||||
|
@ -666,7 +691,7 @@ SNotifyEvent(from, to)
|
||||||
|
|
||||||
static int
|
static int
|
||||||
SProcAppleWMQueryVersion(
|
SProcAppleWMQueryVersion(
|
||||||
register ClientPtr client
|
register ClientPtr client
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
register int n;
|
register int n;
|
||||||
|
@ -677,7 +702,7 @@ SProcAppleWMQueryVersion(
|
||||||
|
|
||||||
static int
|
static int
|
||||||
SProcAppleWMDispatch (
|
SProcAppleWMDispatch (
|
||||||
register ClientPtr client
|
register ClientPtr client
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
REQUEST(xReq);
|
REQUEST(xReq);
|
||||||
|
|
|
@ -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,11 +69,15 @@ void AppleWMSetScreenOrigin(
|
||||||
WindowPtr pWin
|
WindowPtr pWin
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Bool AppleWMDoReorderWindow(
|
||||||
|
WindowPtr pWin
|
||||||
|
);
|
||||||
|
|
||||||
void AppleWMSendEvent(
|
void AppleWMSendEvent(
|
||||||
int /* type */,
|
int /* type */,
|
||||||
unsigned int /* mask */,
|
unsigned int /* mask */,
|
||||||
int /* which */,
|
int /* which */,
|
||||||
int /* arg */
|
int /* arg */
|
||||||
);
|
);
|
||||||
|
|
||||||
unsigned int AppleWMSelectedEvents(
|
unsigned int AppleWMSelectedEvents(
|
||||||
|
|
|
@ -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"
|
||||||
|
@ -43,15 +44,15 @@
|
||||||
|
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
|
||||||
#define DEFINE_ATOM_HELPER(func,atom_name) \
|
#define DEFINE_ATOM_HELPER(func,atom_name) \
|
||||||
static Atom func (void) { \
|
static Atom func (void) { \
|
||||||
static int generation; \
|
static int generation; \
|
||||||
static Atom atom; \
|
static Atom atom; \
|
||||||
if (generation != serverGeneration) { \
|
if (generation != serverGeneration) { \
|
||||||
generation = serverGeneration; \
|
generation = serverGeneration; \
|
||||||
atom = MakeAtom (atom_name, strlen (atom_name), TRUE); \
|
atom = MakeAtom (atom_name, strlen (atom_name), TRUE); \
|
||||||
} \
|
} \
|
||||||
return atom; \
|
return atom; \
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFINE_ATOM_HELPER(xa_native_window_id, "_NATIVE_WINDOW_ID")
|
DEFINE_ATOM_HELPER(xa_native_window_id, "_NATIVE_WINDOW_ID")
|
||||||
|
@ -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