From 1dbffd93681f036c7512654ad3cbcf00c3ae5252 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Thu, 5 Sep 2024 10:16:48 +0200 Subject: [PATCH] Xnest: move xnestBitmapGC into struct xnest_upstream_info This is per upstream connection state, so it's better of in the upstream information struct. Signed-off-by: Enrico Weigelt, metux IT consult --- hw/xnest/Cursor.c | 6 +++--- hw/xnest/Display.c | 5 ++--- hw/xnest/Display.h | 1 - hw/xnest/xnest-xcb.h | 1 + 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/hw/xnest/Cursor.c b/hw/xnest/Cursor.c index 1398b034d..3a0800ce7 100644 --- a/hw/xnest/Cursor.c +++ b/hw/xnest/Cursor.c @@ -52,7 +52,7 @@ xnestRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) .foreground = 1L, }; - xcb_aux_change_gc(xnestUpstreamInfo.conn, xnestBitmapGC, valuemask, &values); + xcb_aux_change_gc(xnestUpstreamInfo.conn, xnestUpstreamInfo.bitmapGC, valuemask, &values); uint32_t const winId = xnest_screen_priv(pScreen)->upstream_frame_window; @@ -67,7 +67,7 @@ xnestRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) xcb_put_image(xnestUpstreamInfo.conn, XCB_IMAGE_FORMAT_XY_BITMAP, source, - xnestBitmapGC, + xnestUpstreamInfo.bitmapGC, pCursor->bits->width, pCursor->bits->height, 0, // x @@ -80,7 +80,7 @@ xnestRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) xcb_put_image(xnestUpstreamInfo.conn, XCB_IMAGE_FORMAT_XY_BITMAP, mask, - xnestBitmapGC, + xnestUpstreamInfo.bitmapGC, pCursor->bits->width, pCursor->bits->height, 0, // x diff --git a/hw/xnest/Display.c b/hw/xnest/Display.c index 59c786c8a..2b1f141f2 100644 --- a/hw/xnest/Display.c +++ b/hw/xnest/Display.c @@ -41,7 +41,6 @@ int xnestNumPixmapFormats; Drawable xnestDefaultDrawables[MAXDEPTH + 1]; Pixmap xnestIconBitmap; Pixmap xnestScreenSaverPixmap; -uint32_t xnestBitmapGC; uint32_t xnestEventMask; void @@ -85,9 +84,9 @@ xnestOpenDisplay(int argc, char *argv[]) } } - xnestBitmapGC = xcb_generate_id(xnestUpstreamInfo.conn); + xnestUpstreamInfo.bitmapGC = xcb_generate_id(xnestUpstreamInfo.conn); xcb_create_gc(xnestUpstreamInfo.conn, - xnestBitmapGC, + xnestUpstreamInfo.bitmapGC, xnestDefaultDrawables[1], 0, NULL); diff --git a/hw/xnest/Display.h b/hw/xnest/Display.h index 51832a2e3..00f88ccdf 100644 --- a/hw/xnest/Display.h +++ b/hw/xnest/Display.h @@ -26,7 +26,6 @@ extern int xnestNumPixmapFormats; extern Drawable xnestDefaultDrawables[MAXDEPTH + 1]; extern Pixmap xnestIconBitmap; extern Pixmap xnestScreenSaverPixmap; -extern uint32_t xnestBitmapGC; extern uint32_t xnestEventMask; void xnestOpenDisplay(int argc, char *argv[]); diff --git a/hw/xnest/xnest-xcb.h b/hw/xnest/xnest-xcb.h index 3b8c4cba7..4d8f2e635 100644 --- a/hw/xnest/xnest-xcb.h +++ b/hw/xnest/xnest-xcb.h @@ -36,6 +36,7 @@ struct xnest_upstream_info { const xcb_screen_t *screenInfo; const xcb_setup_t *setup; struct xnest_event_queue eventQueue; + xcb_gc_t bitmapGC; }; extern struct xnest_screen_info xnestScreens[MAXSCREENS];