(!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:
		
							parent
							
								
									f75166bd64
								
							
						
					
					
						commit
						852493ddeb
					
				| 
						 | 
					@ -28,7 +28,6 @@ is" without express or implied warranty.
 | 
				
			||||||
#include "scrnintstr.h"
 | 
					#include "scrnintstr.h"
 | 
				
			||||||
#include "servermd.h"
 | 
					#include "servermd.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "Xnest.h"
 | 
					 | 
				
			||||||
#include "xnest-xcb.h"
 | 
					#include "xnest-xcb.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "Display.h"
 | 
					#include "Display.h"
 | 
				
			||||||
| 
						 | 
					@ -39,10 +38,7 @@ is" without express or implied warranty.
 | 
				
			||||||
#include "screensaver"
 | 
					#include "screensaver"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Display *xnestDisplay = NULL;
 | 
					Display *xnestDisplay = NULL;
 | 
				
			||||||
XVisualInfo *xnestVisuals;
 | 
					 | 
				
			||||||
int xnestNumVisuals;
 | 
					 | 
				
			||||||
Colormap *xnestDefaultColormaps;
 | 
					Colormap *xnestDefaultColormaps;
 | 
				
			||||||
static uint16_t xnestNumDefaultColormaps;
 | 
					 | 
				
			||||||
int xnestNumPixmapFormats;
 | 
					int xnestNumPixmapFormats;
 | 
				
			||||||
Drawable xnestDefaultDrawables[MAXDEPTH + 1];
 | 
					Drawable xnestDefaultDrawables[MAXDEPTH + 1];
 | 
				
			||||||
Pixmap xnestIconBitmap;
 | 
					Pixmap xnestIconBitmap;
 | 
				
			||||||
| 
						 | 
					@ -62,8 +58,6 @@ x_io_error_handler(Display * dpy)
 | 
				
			||||||
void
 | 
					void
 | 
				
			||||||
xnestOpenDisplay(int argc, char *argv[])
 | 
					xnestOpenDisplay(int argc, char *argv[])
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    XVisualInfo vi;
 | 
					 | 
				
			||||||
    long mask;
 | 
					 | 
				
			||||||
    int i;
 | 
					    int i;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (!xnestDoFullGeneration)
 | 
					    if (!xnestDoFullGeneration)
 | 
				
			||||||
| 
						 | 
					@ -83,24 +77,6 @@ xnestOpenDisplay(int argc, char *argv[])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    xnest_upstream_setup();
 | 
					    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)
 | 
					    if (xnestParentWindow != (Window) 0)
 | 
				
			||||||
        xnestEventMask = XCB_EVENT_MASK_STRUCTURE_NOTIFY;
 | 
					        xnestEventMask = XCB_EVENT_MASK_STRUCTURE_NOTIFY;
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
| 
						 | 
					@ -184,7 +160,5 @@ xnestCloseDisplay(void)
 | 
				
			||||||
    xnestVisualMap = NULL;
 | 
					    xnestVisualMap = NULL;
 | 
				
			||||||
    xnestNumVisualMap = 0;
 | 
					    xnestNumVisualMap = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    free(xnestDefaultColormaps);
 | 
					 | 
				
			||||||
    XFree(xnestVisuals);
 | 
					 | 
				
			||||||
    XCloseDisplay(xnestDisplay);
 | 
					    XCloseDisplay(xnestDisplay);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -25,10 +25,6 @@ is" without express or implied warranty.
 | 
				
			||||||
#define MAXVISUALSPERDEPTH 256
 | 
					#define MAXVISUALSPERDEPTH 256
 | 
				
			||||||
 | 
					
 | 
				
			||||||
extern Display *xnestDisplay;
 | 
					extern Display *xnestDisplay;
 | 
				
			||||||
extern XVisualInfo *xnestVisuals;
 | 
					 | 
				
			||||||
extern int xnestNumVisuals;
 | 
					 | 
				
			||||||
extern Colormap *xnestDefaultColormaps;
 | 
					 | 
				
			||||||
extern int xnestNumDefaultClormaps;
 | 
					 | 
				
			||||||
extern int xnestNumPixmapFormats;
 | 
					extern int xnestNumPixmapFormats;
 | 
				
			||||||
extern Drawable xnestDefaultDrawables[MAXDEPTH + 1];
 | 
					extern Drawable xnestDefaultDrawables[MAXDEPTH + 1];
 | 
				
			||||||
extern Pixmap xnestIconBitmap;
 | 
					extern Pixmap xnestIconBitmap;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue