(!1654) Xnest: use xcb_put_image() for creating cursors
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
		
							parent
							
								
									11931842cf
								
							
						
					
					
						commit
						9a9113b61d
					
				|  | @ -40,7 +40,6 @@ xnestCursorFuncRec xnestCursorFuncs = { NULL }; | ||||||
| Bool | Bool | ||||||
| xnestRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) | xnestRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) | ||||||
| { | { | ||||||
|     XImage *ximage; |  | ||||||
|     unsigned long valuemask; |     unsigned long valuemask; | ||||||
|     XGCValues values; |     XGCValues values; | ||||||
| 
 | 
 | ||||||
|  | @ -55,37 +54,41 @@ xnestRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) | ||||||
| 
 | 
 | ||||||
|     XChangeGC(xnestDisplay, xnestBitmapGC, valuemask, &values); |     XChangeGC(xnestDisplay, xnestBitmapGC, valuemask, &values); | ||||||
| 
 | 
 | ||||||
|     uint32_t winId = xnestDefaultWindows[pScreen->myNum]; |     uint32_t const winId = xnestDefaultWindows[pScreen->myNum]; | ||||||
| 
 | 
 | ||||||
|     Pixmap source = xcb_generate_id(xnestUpstreamInfo.conn); |     Pixmap const source = xcb_generate_id(xnestUpstreamInfo.conn); | ||||||
|     xcb_create_pixmap(xnestUpstreamInfo.conn, 1, source, winId, pCursor->bits->width, pCursor->bits->height); |     xcb_create_pixmap(xnestUpstreamInfo.conn, 1, source, winId, pCursor->bits->width, pCursor->bits->height); | ||||||
| 
 | 
 | ||||||
|     Pixmap mask = xcb_generate_id(xnestUpstreamInfo.conn); |     Pixmap const mask = xcb_generate_id(xnestUpstreamInfo.conn); | ||||||
|     xcb_create_pixmap(xnestUpstreamInfo.conn, 1, mask, winId, pCursor->bits->width, pCursor->bits->height); |     xcb_create_pixmap(xnestUpstreamInfo.conn, 1, mask, winId, pCursor->bits->width, pCursor->bits->height); | ||||||
| 
 | 
 | ||||||
|     ximage = XCreateImage(xnestDisplay, |     int const pixmap_len = BitmapBytePad(pCursor->bits->width) * pCursor->bits->height; | ||||||
|                           xnestDefaultVisual(pScreen), | 
 | ||||||
|                           1, XYBitmap, 0, |     xcb_put_image(xnestUpstreamInfo.conn, | ||||||
|                           (char *) pCursor->bits->source, |                   XCB_IMAGE_FORMAT_XY_BITMAP, | ||||||
|  |                   source, | ||||||
|  |                   xnestBitmapGC->gid, | ||||||
|                   pCursor->bits->width, |                   pCursor->bits->width, | ||||||
|                           pCursor->bits->height, BitmapPad(xnestDisplay), 0); |                   pCursor->bits->height, | ||||||
|  |                   0, // x
 | ||||||
|  |                   0, // y
 | ||||||
|  |                   0, // left_pad
 | ||||||
|  |                   1, // depth
 | ||||||
|  |                   pixmap_len, | ||||||
|  |                   (uint8_t*) pCursor->bits->source); | ||||||
| 
 | 
 | ||||||
|     XPutImage(xnestDisplay, source, xnestBitmapGC, ximage, |     xcb_put_image(xnestUpstreamInfo.conn, | ||||||
|               0, 0, 0, 0, pCursor->bits->width, pCursor->bits->height); |                   XCB_IMAGE_FORMAT_XY_BITMAP, | ||||||
| 
 |                   mask, | ||||||
|     XFree(ximage); |                   xnestBitmapGC->gid, | ||||||
| 
 |  | ||||||
|     ximage = XCreateImage(xnestDisplay, |  | ||||||
|                           xnestDefaultVisual(pScreen), |  | ||||||
|                           1, XYBitmap, 0, |  | ||||||
|                           (char *) pCursor->bits->mask, |  | ||||||
|                   pCursor->bits->width, |                   pCursor->bits->width, | ||||||
|                           pCursor->bits->height, BitmapPad(xnestDisplay), 0); |                   pCursor->bits->height, | ||||||
| 
 |                   0, // x
 | ||||||
|     XPutImage(xnestDisplay, mask, xnestBitmapGC, ximage, |                   0, // y
 | ||||||
|               0, 0, 0, 0, pCursor->bits->width, pCursor->bits->height); |                   0, // left_pad
 | ||||||
| 
 |                   1, // depth
 | ||||||
|     XFree(ximage); |                   pixmap_len, | ||||||
|  |                   (uint8_t*) pCursor->bits->mask); | ||||||
| 
 | 
 | ||||||
|     xnestSetCursorPriv(pCursor, pScreen, calloc(1, sizeof(xnestPrivCursor))); |     xnestSetCursorPriv(pCursor, pScreen, calloc(1, sizeof(xnestPrivCursor))); | ||||||
|     uint32_t cursor = xcb_generate_id(xnestUpstreamInfo.conn); |     uint32_t cursor = xcb_generate_id(xnestUpstreamInfo.conn); | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue