Commit 8fcaafab authored by Ulrich Sibiller's avatar Ulrich Sibiller Committed by Mike Gabriel

nxagent: drop nxagentRootTileWindow

We either use a solid black or a white background and no backround pixmap. So nxagentRootTileWindow is always empty and we can drop all stuff around it. remove nxagentSplashCount, too, since it is no longer checked anywhere.
parent be508a44
...@@ -305,7 +305,6 @@ SetWindowToDefaults(register WindowPtr pWin) ...@@ -305,7 +305,6 @@ SetWindowToDefaults(register WindowPtr pWin)
#endif #endif
} }
#ifndef NXAGENT_SERVER
static void static void
MakeRootTile(WindowPtr pWin) MakeRootTile(WindowPtr pWin)
{ {
...@@ -348,7 +347,6 @@ MakeRootTile(WindowPtr pWin) ...@@ -348,7 +347,6 @@ MakeRootTile(WindowPtr pWin)
FreeScratchGC(pGC); FreeScratchGC(pGC);
} }
#endif /* NXAGENT_SERVER */
WindowPtr WindowPtr
AllocateWindow(ScreenPtr pScreen) AllocateWindow(ScreenPtr pScreen)
......
...@@ -124,7 +124,6 @@ ...@@ -124,7 +124,6 @@
extern Bool nxagentOnce; extern Bool nxagentOnce;
extern WindowPtr nxagentRootTileWindow; extern WindowPtr nxagentRootTileWindow;
extern int nxagentSplashCount;
extern int nxagentLastClipboardClient; extern int nxagentLastClipboardClient;
...@@ -2453,20 +2452,6 @@ FIXME: This can be maybe optimized by consuming the ...@@ -2453,20 +2452,6 @@ FIXME: This can be maybe optimized by consuming the
} }
} }
if (nxagentRootTileWindow != NULL)
{
if (nxagentWindowPriv(nxagentRootTileWindow) -> window == nxagentWindowPriv(pWin) -> window &&
nxagentSplashCount == 1 && X -> xexpose.count == 0)
{
#ifdef DEBUG
fprintf(stderr, "nxagentHandleExposeEvent: Clearing root tile window id [%u].\n",
nxagentWindowPriv(nxagentRootTileWindow) -> window);
#endif
XClearWindow(nxagentDisplay, nxagentWindowPriv(nxagentRootTileWindow) -> window);
}
}
RegionUninit(&sum); RegionUninit(&sum);
} }
......
...@@ -114,10 +114,6 @@ Equipment Corporation. ...@@ -114,10 +114,6 @@ Equipment Corporation.
#include "Drawable.h" #include "Drawable.h"
#include "Colormap.h" #include "Colormap.h"
/* prototypes (only MakeRootTile() required here) */
static void MakeRootTile(WindowPtr pWin);
#include "../../dix/window.c" #include "../../dix/window.c"
extern Bool nxagentWMIsRunning; extern Bool nxagentWMIsRunning;
...@@ -132,72 +128,8 @@ extern Bool nxagentScreenTrap; ...@@ -132,72 +128,8 @@ extern Bool nxagentScreenTrap;
#undef TEST #undef TEST
#undef DEBUG #undef DEBUG
WindowPtr nxagentRootTileWindow;
extern void nxagentSetVersionProperty(WindowPtr pWin); extern void nxagentSetVersionProperty(WindowPtr pWin);
void nxagentClearSplash(WindowPtr pW)
{
if (!pW)
return;
ScreenPtr pScreen = pW->drawable.pScreen;
if (pW->backgroundState == BackgroundPixmap)
{
(*pScreen->DestroyPixmap)(pW->background.pixmap);
}
pW->backgroundState = BackgroundPixel;
pW->background.pixel = nxagentLogoBlack;
(*pScreen->ChangeWindowAttributes)(pW, CWBackPixmap|CWBackPixel);
}
static void
MakeRootTile(WindowPtr pWin)
{
ScreenPtr pScreen = pWin->drawable.pScreen;
GCPtr pGC;
unsigned char back[128];
int len = BitmapBytePad(sizeof(long));
register unsigned char *from, *to;
register int i, j;
pWin->background.pixmap = (*pScreen->CreatePixmap)(pScreen, 4, 4,
pScreen->rootDepth, 0);
pWin->backgroundState = BackgroundPixmap;
pGC = GetScratchGC(pScreen->rootDepth, pScreen);
if (!pWin->background.pixmap || !pGC)
FatalError("could not create root tile");
{
CARD32 attributes[2];
attributes[0] = pScreen->whitePixel;
attributes[1] = pScreen->blackPixel;
(void)ChangeGC(pGC, GCForeground | GCBackground, attributes);
}
ValidateGC((DrawablePtr)pWin->background.pixmap, pGC);
from = (screenInfo.bitmapBitOrder == LSBFirst) ? _back_lsb : _back_msb;
to = back;
for (i = 4; i > 0; i--, from++)
for (j = len; j > 0; j--)
*to++ = *from;
(*pGC->ops->PutImage)((DrawablePtr)pWin->background.pixmap, pGC, 1,
0, 0, len, 4, 0, XYBitmap, (char *)back);
FreeScratchGC(pGC);
nxagentRootTileWindow = pWin;
}
void void
InitRootWindow(WindowPtr pWin) InitRootWindow(WindowPtr pWin)
{ {
...@@ -252,21 +184,11 @@ InitRootWindow(WindowPtr pWin) ...@@ -252,21 +184,11 @@ InitRootWindow(WindowPtr pWin)
pWin->optional->cursor = rootCursor; pWin->optional->cursor = rootCursor;
rootCursor->refcnt++; rootCursor->refcnt++;
#ifndef NXAGENT_SPLASH if (blackRoot)
if (!blackRoot && !whiteRoot) { pWin->background.pixel = pScreen->blackPixel;
MakeRootTile(pWin);
backFlag |= CWBackPixmap;
}
else else
#else pWin->background.pixel = pScreen->whitePixel;
{ backFlag |= CWBackPixel;
if (blackRoot)
pWin->background.pixel = pScreen->blackPixel;
else
pWin->background.pixel = pScreen->whitePixel;
backFlag |= CWBackPixel;
}
#endif
pWin->backingStore = defaultBackingStore; pWin->backingStore = defaultBackingStore;
pWin->forcedBS = (defaultBackingStore != NotUseful); pWin->forcedBS = (defaultBackingStore != NotUseful);
......
...@@ -118,12 +118,6 @@ extern WindowPtr nxagentRootTileWindow; ...@@ -118,12 +118,6 @@ extern WindowPtr nxagentRootTileWindow;
extern Bool nxagentReportPrivateWindowIds; extern Bool nxagentReportPrivateWindowIds;
/*
* Also referenced in Events.c.
*/
int nxagentSplashCount = 0;
#define RECTLIMIT 25 #define RECTLIMIT 25
#define BSPIXMAPLIMIT 128 #define BSPIXMAPLIMIT 128
...@@ -156,12 +150,6 @@ int GetWindowProperty(WindowPtr, Atom, long, long, Bool, Atom, Atom*, int*, ...@@ -156,12 +150,6 @@ int GetWindowProperty(WindowPtr, Atom, long, long, Bool, Atom, Atom*, int*,
unsigned long*, unsigned long*, unsigned char**); unsigned long*, unsigned long*, unsigned char**);
/* /*
* From NXwindow.c.
*/
void nxagentClearSplash(WindowPtr pWin);
/*
* Other local functions. * Other local functions.
*/ */
...@@ -268,16 +256,6 @@ Bool nxagentCreateWindow(WindowPtr pWin) ...@@ -268,16 +256,6 @@ Bool nxagentCreateWindow(WindowPtr pWin)
return True; return True;
} }
nxagentSplashCount++;
if (nxagentSplashCount == 2)
{
nxagentClearSplash(nxagentRootTileWindow);
}
#ifdef NXAGENT_LOGO_DEBUG
fprintf(stderr, "nxagentCreateWindow: nxagentSplashCount [%d]\n", nxagentSplashCount);
#endif
if (pWin->drawable.class == InputOnly) if (pWin->drawable.class == InputOnly)
{ {
mask = CWEventMask; mask = CWEventMask;
...@@ -487,14 +465,6 @@ Bool nxagentCreateWindow(WindowPtr pWin) ...@@ -487,14 +465,6 @@ Bool nxagentCreateWindow(WindowPtr pWin)
nxagentWindowPriv(pWin)->siblingAbove = None; nxagentWindowPriv(pWin)->siblingAbove = None;
nxagentWindowPriv(pWin)->pPicture = NULL; nxagentWindowPriv(pWin)->pPicture = NULL;
if (nxagentRootTileWindow)
{
if (nxagentWindowPriv(pWin)->window != nxagentWindowPriv(nxagentRootTileWindow)->window)
{
XClearWindow(nxagentDisplay, nxagentWindowPriv(nxagentRootTileWindow)->window);
}
}
if (pWin->nextSib) if (pWin->nextSib)
{ {
nxagentWindowPriv(pWin->nextSib)->siblingAbove = nxagentWindow(pWin); nxagentWindowPriv(pWin->nextSib)->siblingAbove = nxagentWindow(pWin);
...@@ -662,27 +632,6 @@ Bool nxagentDestroyWindow(WindowPtr pWin) ...@@ -662,27 +632,6 @@ Bool nxagentDestroyWindow(WindowPtr pWin)
nxagentRootlessDelTopLevelWindow(pWin); nxagentRootlessDelTopLevelWindow(pWin);
} }
nxagentSplashCount--;
#ifdef DEBUG
fprintf(stderr, "nxagentDestroyWindow: The splash counter is now [%d].\n",
nxagentSplashCount);
#endif
if (nxagentRootTileWindow)
{
if (nxagentSplashCount == 1)
{
XClearWindow(nxagentDisplay, nxagentWindowPriv(nxagentRootTileWindow) -> window);
}
if (pWin == nxagentRootTileWindow)
{
nxagentWindowPriv(nxagentRootTileWindow)->window = None;
nxagentRootTileWindow = None;
}
}
pWindowPriv->window = None; pWindowPriv->window = None;
if (pWin -> optional) if (pWin -> optional)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment