(!1654) Xnest: drop obsolete XGetVisualInfo() call and reundant colormaps

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult 2024-08-19 17:08:33 +02:00
parent db48b04c90
commit 1dc7ced6a4
2 changed files with 0 additions and 30 deletions

View File

@ -30,7 +30,6 @@ is" without express or implied warranty.
#include "scrnintstr.h"
#include "servermd.h"
#include "Xnest.h"
#include "xnest-xcb.h"
#include "Display.h"
@ -41,10 +40,7 @@ is" without express or implied warranty.
#include "screensaver"
Display *xnestDisplay = NULL;
XVisualInfo *xnestVisuals;
int xnestNumVisuals;
Colormap *xnestDefaultColormaps;
static uint16_t xnestNumDefaultColormaps;
int xnestNumPixmapFormats;
Drawable xnestDefaultDrawables[MAXDEPTH + 1];
Pixmap xnestIconBitmap;
@ -64,8 +60,6 @@ x_io_error_handler(Display * dpy)
void
xnestOpenDisplay(int argc, char *argv[])
{
XVisualInfo vi;
long mask;
int i;
if (!xnestDoFullGeneration)
@ -85,24 +79,6 @@ xnestOpenDisplay(int argc, char *argv[])
xnest_upstream_setup();
mask = VisualScreenMask;
vi.screen = xnestUpstreamInfo.screenId;
xnestVisuals = XGetVisualInfo(xnestDisplay, mask, &vi, &xnestNumVisuals);
if (xnestNumVisuals == 0 || xnestVisuals == NULL)
FatalError("Unable to find any visuals.\n");
xnestNumDefaultColormaps = xnestNumVisuals;
xnestDefaultColormaps = xallocarray(xnestNumDefaultColormaps,
sizeof(Colormap));
for (i = 0; i < xnestNumDefaultColormaps; i++) {
xnestDefaultColormaps[i] = xcb_generate_id(xnestUpstreamInfo.conn);
xcb_create_colormap(xnestUpstreamInfo.conn,
XCB_COLORMAP_ALLOC_NONE,
xnestDefaultColormaps[i],
xnestUpstreamInfo.screenInfo->root,
xnestVisuals[i].visual->visualid);
}
if (xnestParentWindow != (Window) 0)
xnestEventMask = XCB_EVENT_MASK_STRUCTURE_NOTIFY;
else
@ -186,7 +162,5 @@ xnestCloseDisplay(void)
xnestVisualMap = NULL;
xnestNumVisualMap = 0;
free(xnestDefaultColormaps);
XFree(xnestVisuals);
XCloseDisplay(xnestDisplay);
}

View File

@ -25,10 +25,6 @@ is" without express or implied warranty.
#define MAXVISUALSPERDEPTH 256
extern Display *xnestDisplay;
extern XVisualInfo *xnestVisuals;
extern int xnestNumVisuals;
extern Colormap *xnestDefaultColormaps;
extern int xnestNumDefaultClormaps;
extern int xnestNumPixmapFormats;
extern Drawable xnestDefaultDrawables[MAXDEPTH + 1];
extern Pixmap xnestIconBitmap;