2003-11-14 16:54:54 +01:00
|
|
|
/* $Xorg: Screen.c,v 1.3 2000/08/17 19:53:28 cpqbld Exp $ */
|
|
|
|
/*
|
|
|
|
|
|
|
|
Copyright 1993 by Davor Matic
|
|
|
|
|
|
|
|
Permission to use, copy, modify, distribute, and sell this software
|
|
|
|
and its documentation for any purpose is hereby granted without fee,
|
|
|
|
provided that the above copyright notice appear in all copies and that
|
|
|
|
both that copyright notice and this permission notice appear in
|
|
|
|
supporting documentation. Davor Matic makes no representations about
|
|
|
|
the suitability of this software for any purpose. It is provided "as
|
|
|
|
is" without express or implied warranty.
|
|
|
|
|
|
|
|
*/
|
2004-04-23 21:54:30 +02:00
|
|
|
/* $XFree86: xc/programs/Xserver/hw/xnest/Screen.c,v 3.12 2003/11/14 22:25:59 dawes Exp $ */
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
#include "X.h"
|
|
|
|
#include "Xproto.h"
|
|
|
|
#include "scrnintstr.h"
|
|
|
|
#include "dix.h"
|
|
|
|
#include "mi.h"
|
|
|
|
#include "mibstore.h"
|
2003-11-25 20:29:01 +01:00
|
|
|
#include "micmap.h"
|
2003-11-14 16:54:54 +01:00
|
|
|
#include "colormapst.h"
|
|
|
|
#include "resource.h"
|
|
|
|
|
|
|
|
#include "Xnest.h"
|
|
|
|
|
|
|
|
#include "Display.h"
|
|
|
|
#include "Screen.h"
|
|
|
|
#include "XNGC.h"
|
|
|
|
#include "GCOps.h"
|
|
|
|
#include "Drawable.h"
|
|
|
|
#include "XNFont.h"
|
|
|
|
#include "Color.h"
|
2003-11-14 17:49:22 +01:00
|
|
|
#include "XNCursor.h"
|
2003-11-14 16:54:54 +01:00
|
|
|
#include "Visual.h"
|
|
|
|
#include "Events.h"
|
|
|
|
#include "Init.h"
|
2003-11-14 17:49:22 +01:00
|
|
|
#include "mipointer.h"
|
2003-11-14 16:54:54 +01:00
|
|
|
#include "Args.h"
|
|
|
|
|
|
|
|
Window xnestDefaultWindows[MAXSCREENS];
|
|
|
|
Window xnestScreenSaverWindows[MAXSCREENS];
|
|
|
|
|
2003-11-25 20:29:01 +01:00
|
|
|
#ifdef GLXEXT
|
|
|
|
extern void GlxWrapInitVisuals(miInitVisualsProcPtr *);
|
|
|
|
#endif
|
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
#ifdef PIXPRIV
|
|
|
|
int xnestScreenGeneration = -1;
|
|
|
|
#endif
|
|
|
|
|
2003-11-25 20:29:01 +01:00
|
|
|
ScreenPtr
|
|
|
|
xnestScreen(Window window)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < xnestNumScreens; i++)
|
|
|
|
if (xnestDefaultWindows[i] == window)
|
|
|
|
return screenInfo.screens[i];
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2003-11-25 20:29:01 +01:00
|
|
|
static int
|
|
|
|
offset(unsigned long mask)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
|
|
|
int count;
|
|
|
|
|
|
|
|
for (count = 0; !(mask & 1) && count < 32; count++)
|
|
|
|
mask >>= 1;
|
|
|
|
|
|
|
|
return count;
|
|
|
|
}
|
|
|
|
|
2003-11-25 20:29:01 +01:00
|
|
|
static Bool
|
|
|
|
xnestSaveScreen(ScreenPtr pScreen, int what)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
|
|
|
if (xnestSoftwareScreenSaver)
|
|
|
|
return False;
|
|
|
|
else {
|
|
|
|
switch (what) {
|
|
|
|
case SCREEN_SAVER_ON:
|
|
|
|
XMapRaised(xnestDisplay, xnestScreenSaverWindows[pScreen->myNum]);
|
|
|
|
xnestSetScreenSaverColormapWindow(pScreen);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SCREEN_SAVER_OFF:
|
|
|
|
XUnmapWindow(xnestDisplay, xnestScreenSaverWindows[pScreen->myNum]);
|
|
|
|
xnestSetInstalledColormapWindows(pScreen);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SCREEN_SAVER_FORCER:
|
|
|
|
lastEventTime = GetTimeInMillis();
|
|
|
|
XUnmapWindow(xnestDisplay, xnestScreenSaverWindows[pScreen->myNum]);
|
|
|
|
xnestSetInstalledColormapWindows(pScreen);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SCREEN_SAVER_CYCLE:
|
|
|
|
XUnmapWindow(xnestDisplay, xnestScreenSaverWindows[pScreen->myNum]);
|
|
|
|
xnestSetInstalledColormapWindows(pScreen);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return True;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
static Bool
|
2003-11-25 20:29:01 +01:00
|
|
|
xnestCursorOffScreen(ScreenPtr *ppScreen, int *x, int *y)
|
2003-11-14 17:49:22 +01:00
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2003-11-25 20:29:01 +01:00
|
|
|
xnestCrossScreen(ScreenPtr pScreen, Bool entering)
|
2003-11-14 17:49:22 +01:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static miPointerScreenFuncRec xnestPointerCursorFuncs =
|
|
|
|
{
|
|
|
|
xnestCursorOffScreen,
|
|
|
|
xnestCrossScreen,
|
|
|
|
miPointerWarpCursor
|
|
|
|
};
|
|
|
|
|
2004-08-12 00:40:14 +02:00
|
|
|
static miPointerSpriteFuncRec xnestPointerSpriteFuncs =
|
|
|
|
{
|
|
|
|
xnestRealizeCursor,
|
|
|
|
xnestUnrealizeCursor,
|
|
|
|
xnestSetCursor,
|
|
|
|
xnestMoveCursor,
|
|
|
|
};
|
|
|
|
|
2003-11-25 20:29:01 +01:00
|
|
|
Bool
|
|
|
|
xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[])
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
|
|
|
VisualPtr visuals;
|
|
|
|
DepthPtr depths;
|
|
|
|
int numVisuals, numDepths;
|
|
|
|
int i, j, depthIndex;
|
|
|
|
unsigned long valuemask;
|
|
|
|
XSetWindowAttributes attributes;
|
|
|
|
XWindowAttributes gattributes;
|
|
|
|
XSizeHints sizeHints;
|
2003-11-25 20:29:01 +01:00
|
|
|
VisualID defaultVisual;
|
|
|
|
int rootDepth;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
if (!(AllocateWindowPrivate(pScreen, xnestWindowPrivateIndex,
|
|
|
|
sizeof(xnestPrivWin)) &&
|
|
|
|
AllocateGCPrivate(pScreen, xnestGCPrivateIndex,
|
|
|
|
sizeof(xnestPrivGC))))
|
|
|
|
return False;
|
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
#ifdef PIXPRIV
|
|
|
|
if (xnestScreenGeneration != serverGeneration) {
|
|
|
|
if ((xnestPixmapPrivateIndex = AllocatePixmapPrivateIndex()) < 0)
|
|
|
|
return False;
|
|
|
|
xnestScreenGeneration = serverGeneration;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!AllocatePixmapPrivate(pScreen,xnestPixmapPrivateIndex,
|
|
|
|
sizeof (xnestPrivPixmap)))
|
|
|
|
return False;
|
|
|
|
#endif
|
2003-11-14 16:54:54 +01:00
|
|
|
visuals = (VisualPtr)xalloc(xnestNumVisuals * sizeof(VisualRec));
|
|
|
|
numVisuals = 0;
|
|
|
|
|
|
|
|
depths = (DepthPtr)xalloc(MAXDEPTH * sizeof(DepthRec));
|
|
|
|
depths[0].depth = 1;
|
|
|
|
depths[0].numVids = 0;
|
|
|
|
depths[0].vids = (VisualID *)xalloc(MAXVISUALSPERDEPTH * sizeof(VisualID));
|
|
|
|
numDepths = 1;
|
|
|
|
|
|
|
|
for (i = 0; i < xnestNumVisuals; i++) {
|
|
|
|
visuals[numVisuals].class = xnestVisuals[i].class;
|
|
|
|
visuals[numVisuals].bitsPerRGBValue = xnestVisuals[i].bits_per_rgb;
|
|
|
|
visuals[numVisuals].ColormapEntries = xnestVisuals[i].colormap_size;
|
|
|
|
visuals[numVisuals].nplanes = xnestVisuals[i].depth;
|
|
|
|
visuals[numVisuals].redMask = xnestVisuals[i].red_mask;
|
|
|
|
visuals[numVisuals].greenMask = xnestVisuals[i].green_mask;
|
|
|
|
visuals[numVisuals].blueMask = xnestVisuals[i].blue_mask;
|
|
|
|
visuals[numVisuals].offsetRed = offset(xnestVisuals[i].red_mask);
|
|
|
|
visuals[numVisuals].offsetGreen = offset(xnestVisuals[i].green_mask);
|
|
|
|
visuals[numVisuals].offsetBlue = offset(xnestVisuals[i].blue_mask);
|
2003-11-25 20:29:01 +01:00
|
|
|
|
|
|
|
/* Check for and remove duplicates. */
|
|
|
|
for (j = 0; j < numVisuals; j++) {
|
|
|
|
if (visuals[numVisuals].class == visuals[j].class &&
|
|
|
|
visuals[numVisuals].bitsPerRGBValue == visuals[j].bitsPerRGBValue &&
|
|
|
|
visuals[numVisuals].ColormapEntries == visuals[j].ColormapEntries &&
|
|
|
|
visuals[numVisuals].nplanes == visuals[j].nplanes &&
|
|
|
|
visuals[numVisuals].redMask == visuals[j].redMask &&
|
|
|
|
visuals[numVisuals].greenMask == visuals[j].greenMask &&
|
|
|
|
visuals[numVisuals].blueMask == visuals[j].blueMask &&
|
|
|
|
visuals[numVisuals].offsetRed == visuals[j].offsetRed &&
|
|
|
|
visuals[numVisuals].offsetGreen == visuals[j].offsetGreen &&
|
|
|
|
visuals[numVisuals].offsetBlue == visuals[j].offsetBlue)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (j < numVisuals)
|
|
|
|
break;
|
|
|
|
|
|
|
|
visuals[numVisuals].vid = FakeClientID(0);
|
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
depthIndex = UNDEFINED;
|
|
|
|
for (j = 0; j < numDepths; j++)
|
|
|
|
if (depths[j].depth == xnestVisuals[i].depth) {
|
|
|
|
depthIndex = j;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (depthIndex == UNDEFINED) {
|
|
|
|
depthIndex = numDepths;
|
|
|
|
depths[depthIndex].depth = xnestVisuals[i].depth;
|
|
|
|
depths[depthIndex].numVids = 0;
|
|
|
|
depths[depthIndex].vids =
|
|
|
|
(VisualID *)xalloc(MAXVISUALSPERDEPTH * sizeof(VisualID));
|
|
|
|
numDepths++;
|
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
if (depths[depthIndex].numVids >= MAXVISUALSPERDEPTH) {
|
|
|
|
FatalError("Visual table overflow");
|
|
|
|
}
|
2003-11-14 16:54:54 +01:00
|
|
|
depths[depthIndex].vids[depths[depthIndex].numVids] =
|
|
|
|
visuals[numVisuals].vid;
|
|
|
|
depths[depthIndex].numVids++;
|
|
|
|
|
|
|
|
numVisuals++;
|
|
|
|
}
|
2003-11-25 20:29:01 +01:00
|
|
|
visuals = (VisualPtr)xrealloc(visuals, numVisuals * sizeof(VisualRec));
|
|
|
|
|
|
|
|
defaultVisual = visuals[xnestDefaultVisualIndex].vid;
|
|
|
|
rootDepth = visuals[xnestDefaultVisualIndex].nplanes;
|
|
|
|
|
|
|
|
#ifdef GLXEXT
|
|
|
|
{
|
|
|
|
miInitVisualsProcPtr proc = NULL;
|
|
|
|
|
|
|
|
GlxWrapInitVisuals(&proc);
|
|
|
|
/* GlxInitVisuals ignores the last three arguments. */
|
|
|
|
proc(&visuals, &depths, &numVisuals, &numDepths,
|
|
|
|
&rootDepth, &defaultVisual, 0, 0, 0);
|
|
|
|
}
|
|
|
|
#endif
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
if (xnestParentWindow != 0) {
|
|
|
|
XGetWindowAttributes(xnestDisplay, xnestParentWindow, &gattributes);
|
|
|
|
xnestWidth = gattributes.width;
|
|
|
|
xnestHeight = gattributes.height;
|
|
|
|
}
|
|
|
|
|
2005-02-23 20:17:10 +01:00
|
|
|
/* myNum */
|
|
|
|
/* id */
|
|
|
|
miScreenInit(pScreen, NULL, xnestWidth, xnestHeight, 1, 1, xnestWidth,
|
|
|
|
rootDepth,
|
|
|
|
numDepths, depths,
|
|
|
|
defaultVisual, /* root visual */
|
|
|
|
numVisuals, visuals);
|
|
|
|
|
|
|
|
/* miInitializeBackingStore(pScreen); */
|
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
pScreen->defColormap = (Colormap) FakeClientID(0);
|
|
|
|
pScreen->minInstalledCmaps = MINCMAPS;
|
|
|
|
pScreen->maxInstalledCmaps = MAXCMAPS;
|
|
|
|
pScreen->backingStoreSupport = NotUseful;
|
|
|
|
pScreen->saveUnderSupport = NotUseful;
|
|
|
|
pScreen->whitePixel = xnestWhitePixel;
|
|
|
|
pScreen->blackPixel = xnestBlackPixel;
|
|
|
|
/* rgf */
|
|
|
|
/* GCperDepth */
|
|
|
|
/* PixmapPerDepth */
|
|
|
|
pScreen->devPrivate = NULL;
|
|
|
|
/* WindowPrivateLen */
|
|
|
|
/* WindowPrivateSizes */
|
|
|
|
/* totalWindowSize */
|
|
|
|
/* GCPrivateLen */
|
|
|
|
/* GCPrivateSizes */
|
|
|
|
/* totalGCSize */
|
|
|
|
|
|
|
|
/* Random screen procedures */
|
|
|
|
|
|
|
|
pScreen->QueryBestSize = xnestQueryBestSize;
|
|
|
|
pScreen->SaveScreen = xnestSaveScreen;
|
|
|
|
pScreen->GetImage = xnestGetImage;
|
|
|
|
pScreen->GetSpans = xnestGetSpans;
|
2003-11-25 20:29:01 +01:00
|
|
|
pScreen->PointerNonInterestBox = NULL;
|
|
|
|
pScreen->SourceValidate = NULL;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
/* Window Procedures */
|
|
|
|
|
|
|
|
pScreen->CreateWindow = xnestCreateWindow;
|
|
|
|
pScreen->DestroyWindow = xnestDestroyWindow;
|
|
|
|
pScreen->PositionWindow = xnestPositionWindow;
|
|
|
|
pScreen->ChangeWindowAttributes = xnestChangeWindowAttributes;
|
|
|
|
pScreen->RealizeWindow = xnestRealizeWindow;
|
|
|
|
pScreen->UnrealizeWindow = xnestUnrealizeWindow;
|
2003-11-25 20:29:01 +01:00
|
|
|
pScreen->PostValidateTree = NULL;
|
2003-11-14 16:54:54 +01:00
|
|
|
pScreen->WindowExposures = xnestWindowExposures;
|
|
|
|
pScreen->PaintWindowBackground = xnestPaintWindowBackground;
|
|
|
|
pScreen->PaintWindowBorder = xnestPaintWindowBorder;
|
|
|
|
pScreen->CopyWindow = xnestCopyWindow;
|
|
|
|
pScreen->ClipNotify = xnestClipNotify;
|
|
|
|
|
|
|
|
/* Pixmap procedures */
|
|
|
|
|
|
|
|
pScreen->CreatePixmap = xnestCreatePixmap;
|
|
|
|
pScreen->DestroyPixmap = xnestDestroyPixmap;
|
|
|
|
|
|
|
|
/* Backing store procedures */
|
|
|
|
|
2003-11-25 20:29:01 +01:00
|
|
|
pScreen->SaveDoomedAreas = NULL;
|
|
|
|
pScreen->RestoreAreas = NULL;
|
|
|
|
pScreen->ExposeCopy = NULL;
|
|
|
|
pScreen->TranslateBackingStore = NULL;
|
|
|
|
pScreen->ClearBackingStore = NULL;
|
|
|
|
pScreen->DrawGuarantee = NULL;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
/* Font procedures */
|
|
|
|
|
|
|
|
pScreen->RealizeFont = xnestRealizeFont;
|
|
|
|
pScreen->UnrealizeFont = xnestUnrealizeFont;
|
|
|
|
|
|
|
|
/* GC procedures */
|
|
|
|
|
|
|
|
pScreen->CreateGC = xnestCreateGC;
|
|
|
|
|
|
|
|
/* Colormap procedures */
|
|
|
|
|
|
|
|
pScreen->CreateColormap = xnestCreateColormap;
|
|
|
|
pScreen->DestroyColormap = xnestDestroyColormap;
|
|
|
|
pScreen->InstallColormap = xnestInstallColormap;
|
|
|
|
pScreen->UninstallColormap = xnestUninstallColormap;
|
|
|
|
pScreen->ListInstalledColormaps = xnestListInstalledColormaps;
|
|
|
|
pScreen->StoreColors = xnestStoreColors;
|
|
|
|
pScreen->ResolveColor = xnestResolveColor;
|
|
|
|
|
|
|
|
pScreen->BitmapToRegion = xnestPixmapToRegion;
|
|
|
|
|
|
|
|
/* OS layer procedures */
|
|
|
|
|
2003-11-25 20:29:01 +01:00
|
|
|
pScreen->BlockHandler = (ScreenBlockHandlerProcPtr)NoopDDA;
|
|
|
|
pScreen->WakeupHandler = (ScreenWakeupHandlerProcPtr)NoopDDA;
|
|
|
|
pScreen->blockData = NULL;
|
|
|
|
pScreen->wakeupData = NULL;
|
2004-08-12 00:40:14 +02:00
|
|
|
|
|
|
|
miPointerInitialize (pScreen, &xnestPointerSpriteFuncs,
|
|
|
|
&xnestPointerCursorFuncs, True);
|
|
|
|
|
|
|
|
pScreen->mmWidth = xnestWidth * DisplayWidthMM(xnestDisplay,
|
|
|
|
DefaultScreen(xnestDisplay)) /
|
|
|
|
DisplayWidth(xnestDisplay,
|
|
|
|
DefaultScreen(xnestDisplay));
|
|
|
|
pScreen->mmHeight = xnestHeight * DisplayHeightMM(xnestDisplay,
|
|
|
|
DefaultScreen(xnestDisplay)) /
|
|
|
|
DisplayHeight(xnestDisplay,
|
|
|
|
DefaultScreen(xnestDisplay));
|
|
|
|
|
|
|
|
/* overwrite miCloseScreen with our own */
|
|
|
|
pScreen->CloseScreen = xnestCloseScreen;
|
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
if (!miScreenDevPrivateInit(pScreen, xnestWidth, NULL))
|
|
|
|
return FALSE;
|
|
|
|
|
2005-03-02 15:21:40 +01:00
|
|
|
#ifdef SHAPE
|
|
|
|
/* overwrite miSetShape with our own */
|
|
|
|
pScreen->SetShape = xnestSetShape;
|
|
|
|
#endif /* SHAPE */
|
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
/* devPrivates */
|
|
|
|
|
|
|
|
#define POSITION_OFFSET (pScreen->myNum * (xnestWidth + xnestHeight) / 32)
|
|
|
|
|
|
|
|
if (xnestDoFullGeneration) {
|
|
|
|
|
|
|
|
valuemask = CWBackPixel | CWEventMask | CWColormap;
|
|
|
|
attributes.background_pixel = xnestWhitePixel;
|
|
|
|
attributes.event_mask = xnestEventMask;
|
|
|
|
attributes.colormap = xnestDefaultVisualColormap(xnestDefaultVisual(pScreen));
|
|
|
|
|
|
|
|
if (xnestParentWindow != 0) {
|
|
|
|
xnestDefaultWindows[pScreen->myNum] = xnestParentWindow;
|
|
|
|
XSelectInput (xnestDisplay, xnestDefaultWindows[pScreen->myNum],
|
|
|
|
xnestEventMask);
|
|
|
|
} else
|
|
|
|
xnestDefaultWindows[pScreen->myNum] =
|
|
|
|
XCreateWindow(xnestDisplay,
|
|
|
|
DefaultRootWindow(xnestDisplay),
|
|
|
|
xnestX + POSITION_OFFSET,
|
|
|
|
xnestY + POSITION_OFFSET,
|
|
|
|
xnestWidth, xnestHeight,
|
|
|
|
xnestBorderWidth,
|
|
|
|
pScreen->rootDepth,
|
|
|
|
InputOutput,
|
|
|
|
xnestDefaultVisual(pScreen),
|
|
|
|
valuemask, &attributes);
|
|
|
|
|
|
|
|
if (!xnestWindowName)
|
|
|
|
xnestWindowName = argv[0];
|
|
|
|
|
|
|
|
sizeHints.flags = PPosition | PSize | PMaxSize;
|
|
|
|
sizeHints.x = xnestX + POSITION_OFFSET;
|
|
|
|
sizeHints.y = xnestY + POSITION_OFFSET;
|
|
|
|
sizeHints.width = sizeHints.max_width = xnestWidth;
|
|
|
|
sizeHints.height = sizeHints.max_height = xnestHeight;
|
|
|
|
if (xnestUserGeometry & XValue || xnestUserGeometry & YValue)
|
|
|
|
sizeHints.flags |= USPosition;
|
|
|
|
if (xnestUserGeometry & WidthValue || xnestUserGeometry & HeightValue)
|
|
|
|
sizeHints.flags |= USSize;
|
|
|
|
XSetStandardProperties(xnestDisplay,
|
|
|
|
xnestDefaultWindows[pScreen->myNum],
|
|
|
|
xnestWindowName,
|
|
|
|
xnestWindowName,
|
|
|
|
xnestIconBitmap,
|
|
|
|
argv, argc, &sizeHints);
|
|
|
|
|
|
|
|
XMapWindow(xnestDisplay, xnestDefaultWindows[pScreen->myNum]);
|
|
|
|
|
|
|
|
valuemask = CWBackPixmap | CWColormap;
|
|
|
|
attributes.background_pixmap = xnestScreenSaverPixmap;
|
|
|
|
attributes.colormap =
|
|
|
|
DefaultColormap(xnestDisplay, DefaultScreen(xnestDisplay));
|
|
|
|
xnestScreenSaverWindows[pScreen->myNum] =
|
|
|
|
XCreateWindow(xnestDisplay,
|
|
|
|
xnestDefaultWindows[pScreen->myNum],
|
|
|
|
0, 0, xnestWidth, xnestHeight, 0,
|
|
|
|
DefaultDepth(xnestDisplay, DefaultScreen(xnestDisplay)),
|
|
|
|
InputOutput,
|
|
|
|
DefaultVisual(xnestDisplay, DefaultScreen(xnestDisplay)),
|
|
|
|
valuemask, &attributes);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!xnestCreateDefaultColormap(pScreen)) return False;
|
|
|
|
|
|
|
|
return True;
|
|
|
|
}
|
|
|
|
|
2003-11-25 20:29:01 +01:00
|
|
|
Bool
|
|
|
|
xnestCloseScreen(int index, ScreenPtr pScreen)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < pScreen->numDepths; i++)
|
|
|
|
xfree(pScreen->allowedDepths[i].vids);
|
|
|
|
xfree(pScreen->allowedDepths);
|
|
|
|
xfree(pScreen->visuals);
|
|
|
|
xfree(pScreen->devPrivate);
|
|
|
|
|
|
|
|
/*
|
|
|
|
If xnestDoFullGeneration all x resources will be destroyed upon closing
|
|
|
|
the display connection. There is no need to generate extra protocol.
|
|
|
|
*/
|
|
|
|
|
|
|
|
return True;
|
|
|
|
}
|