wip
This commit is contained in:
parent
29fc049907
commit
68f1039aab
|
|
@ -69,6 +69,9 @@ xnestOpenDisplay(int argc, char *argv[])
|
||||||
long mask;
|
long mask;
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
|
/* fill out the first screen and later copy it to all others */
|
||||||
|
XnestScreenPtr xnscr = XnestScreenByIdx(0);
|
||||||
|
|
||||||
if (!xnestDoFullGeneration)
|
if (!xnestDoFullGeneration)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
@ -76,16 +79,16 @@ xnestOpenDisplay(int argc, char *argv[])
|
||||||
|
|
||||||
xnestCloseDisplay();
|
xnestCloseDisplay();
|
||||||
|
|
||||||
xnestDisplay = XOpenDisplay(xnestDisplayName);
|
xnscr->upstreamDisplay = XOpenDisplay(xnestDisplayName);
|
||||||
if (xnestDisplay == NULL)
|
if (xnscr->upstreamDisplay == NULL)
|
||||||
FatalError("Unable to open display \"%s\".\n",
|
FatalError("Unable to open display \"%s\".\n",
|
||||||
XDisplayName(xnestDisplayName));
|
XDisplayName(xnestDisplayName));
|
||||||
|
|
||||||
if (xnestSynchronize)
|
if (xnestSynchronize)
|
||||||
XSynchronize(xnestDisplay, True);
|
XSynchronize(xnscr->upstreamDisplay, True);
|
||||||
|
|
||||||
mask = VisualScreenMask;
|
mask = VisualScreenMask;
|
||||||
vi.screen = DefaultScreen(xnestDisplay);
|
vi.screen = DefaultScreen(xnscr->upstreamDisplay);
|
||||||
xnestVisuals = XGetVisualInfo(xnestDisplay, mask, &vi, &xnestNumVisuals);
|
xnestVisuals = XGetVisualInfo(xnestDisplay, mask, &vi, &xnestNumVisuals);
|
||||||
if (xnestNumVisuals == 0 || xnestVisuals == NULL)
|
if (xnestNumVisuals == 0 || xnestVisuals == NULL)
|
||||||
FatalError("Unable to find any visuals.\n");
|
FatalError("Unable to find any visuals.\n");
|
||||||
|
|
@ -124,14 +127,14 @@ xnestOpenDisplay(int argc, char *argv[])
|
||||||
xnestVisuals[i].visual,
|
xnestVisuals[i].visual,
|
||||||
AllocNone);
|
AllocNone);
|
||||||
|
|
||||||
xnestDepths = XListDepths(xnestDisplay, DefaultScreen(xnestDisplay),
|
xnestDepths = XListDepths(xnestDisplay, DefaultScreen(xnscr->upstreamDisplay),
|
||||||
&xnestNumDepths);
|
&xnestNumDepths);
|
||||||
|
|
||||||
xnestPixmapFormats = XListPixmapFormats(xnestDisplay,
|
xnestPixmapFormats = XListPixmapFormats(xnscr->upstreamDisplay,
|
||||||
&xnestNumPixmapFormats);
|
&xnestNumPixmapFormats);
|
||||||
|
|
||||||
xnestBlackPixel = BlackPixel(xnestDisplay, DefaultScreen(xnestDisplay));
|
xnestBlackPixel = BlackPixel(xnscr->upstreamDisplay, DefaultScreen(xnscr->upstreamDisplay));
|
||||||
xnestWhitePixel = WhitePixel(xnestDisplay, DefaultScreen(xnestDisplay));
|
xnestWhitePixel = WhitePixel(xnscr->upstreamDisplay, DefaultScreen(xnscr->upstreamDisplay));
|
||||||
|
|
||||||
if (xnestParentWindow != (Window) 0)
|
if (xnestParentWindow != (Window) 0)
|
||||||
xnestEventMask = StructureNotifyMask;
|
xnestEventMask = StructureNotifyMask;
|
||||||
|
|
@ -146,11 +149,11 @@ xnestOpenDisplay(int argc, char *argv[])
|
||||||
if (xnestPixmapFormats[i].depth == 1 ||
|
if (xnestPixmapFormats[i].depth == 1 ||
|
||||||
xnestPixmapFormats[i].depth == xnestDepths[j]) {
|
xnestPixmapFormats[i].depth == xnestDepths[j]) {
|
||||||
xnestDefaultDrawables[xnestPixmapFormats[i].depth] =
|
xnestDefaultDrawables[xnestPixmapFormats[i].depth] =
|
||||||
XCreatePixmap(xnestDisplay, DefaultRootWindow(xnestDisplay),
|
XCreatePixmap(xnscr->upstreamDisplay, DefaultRootWindow(xnscr->upstreamDisplay),
|
||||||
1, 1, xnestPixmapFormats[i].depth);
|
1, 1, xnestPixmapFormats[i].depth);
|
||||||
}
|
}
|
||||||
|
|
||||||
xnestBitmapGC = XCreateGC(xnestDisplay, xnestDefaultDrawables[1], 0L, NULL);
|
xnestBitmapGC = XCreateGC(xnscr->upstreamDisplay, xnestDefaultDrawables[1], 0L, NULL);
|
||||||
|
|
||||||
if (!(xnestUserGeometry & XValue))
|
if (!(xnestUserGeometry & XValue))
|
||||||
xnestX = 0;
|
xnestX = 0;
|
||||||
|
|
@ -160,38 +163,47 @@ xnestOpenDisplay(int argc, char *argv[])
|
||||||
|
|
||||||
if (xnestParentWindow == 0) {
|
if (xnestParentWindow == 0) {
|
||||||
if (!(xnestUserGeometry & WidthValue))
|
if (!(xnestUserGeometry & WidthValue))
|
||||||
xnestWidth = 3 * DisplayWidth(xnestDisplay,
|
xnestWidth = 3 * DisplayWidth(xnscr->upstreamDisplay,
|
||||||
DefaultScreen(xnestDisplay)) / 4;
|
DefaultScreen(xnscr->upstreamDisplay)) / 4;
|
||||||
|
|
||||||
if (!(xnestUserGeometry & HeightValue))
|
if (!(xnestUserGeometry & HeightValue))
|
||||||
xnestHeight = 3 * DisplayHeight(xnestDisplay,
|
xnestHeight = 3 * DisplayHeight(xnscr->upstreamDisplay,
|
||||||
DefaultScreen(xnestDisplay)) / 4;
|
DefaultScreen(xnscr->upstreamDisplay)) / 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!xnestUserBorderWidth)
|
if (!xnestUserBorderWidth)
|
||||||
xnestBorderWidth = 1;
|
xnestBorderWidth = 1;
|
||||||
|
|
||||||
xnestIconBitmap =
|
xnestIconBitmap =
|
||||||
XCreateBitmapFromData(xnestDisplay,
|
XCreateBitmapFromData(xnscr->upstreamDisplay,
|
||||||
DefaultRootWindow(xnestDisplay),
|
DefaultRootWindow(xnscr->upstreamDisplay),
|
||||||
(char *) icon_bits, icon_width, icon_height);
|
(char *) icon_bits, icon_width, icon_height);
|
||||||
|
|
||||||
xnestScreenSaverPixmap =
|
xnestScreenSaverPixmap =
|
||||||
XCreatePixmapFromBitmapData(xnestDisplay,
|
XCreatePixmapFromBitmapData(xnscr->upstreamDisplay,
|
||||||
DefaultRootWindow(xnestDisplay),
|
DefaultRootWindow(xnscr->upstreamDisplay),
|
||||||
(char *) screensaver_bits,
|
(char *) screensaver_bits,
|
||||||
screensaver_width,
|
screensaver_width,
|
||||||
screensaver_height,
|
screensaver_height,
|
||||||
xnestWhitePixel,
|
xnestWhitePixel,
|
||||||
xnestBlackPixel,
|
xnestBlackPixel,
|
||||||
DefaultDepth(xnestDisplay,
|
DefaultDepth(xndscr->display,
|
||||||
DefaultScreen(xnestDisplay)));
|
DefaultScreen(xnscr->upstreamDisplay)));
|
||||||
|
|
||||||
|
/* now copy over the remaining screens */
|
||||||
|
for (i=1; i<xnestNumScreens; i++) {
|
||||||
|
XnestScreenPtr s2 = XnestScreenByIdx(i);
|
||||||
|
s2->display = xnscr->upstreamDisplay;
|
||||||
|
s2->clonedFrom = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
xnestCloseDisplay(void)
|
xnestCloseDisplay(void)
|
||||||
{
|
{
|
||||||
if (!xnestDoFullGeneration || !xnestDisplay)
|
XnestScreenPtr xnscr = xnestScreenByIdx(0);
|
||||||
|
|
||||||
|
if (!xnestDoFullGeneration || !xnscr->upstreamDisplay)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -203,5 +215,5 @@ xnestCloseDisplay(void)
|
||||||
XFree(xnestVisuals);
|
XFree(xnestVisuals);
|
||||||
XFree(xnestDepths);
|
XFree(xnestDepths);
|
||||||
XFree(xnestPixmapFormats);
|
XFree(xnestPixmapFormats);
|
||||||
XCloseDisplay(xnestDisplay);
|
XCloseDisplay(xnscr->upstreamDisplay);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -75,26 +75,27 @@ xnestSaveScreen(ScreenPtr pScreen, int what)
|
||||||
if (xnestSoftwareScreenSaver)
|
if (xnestSoftwareScreenSaver)
|
||||||
return False;
|
return False;
|
||||||
else {
|
else {
|
||||||
Window saverWin = xnestScreenPriv(pScreen)->screenSaverWindow;
|
XnestScreenPtr xnscr = xnestScreenPriv(pScreen);
|
||||||
|
Window saverWin = xnscr->screenSaverWindow;
|
||||||
switch (what) {
|
switch (what) {
|
||||||
case SCREEN_SAVER_ON:
|
case SCREEN_SAVER_ON:
|
||||||
XMapRaised(xnestDisplay, saverWin);
|
XMapRaised(xnscr->upstreamDisplay, saverWin);
|
||||||
xnestSetScreenSaverColormapWindow(pScreen);
|
xnestSetScreenSaverColormapWindow(pScreen);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SCREEN_SAVER_OFF:
|
case SCREEN_SAVER_OFF:
|
||||||
XUnmapWindow(xnestDisplay, saverWin);
|
XUnmapWindow(xnscr->upstreamDisplay, saverWin);
|
||||||
xnestSetInstalledColormapWindows(pScreen);
|
xnestSetInstalledColormapWindows(pScreen);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SCREEN_SAVER_FORCER:
|
case SCREEN_SAVER_FORCER:
|
||||||
lastEventTime = GetTimeInMillis();
|
lastEventTime = GetTimeInMillis();
|
||||||
XUnmapWindow(xnestDisplay, saverWin);
|
XUnmapWindow(xnscr->upstreamDisplay, saverWin);
|
||||||
xnestSetInstalledColormapWindows(pScreen);
|
xnestSetInstalledColormapWindows(pScreen);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SCREEN_SAVER_CYCLE:
|
case SCREEN_SAVER_CYCLE:
|
||||||
XUnmapWindow(xnestDisplay, saverWin);
|
XUnmapWindow(xnscr->upstreamDisplay, saverWin);
|
||||||
xnestSetInstalledColormapWindows(pScreen);
|
xnestSetInstalledColormapWindows(pScreen);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -142,6 +143,7 @@ xnestOpenScreen(ScreenPtr pScreen, int argc, char *argv[])
|
||||||
VisualID defaultVisual;
|
VisualID defaultVisual;
|
||||||
int rootDepth;
|
int rootDepth;
|
||||||
miPointerScreenPtr PointPriv;
|
miPointerScreenPtr PointPriv;
|
||||||
|
XnestScreenPtr xnscr = xnestScreenPriv(pScreen);
|
||||||
|
|
||||||
if (!dixRegisterPrivateKey
|
if (!dixRegisterPrivateKey
|
||||||
(&xnestWindowPrivateKeyRec, PRIVATE_WINDOW, sizeof(xnestPrivWin)))
|
(&xnestWindowPrivateKeyRec, PRIVATE_WINDOW, sizeof(xnestPrivWin)))
|
||||||
|
|
@ -235,7 +237,7 @@ xnestOpenScreen(ScreenPtr pScreen, int argc, char *argv[])
|
||||||
rootDepth = visuals[xnestDefaultVisualIndex].nplanes;
|
rootDepth = visuals[xnestDefaultVisualIndex].nplanes;
|
||||||
|
|
||||||
if (xnestParentWindow != 0) {
|
if (xnestParentWindow != 0) {
|
||||||
XGetWindowAttributes(xnestDisplay, xnestParentWindow, &gattributes);
|
XGetWindowAttributes(xnscr->upstreamDisplay, xnestParentWindow, &gattributes);
|
||||||
xnestWidth = gattributes.width;
|
xnestWidth = gattributes.width;
|
||||||
xnestHeight = gattributes.height;
|
xnestHeight = gattributes.height;
|
||||||
}
|
}
|
||||||
|
|
@ -321,13 +323,13 @@ xnestOpenScreen(ScreenPtr pScreen, int argc, char *argv[])
|
||||||
&xnestCursorFuncs);
|
&xnestCursorFuncs);
|
||||||
PointPriv->spriteFuncs = &xnestPointerSpriteFuncs;
|
PointPriv->spriteFuncs = &xnestPointerSpriteFuncs;
|
||||||
|
|
||||||
pScreen->mmWidth = xnestWidth * DisplayWidthMM(xnestDisplay,
|
pScreen->mmWidth = xnestWidth * DisplayWidthMM(xnscr->upstreamDisplay,
|
||||||
DefaultScreen(xnestDisplay))
|
DefaultScreen(xnscr->upstreamDisplay))
|
||||||
/ DisplayWidth(xnestDisplay, DefaultScreen(xnestDisplay));
|
/ DisplayWidth(xnestDisplay, DefaultScreen(xnscr->upstreamDisplay));
|
||||||
pScreen->mmHeight =
|
pScreen->mmHeight =
|
||||||
xnestHeight * DisplayHeightMM(xnestDisplay,
|
xnestHeight * DisplayHeightMM(xnscr->upstreamDisplay,
|
||||||
DefaultScreen(xnestDisplay)) /
|
DefaultScreen(xnscr->upstreamDisplay)) /
|
||||||
DisplayHeight(xnestDisplay, DefaultScreen(xnestDisplay));
|
DisplayHeight(xnscr->upstreamDisplay, DefaultScreen(xnscr->upstreamDisplay));
|
||||||
|
|
||||||
/* overwrite miCloseScreen with our own */
|
/* overwrite miCloseScreen with our own */
|
||||||
pScreen->CloseScreen = xnestCloseScreen;
|
pScreen->CloseScreen = xnestCloseScreen;
|
||||||
|
|
@ -350,12 +352,12 @@ xnestOpenScreen(ScreenPtr pScreen, int argc, char *argv[])
|
||||||
|
|
||||||
if (xnestParentWindow != 0) {
|
if (xnestParentWindow != 0) {
|
||||||
xnscr->rootWindow = xnestParentWindow;
|
xnscr->rootWindow = xnestParentWindow;
|
||||||
XSelectInput(xnestDisplay, xnestParentWindow, xnestEventMask);
|
XSelectInput(xnscr->upstreamDisplay, xnestParentWindow, xnestEventMask);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
xnscr->rootWindow =
|
xnscr->rootWindow =
|
||||||
XCreateWindow(xnestDisplay,
|
XCreateWindow(xnscr->upstreamDisplay,
|
||||||
DefaultRootWindow(xnestDisplay),
|
DefaultRootWindow(xnscr->upstreamDisplay),
|
||||||
xnestX + POSITION_OFFSET,
|
xnestX + POSITION_OFFSET,
|
||||||
xnestY + POSITION_OFFSET,
|
xnestY + POSITION_OFFSET,
|
||||||
xnestWidth, xnestHeight,
|
xnestWidth, xnestHeight,
|
||||||
|
|
@ -377,27 +379,27 @@ xnestOpenScreen(ScreenPtr pScreen, int argc, char *argv[])
|
||||||
sizeHints.flags |= USPosition;
|
sizeHints.flags |= USPosition;
|
||||||
if (xnestUserGeometry & WidthValue || xnestUserGeometry & HeightValue)
|
if (xnestUserGeometry & WidthValue || xnestUserGeometry & HeightValue)
|
||||||
sizeHints.flags |= USSize;
|
sizeHints.flags |= USSize;
|
||||||
XSetStandardProperties(xnestDisplay,
|
XSetStandardProperties(xnscr->upstreamDisplay,
|
||||||
xnscr->rootWindow,
|
xnscr->rootWindow,
|
||||||
xnestWindowName,
|
xnestWindowName,
|
||||||
xnestWindowName,
|
xnestWindowName,
|
||||||
xnestIconBitmap, argv, argc, &sizeHints);
|
xnestIconBitmap, argv, argc, &sizeHints);
|
||||||
|
|
||||||
XMapWindow(xnestDisplay, xnscr->rootWindow);
|
XMapWindow(xnscr->upstreamDisplay, xnscr->rootWindow);
|
||||||
|
|
||||||
valuemask = CWBackPixmap | CWColormap;
|
valuemask = CWBackPixmap | CWColormap;
|
||||||
attributes.background_pixmap = xnestScreenSaverPixmap;
|
attributes.background_pixmap = xnestScreenSaverPixmap;
|
||||||
attributes.colormap =
|
attributes.colormap =
|
||||||
DefaultColormap(xnestDisplay, DefaultScreen(xnestDisplay));
|
DefaultColormap(xnscr->upstreamDisplay, DefaultScreen(xnscr->upstreamDisplay));
|
||||||
xnscr->screenSaverWindow =
|
xnscr->screenSaverWindow =
|
||||||
XCreateWindow(xnestDisplay,
|
XCreateWindow(xnscr->upstreamDisplay,
|
||||||
xnscr->rootWindow,
|
xnscr->rootWindow,
|
||||||
0, 0, xnestWidth, xnestHeight, 0,
|
0, 0, xnestWidth, xnestHeight, 0,
|
||||||
DefaultDepth(xnestDisplay,
|
DefaultDepth(xnscr->upstreamDisplay,
|
||||||
DefaultScreen(xnestDisplay)),
|
DefaultScreen(xnscr->upstreamDisplay)),
|
||||||
InputOutput, DefaultVisual(xnestDisplay,
|
InputOutput, DefaultVisual(xnscr->upstreamDisplay,
|
||||||
DefaultScreen
|
DefaultScreen
|
||||||
(xnestDisplay)), valuemask,
|
(xnscr->upstreamDisplay)), valuemask,
|
||||||
&attributes);
|
&attributes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -78,6 +78,7 @@ xnestCreateWindow(WindowPtr pWin)
|
||||||
XSetWindowAttributes attributes;
|
XSetWindowAttributes attributes;
|
||||||
Visual *visual;
|
Visual *visual;
|
||||||
ColormapPtr pCmap;
|
ColormapPtr pCmap;
|
||||||
|
XnestScreenPtr xnscr = xnestScreenPriv(pWin->drawable.pScreen);
|
||||||
|
|
||||||
if (pWin->drawable.class == InputOnly) {
|
if (pWin->drawable.class == InputOnly) {
|
||||||
mask = 0L;
|
mask = 0L;
|
||||||
|
|
@ -115,7 +116,7 @@ xnestCreateWindow(WindowPtr pWin)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
xnestWindowPriv(pWin)->window = XCreateWindow(xnestDisplay,
|
xnestWindowPriv(pWin)->window = XCreateWindow(xnscr->upstreamDisplay,
|
||||||
xnestWindowParent(pWin),
|
xnestWindowParent(pWin),
|
||||||
pWin->origin.x -
|
pWin->origin.x -
|
||||||
wBorderWidth(pWin),
|
wBorderWidth(pWin),
|
||||||
|
|
@ -148,12 +149,14 @@ xnestCreateWindow(WindowPtr pWin)
|
||||||
Bool
|
Bool
|
||||||
xnestDestroyWindow(WindowPtr pWin)
|
xnestDestroyWindow(WindowPtr pWin)
|
||||||
{
|
{
|
||||||
|
XnestScreenPtr xnscr = xnestScreenPriv(pWin->drawable.pScreen);
|
||||||
|
|
||||||
if (pWin->nextSib)
|
if (pWin->nextSib)
|
||||||
xnestWindowPriv(pWin->nextSib)->sibling_above =
|
xnestWindowPriv(pWin->nextSib)->sibling_above =
|
||||||
xnestWindowPriv(pWin)->sibling_above;
|
xnestWindowPriv(pWin)->sibling_above;
|
||||||
RegionDestroy(xnestWindowPriv(pWin)->bounding_shape);
|
RegionDestroy(xnestWindowPriv(pWin)->bounding_shape);
|
||||||
RegionDestroy(xnestWindowPriv(pWin)->clip_shape);
|
RegionDestroy(xnestWindowPriv(pWin)->clip_shape);
|
||||||
XDestroyWindow(xnestDisplay, xnestWindow(pWin));
|
XDestroyWindow(xnscr->upstreamDisplay, xnestWindow(pWin));
|
||||||
xnestWindowPriv(pWin)->window = None;
|
xnestWindowPriv(pWin)->window = None;
|
||||||
|
|
||||||
if (pWin->optional && pWin->optional->colormap && pWin->parent)
|
if (pWin->optional && pWin->optional->colormap && pWin->parent)
|
||||||
|
|
@ -177,10 +180,11 @@ xnestConfigureWindow(WindowPtr pWin, unsigned int mask)
|
||||||
{
|
{
|
||||||
unsigned int valuemask;
|
unsigned int valuemask;
|
||||||
XWindowChanges values;
|
XWindowChanges values;
|
||||||
|
XnestScreenPtr xnscr = xnestScreenPriv(pWin->drawable.pScreen);
|
||||||
|
|
||||||
if (mask & CWParent &&
|
if (mask & CWParent &&
|
||||||
xnestWindowPriv(pWin)->parent != xnestWindowParent(pWin)) {
|
xnestWindowPriv(pWin)->parent != xnestWindowParent(pWin)) {
|
||||||
XReparentWindow(xnestDisplay, xnestWindow(pWin),
|
XReparentWindow(xnscr->upstreamDisplay, xnestWindow(pWin),
|
||||||
xnestWindowParent(pWin),
|
xnestWindowParent(pWin),
|
||||||
pWin->origin.x - wBorderWidth(pWin),
|
pWin->origin.x - wBorderWidth(pWin),
|
||||||
pWin->origin.y - wBorderWidth(pWin));
|
pWin->origin.y - wBorderWidth(pWin));
|
||||||
|
|
@ -227,7 +231,7 @@ xnestConfigureWindow(WindowPtr pWin, unsigned int mask)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (valuemask)
|
if (valuemask)
|
||||||
XConfigureWindow(xnestDisplay, xnestWindow(pWin), valuemask, &values);
|
XConfigureWindow(xnscr->upstreamDisplay, xnestWindow(pWin), valuemask, &values);
|
||||||
|
|
||||||
if (mask & CWStackingOrder &&
|
if (mask & CWStackingOrder &&
|
||||||
xnestWindowPriv(pWin)->sibling_above != xnestWindowSiblingAbove(pWin)) {
|
xnestWindowPriv(pWin)->sibling_above != xnestWindowSiblingAbove(pWin)) {
|
||||||
|
|
@ -239,7 +243,7 @@ xnestConfigureWindow(WindowPtr pWin, unsigned int mask)
|
||||||
/* the top sibling */
|
/* the top sibling */
|
||||||
valuemask = CWStackMode;
|
valuemask = CWStackMode;
|
||||||
values.stack_mode = Above;
|
values.stack_mode = Above;
|
||||||
XConfigureWindow(xnestDisplay, xnestWindow(pSib), valuemask, &values);
|
XConfigureWindow(xnscr->upstreamDisplay, xnestWindow(pSib), valuemask, &values);
|
||||||
xnestWindowPriv(pSib)->sibling_above = None;
|
xnestWindowPriv(pSib)->sibling_above = None;
|
||||||
|
|
||||||
/* the rest of siblings */
|
/* the rest of siblings */
|
||||||
|
|
@ -247,7 +251,7 @@ xnestConfigureWindow(WindowPtr pWin, unsigned int mask)
|
||||||
valuemask = CWSibling | CWStackMode;
|
valuemask = CWSibling | CWStackMode;
|
||||||
values.sibling = xnestWindowSiblingAbove(pSib);
|
values.sibling = xnestWindowSiblingAbove(pSib);
|
||||||
values.stack_mode = Below;
|
values.stack_mode = Below;
|
||||||
XConfigureWindow(xnestDisplay, xnestWindow(pSib), valuemask,
|
XConfigureWindow(xnscr->upstreamDisplay, xnestWindow(pSib), valuemask,
|
||||||
&values);
|
&values);
|
||||||
xnestWindowPriv(pSib)->sibling_above =
|
xnestWindowPriv(pSib)->sibling_above =
|
||||||
xnestWindowSiblingAbove(pSib);
|
xnestWindowSiblingAbove(pSib);
|
||||||
|
|
@ -259,6 +263,7 @@ Bool
|
||||||
xnestChangeWindowAttributes(WindowPtr pWin, unsigned long mask)
|
xnestChangeWindowAttributes(WindowPtr pWin, unsigned long mask)
|
||||||
{
|
{
|
||||||
XSetWindowAttributes attributes;
|
XSetWindowAttributes attributes;
|
||||||
|
XnestScreenPtr xnscr = xnestScreenPriv(pWin->drawable.pScreen);
|
||||||
|
|
||||||
if (mask & CWBackPixmap)
|
if (mask & CWBackPixmap)
|
||||||
switch (pWin->backgroundState) {
|
switch (pWin->backgroundState) {
|
||||||
|
|
@ -342,7 +347,7 @@ xnestChangeWindowAttributes(WindowPtr pWin, unsigned long mask)
|
||||||
mask &= ~CWCursor;
|
mask &= ~CWCursor;
|
||||||
|
|
||||||
if (mask)
|
if (mask)
|
||||||
XChangeWindowAttributes(xnestDisplay, xnestWindow(pWin),
|
XChangeWindowAttributes(xnscr->upstreamDisplay, xnestWindow(pWin),
|
||||||
mask, &attributes);
|
mask, &attributes);
|
||||||
|
|
||||||
return True;
|
return True;
|
||||||
|
|
@ -351,9 +356,11 @@ xnestChangeWindowAttributes(WindowPtr pWin, unsigned long mask)
|
||||||
Bool
|
Bool
|
||||||
xnestRealizeWindow(WindowPtr pWin)
|
xnestRealizeWindow(WindowPtr pWin)
|
||||||
{
|
{
|
||||||
|
XnestScreenPtr xnscr = xnestScreenPriv(pWin->drawable.pScreen);
|
||||||
|
|
||||||
xnestConfigureWindow(pWin, CWStackingOrder);
|
xnestConfigureWindow(pWin, CWStackingOrder);
|
||||||
xnestShapeWindow(pWin);
|
xnestShapeWindow(pWin);
|
||||||
XMapWindow(xnestDisplay, xnestWindow(pWin));
|
XMapWindow(xnscr->upstreamDisplay, xnestWindow(pWin));
|
||||||
|
|
||||||
return True;
|
return True;
|
||||||
}
|
}
|
||||||
|
|
@ -361,7 +368,9 @@ xnestRealizeWindow(WindowPtr pWin)
|
||||||
Bool
|
Bool
|
||||||
xnestUnrealizeWindow(WindowPtr pWin)
|
xnestUnrealizeWindow(WindowPtr pWin)
|
||||||
{
|
{
|
||||||
XUnmapWindow(xnestDisplay, xnestWindow(pWin));
|
XnestScreenPtr xnscr = xnestScreenPriv(pWin->drawable.pScreen);
|
||||||
|
|
||||||
|
XUnmapWindow(xnscr->upstreamDisplay, xnestWindow(pWin));
|
||||||
|
|
||||||
return True;
|
return True;
|
||||||
}
|
}
|
||||||
|
|
@ -390,6 +399,7 @@ xnestWindowExposures(WindowPtr pWin, RegionPtr pRgn)
|
||||||
XEvent event;
|
XEvent event;
|
||||||
Window window;
|
Window window;
|
||||||
BoxRec Box;
|
BoxRec Box;
|
||||||
|
XnestScreenPtr xnscr = xnestScreenPriv(pWin->drawable.pScreen);
|
||||||
|
|
||||||
XSync(xnestDisplay, False);
|
XSync(xnestDisplay, False);
|
||||||
|
|
||||||
|
|
@ -406,7 +416,7 @@ xnestWindowExposures(WindowPtr pWin, RegionPtr pRgn)
|
||||||
event.xexpose.type = ProcessedExpose;
|
event.xexpose.type = ProcessedExpose;
|
||||||
|
|
||||||
if (RegionContainsRect(pRgn, &Box) != rgnIN)
|
if (RegionContainsRect(pRgn, &Box) != rgnIN)
|
||||||
XPutBackEvent(xnestDisplay, &event);
|
XPutBackEvent(xnscr->upstreamDisplay, &event);
|
||||||
}
|
}
|
||||||
|
|
||||||
miWindowExposures(pWin, pRgn);
|
miWindowExposures(pWin, pRgn);
|
||||||
|
|
@ -456,6 +466,7 @@ xnestShapeWindow(WindowPtr pWin)
|
||||||
BoxPtr pBox;
|
BoxPtr pBox;
|
||||||
XRectangle rect;
|
XRectangle rect;
|
||||||
int i;
|
int i;
|
||||||
|
XnestScreenPtr xnscr = xnestScreenPriv(pWin->drawable.pScreen);
|
||||||
|
|
||||||
if (!xnestRegionEqual(xnestWindowPriv(pWin)->bounding_shape,
|
if (!xnestRegionEqual(xnestWindowPriv(pWin)->bounding_shape,
|
||||||
wBoundingShape(pWin))) {
|
wBoundingShape(pWin))) {
|
||||||
|
|
@ -475,14 +486,14 @@ xnestShapeWindow(WindowPtr pWin)
|
||||||
rect.height = pBox[i].y2 - pBox[i].y1;
|
rect.height = pBox[i].y2 - pBox[i].y1;
|
||||||
XUnionRectWithRegion(&rect, reg, reg);
|
XUnionRectWithRegion(&rect, reg, reg);
|
||||||
}
|
}
|
||||||
XShapeCombineRegion(xnestDisplay, xnestWindow(pWin),
|
XShapeCombineRegion(xnscr->upstreamDisplay, xnestWindow(pWin),
|
||||||
ShapeBounding, 0, 0, reg, ShapeSet);
|
ShapeBounding, 0, 0, reg, ShapeSet);
|
||||||
XDestroyRegion(reg);
|
XDestroyRegion(reg);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
RegionEmpty(xnestWindowPriv(pWin)->bounding_shape);
|
RegionEmpty(xnestWindowPriv(pWin)->bounding_shape);
|
||||||
|
|
||||||
XShapeCombineMask(xnestDisplay, xnestWindow(pWin),
|
XShapeCombineMask(xnscr->upstreamDisplay, xnestWindow(pWin),
|
||||||
ShapeBounding, 0, 0, None, ShapeSet);
|
ShapeBounding, 0, 0, None, ShapeSet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -502,14 +513,14 @@ xnestShapeWindow(WindowPtr pWin)
|
||||||
rect.height = pBox[i].y2 - pBox[i].y1;
|
rect.height = pBox[i].y2 - pBox[i].y1;
|
||||||
XUnionRectWithRegion(&rect, reg, reg);
|
XUnionRectWithRegion(&rect, reg, reg);
|
||||||
}
|
}
|
||||||
XShapeCombineRegion(xnestDisplay, xnestWindow(pWin),
|
XShapeCombineRegion(xnscr->upstreamDisplay, xnestWindow(pWin),
|
||||||
ShapeClip, 0, 0, reg, ShapeSet);
|
ShapeClip, 0, 0, reg, ShapeSet);
|
||||||
XDestroyRegion(reg);
|
XDestroyRegion(reg);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
RegionEmpty(xnestWindowPriv(pWin)->clip_shape);
|
RegionEmpty(xnestWindowPriv(pWin)->clip_shape);
|
||||||
|
|
||||||
XShapeCombineMask(xnestDisplay, xnestWindow(pWin),
|
XShapeCombineMask(xnscr->upstreamDisplay, xnestWindow(pWin),
|
||||||
ShapeClip, 0, 0, None, ShapeSet);
|
ShapeClip, 0, 0, None, ShapeSet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,8 @@
|
||||||
#include "screenint.h"
|
#include "screenint.h"
|
||||||
|
|
||||||
typedef struct xnest_screen {
|
typedef struct xnest_screen {
|
||||||
|
int clonedFrom;
|
||||||
|
Display *upstreamDisplay;
|
||||||
Window rootWindow;
|
Window rootWindow;
|
||||||
Window screenSaverWindow;
|
Window screenSaverWindow;
|
||||||
ScreenPtr pScreen;
|
ScreenPtr pScreen;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue