Commit de46c64e authored by Ulrich Sibiller's avatar Ulrich Sibiller Committed by Mike Gabriel

Splash.c: move the GC to nxagentPaintLogo

It is not needed elsewhere.
parent 26ea6d33
...@@ -61,7 +61,7 @@ static XlibPixmap nxagentPixmapLogo; ...@@ -61,7 +61,7 @@ static XlibPixmap nxagentPixmapLogo;
static XlibWindow nxagentSplashWindow = None; static XlibWindow nxagentSplashWindow = None;
static Bool nxagentWMPassed = False; static Bool nxagentWMPassed = False;
static void nxagentPaintLogo(XlibWindow win, XlibGC gc, int scale, int width, int height); static void nxagentPaintLogo(XlibWindow win, int scale, int width, int height);
void nxagentShowSplashWindow(XlibWindow parentWindow) void nxagentShowSplashWindow(XlibWindow parentWindow)
{ {
...@@ -138,14 +138,12 @@ void nxagentShowSplashWindow(XlibWindow parentWindow) ...@@ -138,14 +138,12 @@ void nxagentShowSplashWindow(XlibWindow parentWindow)
nxagentSplashWindow); nxagentSplashWindow);
#endif #endif
XlibGC gc = XCreateGC(nxagentDisplay, nxagentSplashWindow, 0, NULL); nxagentPaintLogo(nxagentSplashWindow, 1, getAttributes.width, getAttributes.height);
nxagentPaintLogo(nxagentSplashWindow, gc, 1, getAttributes.width, getAttributes.height);
XMapRaised (nxagentDisplay, nxagentSplashWindow); XMapRaised (nxagentDisplay, nxagentSplashWindow);
XWindowChanges values = {.stack_mode = Above}; XWindowChanges values = {.stack_mode = Above};
XConfigureWindow(nxagentDisplay, nxagentSplashWindow, CWStackMode, &values); XConfigureWindow(nxagentDisplay, nxagentSplashWindow, CWStackMode, &values);
XSetWindowAttributes attributes = {.override_redirect = True}; XSetWindowAttributes attributes = {.override_redirect = True};
XChangeWindowAttributes(nxagentDisplay, nxagentSplashWindow, CWOverrideRedirect, &attributes); XChangeWindowAttributes(nxagentDisplay, nxagentSplashWindow, CWOverrideRedirect, &attributes);
XFreeGC(nxagentDisplay, gc);
#ifdef NXAGENT_TIMESTAMP #ifdef NXAGENT_TIMESTAMP
{ {
...@@ -161,8 +159,10 @@ Bool nxagentHaveSplashWindow(void) ...@@ -161,8 +159,10 @@ Bool nxagentHaveSplashWindow(void)
return (nxagentSplashWindow != None); return (nxagentSplashWindow != None);
} }
void nxagentPaintLogo(XlibWindow win, XlibGC gc, int scale, int width, int height) void nxagentPaintLogo(XlibWindow win, int scale, int width, int height)
{ {
XlibGC gc = XCreateGC(nxagentDisplay, nxagentSplashWindow, 0, NULL);
int depth = DefaultDepth(nxagentDisplay, DefaultScreen(nxagentDisplay)); int depth = DefaultDepth(nxagentDisplay, DefaultScreen(nxagentDisplay));
#ifdef DEBUG #ifdef DEBUG
...@@ -396,6 +396,8 @@ void nxagentPaintLogo(XlibWindow win, XlibGC gc, int scale, int width, int heigh ...@@ -396,6 +396,8 @@ void nxagentPaintLogo(XlibWindow win, XlibGC gc, int scale, int width, int heigh
XSetWindowBackgroundPixmap(nxagentDisplay, win, nxagentPixmapLogo); XSetWindowBackgroundPixmap(nxagentDisplay, win, nxagentPixmapLogo);
XFreeGC(nxagentDisplay, gc);
#ifdef NXAGENT_LOGO_DEBUG #ifdef NXAGENT_LOGO_DEBUG
fprintf(stderr, "%s: end\n", __func__); fprintf(stderr, "%s: end\n", __func__);
#endif #endif
......
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