summaryrefslogtreecommitdiff
path: root/xserver/miext/rootless/rootlessCommon.c
diff options
context:
space:
mode:
Diffstat (limited to 'xserver/miext/rootless/rootlessCommon.c')
-rw-r--r--xserver/miext/rootless/rootlessCommon.c60
1 files changed, 32 insertions, 28 deletions
diff --git a/xserver/miext/rootless/rootlessCommon.c b/xserver/miext/rootless/rootlessCommon.c
index 39a3eed0f..f91cfb432 100644
--- a/xserver/miext/rootless/rootlessCommon.c
+++ b/xserver/miext/rootless/rootlessCommon.c
@@ -92,6 +92,9 @@ IsFramedWindow(WindowPtr pWin)
{
WindowPtr top;
+ if (!dixPrivateKeyRegistered(&rootlessWindowPrivateKeyRec))
+ return FALSE;
+
if (!pWin->realized)
return FALSE;
top = TopLevelParent(pWin);
@@ -262,7 +265,6 @@ void RootlessStopDrawing(WindowPtr pWindow, Bool flush)
void
RootlessDamageRegion(WindowPtr pWindow, RegionPtr pRegion)
{
- ScreenPtr pScreen = pWindow->drawable.pScreen;
RootlessWindowRec *winRec;
RegionRec clipped;
WindowPtr pTop;
@@ -286,30 +288,31 @@ RootlessDamageRegion(WindowPtr pWindow, RegionPtr pRegion)
drawing inside the clip, go to some lengths to avoid the general
case intersection. */
- b1 = REGION_EXTENTS(pScreen, &pWindow->borderClip);
- b2 = REGION_EXTENTS(pScreen, pRegion);
+ b1 = RegionExtents(&pWindow->borderClip);
+ b2 = RegionExtents(pRegion);
if (EXTENTCHECK(b1, b2)) {
/* Regions may overlap. */
- if (REGION_NUM_RECTS(pRegion) == 1) {
+ if (RegionNumRects(pRegion) == 1) {
int in;
/* Damaged region only has a single rect, so we can
just compare that against the region */
- in = RECT_IN_REGION(pScreen, &pWindow->borderClip,
- REGION_RECTS (pRegion));
+ in = RegionContainsRect(&pWindow->borderClip,
+ RegionRects (pRegion));
if (in == rgnIN) {
/* clip totally contains pRegion */
#ifdef ROOTLESS_TRACK_DAMAGE
- REGION_UNION(pScreen, &winRec->damage,
+ RegionUnion(&winRec->damage,
&winRec->damage, (pRegion));
#else
- SCREENREC(pScreen)->imp->DamageRects(winRec->wid,
- REGION_NUM_RECTS(pRegion),
- REGION_RECTS(pRegion),
+ SCREENREC(pWindow->drawable.pScreen)->imp->
+ DamageRects(winRec->wid,
+ RegionNumRects(pRegion),
+ RegionRects(pRegion),
-winRec->x, -winRec->y);
#endif
@@ -325,20 +328,21 @@ RootlessDamageRegion(WindowPtr pWindow, RegionPtr pRegion)
/* clip overlaps pRegion, need to intersect */
- REGION_NULL(pScreen, &clipped);
- REGION_INTERSECT(pScreen, &clipped, &pWindow->borderClip, pRegion);
+ RegionNull(&clipped);
+ RegionIntersect(&clipped, &pWindow->borderClip, pRegion);
#ifdef ROOTLESS_TRACK_DAMAGE
- REGION_UNION(pScreen, &winRec->damage,
+ RegionUnion(&winRec->damage,
&winRec->damage, (pRegion));
#else
- SCREENREC(pScreen)->imp->DamageRects(winRec->wid,
- REGION_NUM_RECTS(&clipped),
- REGION_RECTS(&clipped),
+ SCREENREC(pWindow->drawable.pScreen)->imp->
+ DamageRects(winRec->wid,
+ RegionNumRects(&clipped),
+ RegionRects(&clipped),
-winRec->x, -winRec->y);
#endif
- REGION_UNINIT(pScreen, &clipped);
+ RegionUninit(&clipped);
RootlessQueueRedisplay(pTop->drawable.pScreen);
}
@@ -346,8 +350,8 @@ RootlessDamageRegion(WindowPtr pWindow, RegionPtr pRegion)
out:
#ifdef ROOTLESSDEBUG
{
- BoxRec *box = REGION_RECTS(pRegion), *end;
- int numBox = REGION_NUM_RECTS(pRegion);
+ BoxRec *box = RegionRects(pRegion), *end;
+ int numBox = RegionNumRects(pRegion);
for (end = box+numBox; box < end; box++) {
RL_DEBUG_MSG("Damage rect: %i, %i, %i, %i\n",
@@ -369,11 +373,11 @@ RootlessDamageBox(WindowPtr pWindow, BoxPtr pBox)
{
RegionRec region;
- REGION_INIT(pWindow->drawable.pScreen, &region, pBox, 1);
+ RegionInit(&region, pBox, 1);
RootlessDamageRegion(pWindow, &region);
- REGION_UNINIT(pWindow->drawable.pScreen, &region); /* no-op */
+ RegionUninit(&region); /* no-op */
}
@@ -396,11 +400,11 @@ RootlessDamageRect(WindowPtr pWindow, int x, int y, int w, int h)
box.y1 = y;
box.y2 = y + h;
- REGION_INIT(pWindow->drawable.pScreen, &region, &box, 1);
+ RegionInit(&region, &box, 1);
RootlessDamageRegion(pWindow, &region);
- REGION_UNINIT(pWindow->drawable.pScreen, &region); /* no-op */
+ RegionUninit(&region); /* no-op */
}
@@ -418,18 +422,18 @@ RootlessRedisplay(WindowPtr pWindow)
RootlessStopDrawing(pWindow, FALSE);
- if (REGION_NOTEMPTY(pScreen, &winRec->damage)) {
+ if (RegionNotEmpty(&winRec->damage)) {
RL_DEBUG_MSG("Redisplay Win 0x%x, %i x %i @ (%i, %i)\n",
pWindow, winRec->width, winRec->height,
winRec->x, winRec->y);
// move region to window local coords
- REGION_TRANSLATE(pScreen, &winRec->damage,
+ RegionTranslate(&winRec->damage,
-winRec->x, -winRec->y);
SCREENREC(pScreen)->imp->UpdateRegion(winRec->wid, &winRec->damage);
- REGION_EMPTY(pScreen, &winRec->damage);
+ RegionEmpty(&winRec->damage);
}
#else /* !ROOTLESS_TRACK_DAMAGE */
@@ -447,7 +451,7 @@ RootlessRedisplay(WindowPtr pWindow)
void
RootlessRepositionWindows(ScreenPtr pScreen)
{
- WindowPtr root = WindowTable[pScreen->myNum];
+ WindowPtr root = pScreen->root;
WindowPtr win;
if (root != NULL) {
@@ -468,7 +472,7 @@ RootlessRepositionWindows(ScreenPtr pScreen)
void
RootlessRedisplayScreen(ScreenPtr pScreen)
{
- WindowPtr root = WindowTable[pScreen->myNum];
+ WindowPtr root = pScreen->root;
if (root != NULL) {
WindowPtr win;