(!1654) Xnest: replace XCreateColormap() / XFreeColormap() by xcb
Use xcb_create_colormap() and XFreeColormap() instead of XCreateColormap() and XFreeColormap(). Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
		
							parent
							
								
									947f258415
								
							
						
					
					
						commit
						dd703f91cb
					
				|  | @ -26,6 +26,7 @@ is" without express or implied warranty. | |||
| #include "resource.h" | ||||
| 
 | ||||
| #include "Xnest.h" | ||||
| #include "xnest-xcb.h" | ||||
| 
 | ||||
| #include "Display.h" | ||||
| #include "Screen.h" | ||||
|  | @ -55,11 +56,14 @@ xnestCreateColormap(ColormapPtr pCmap) | |||
|     pVisual = pCmap->pVisual; | ||||
|     ncolors = pVisual->ColormapEntries; | ||||
| 
 | ||||
|     xnestColormapPriv(pCmap)->colormap = | ||||
|         XCreateColormap(xnestDisplay, | ||||
|     uint32_t const cmap = xcb_generate_id(xnestUpstreamInfo.conn); | ||||
|     xnestColormapPriv(pCmap)->colormap = cmap; | ||||
| 
 | ||||
|     xcb_create_colormap(xnestUpstreamInfo.conn, | ||||
|                         (pVisual->class & DynamicClass) ? XCB_COLORMAP_ALLOC_ALL : XCB_COLORMAP_ALLOC_NONE, | ||||
|                         cmap, | ||||
|                         xnestDefaultWindows[pCmap->pScreen->myNum], | ||||
|                         xnestVisual(pVisual), | ||||
|                         (pVisual->class & DynamicClass) ? AllocAll : AllocNone); | ||||
|                         xnestVisual(pVisual)->visualid); | ||||
| 
 | ||||
|     switch (pVisual->class) { | ||||
|     case StaticGray:           /* read only */ | ||||
|  | @ -131,7 +135,7 @@ xnestCreateColormap(ColormapPtr pCmap) | |||
| void | ||||
| xnestDestroyColormap(ColormapPtr pCmap) | ||||
| { | ||||
|     XFreeColormap(xnestDisplay, xnestColormap(pCmap)); | ||||
|     xcb_free_colormap(xnestUpstreamInfo.conn, xnestColormap(pCmap)); | ||||
| } | ||||
| 
 | ||||
| #define SEARCH_PREDICATE \ | ||||
|  |  | |||
|  | @ -118,11 +118,14 @@ xnestOpenDisplay(int argc, char *argv[]) | |||
|     xnestNumDefaultColormaps = xnestNumVisuals; | ||||
|     xnestDefaultColormaps = xallocarray(xnestNumDefaultColormaps, | ||||
|                                         sizeof(Colormap)); | ||||
|     for (i = 0; i < xnestNumDefaultColormaps; i++) | ||||
|         xnestDefaultColormaps[i] = XCreateColormap(xnestDisplay, | ||||
|     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, | ||||
|                                                    AllocNone); | ||||
|                             xnestVisuals[i].visual->visualid); | ||||
|     } | ||||
| 
 | ||||
|     xnestDepths = XListDepths(xnestDisplay, xnestUpstreamInfo.screenId, | ||||
|                               &xnestNumDepths); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue