(!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 "resource.h" | ||||||
| 
 | 
 | ||||||
| #include "Xnest.h" | #include "Xnest.h" | ||||||
|  | #include "xnest-xcb.h" | ||||||
| 
 | 
 | ||||||
| #include "Display.h" | #include "Display.h" | ||||||
| #include "Screen.h" | #include "Screen.h" | ||||||
|  | @ -55,11 +56,14 @@ xnestCreateColormap(ColormapPtr pCmap) | ||||||
|     pVisual = pCmap->pVisual; |     pVisual = pCmap->pVisual; | ||||||
|     ncolors = pVisual->ColormapEntries; |     ncolors = pVisual->ColormapEntries; | ||||||
| 
 | 
 | ||||||
|     xnestColormapPriv(pCmap)->colormap = |     uint32_t const cmap = xcb_generate_id(xnestUpstreamInfo.conn); | ||||||
|         XCreateColormap(xnestDisplay, |     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], |                         xnestDefaultWindows[pCmap->pScreen->myNum], | ||||||
|                         xnestVisual(pVisual), |                         xnestVisual(pVisual)->visualid); | ||||||
|                         (pVisual->class & DynamicClass) ? AllocAll : AllocNone); |  | ||||||
| 
 | 
 | ||||||
|     switch (pVisual->class) { |     switch (pVisual->class) { | ||||||
|     case StaticGray:           /* read only */ |     case StaticGray:           /* read only */ | ||||||
|  | @ -131,7 +135,7 @@ xnestCreateColormap(ColormapPtr pCmap) | ||||||
| void | void | ||||||
| xnestDestroyColormap(ColormapPtr pCmap) | xnestDestroyColormap(ColormapPtr pCmap) | ||||||
| { | { | ||||||
|     XFreeColormap(xnestDisplay, xnestColormap(pCmap)); |     xcb_free_colormap(xnestUpstreamInfo.conn, xnestColormap(pCmap)); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| #define SEARCH_PREDICATE \ | #define SEARCH_PREDICATE \ | ||||||
|  |  | ||||||
|  | @ -118,11 +118,14 @@ xnestOpenDisplay(int argc, char *argv[]) | ||||||
|     xnestNumDefaultColormaps = xnestNumVisuals; |     xnestNumDefaultColormaps = xnestNumVisuals; | ||||||
|     xnestDefaultColormaps = xallocarray(xnestNumDefaultColormaps, |     xnestDefaultColormaps = xallocarray(xnestNumDefaultColormaps, | ||||||
|                                         sizeof(Colormap)); |                                         sizeof(Colormap)); | ||||||
|     for (i = 0; i < xnestNumDefaultColormaps; i++) |     for (i = 0; i < xnestNumDefaultColormaps; i++) { | ||||||
|         xnestDefaultColormaps[i] = XCreateColormap(xnestDisplay, |         xnestDefaultColormaps[i] = xcb_generate_id(xnestUpstreamInfo.conn); | ||||||
|                                                    xnestUpstreamInfo.screenInfo->root, |         xcb_create_colormap(xnestUpstreamInfo.conn, | ||||||
|                                                    xnestVisuals[i].visual, |                             XCB_COLORMAP_ALLOC_NONE, | ||||||
|                                                    AllocNone); |                             xnestDefaultColormaps[i], | ||||||
|  |                             xnestUpstreamInfo.screenInfo->root, | ||||||
|  |                             xnestVisuals[i].visual->visualid); | ||||||
|  |     } | ||||||
| 
 | 
 | ||||||
|     xnestDepths = XListDepths(xnestDisplay, xnestUpstreamInfo.screenId, |     xnestDepths = XListDepths(xnestDisplay, xnestUpstreamInfo.screenId, | ||||||
|                               &xnestNumDepths); |                               &xnestNumDepths); | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue