From 3ab0bec860d9e567ff628f7ee79cd776d3e7cf9e Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Wed, 31 Jul 2024 10:46:30 +0200 Subject: [PATCH] Xnest: replace XCreatePixmapCursor() by xcb_create_cursor() Signed-off-by: Enrico Weigelt, metux IT consult --- hw/xnest/Cursor.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/hw/xnest/Cursor.c b/hw/xnest/Cursor.c index 8c7d0914d..c38493c39 100644 --- a/hw/xnest/Cursor.c +++ b/hw/xnest/Cursor.c @@ -41,7 +41,6 @@ Bool xnestRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) { XImage *ximage; - XColor fg_color, bg_color; unsigned long valuemask; XGCValues values; @@ -88,18 +87,14 @@ xnestRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) XFree(ximage); - fg_color.red = pCursor->foreRed; - fg_color.green = pCursor->foreGreen; - fg_color.blue = pCursor->foreBlue; - - bg_color.red = pCursor->backRed; - bg_color.green = pCursor->backGreen; - bg_color.blue = pCursor->backBlue; - xnestSetCursorPriv(pCursor, pScreen, calloc(1, sizeof(xnestPrivCursor))); - xnestCursor(pCursor, pScreen) = - XCreatePixmapCursor(xnestDisplay, source, mask, &fg_color, &bg_color, - pCursor->bits->xhot, pCursor->bits->yhot); + uint32_t cursor = xcb_generate_id(xnestUpstreamInfo.conn); + xcb_create_cursor(xnestUpstreamInfo.conn, cursor, source, mask, + pCursor->foreRed, pCursor->foreGreen, pCursor->foreBlue, + pCursor->backRed, pCursor->backGreen, pCursor->backBlue, + pCursor->bits->xhot, pCursor->bits->yhot); + + xnestCursor(pCursor, pScreen) = cursor; xcb_free_pixmap(xnestUpstreamInfo.conn, source); xcb_free_pixmap(xnestUpstreamInfo.conn, mask);