From 8f45001ffca973bf52462f360a2c504478fceac7 Mon Sep 17 00:00:00 2001 From: lkn Date: Sun, 21 Jun 2026 18:15:36 +0200 Subject: [PATCH] wayland: fix MakeGhostIcon by handling raw pixman_image_t* drawables wl_create_rimage_from_drawable only looked up frame_buf IDs, but icon->pixmap on Wayland is a raw pixman_image_t* from RConvertImage, not a frame_buf ID. When frame_buf_find fails, fall back to treating the drawable pointer as a pixman_image_t* directly. This fixes the ghost dock shadow (semi-transparent overlay shown during icon drag) which was silently failing because MakeGhostIcon returned WM_NATIVE_NONE. --- src/backend/wayland/wl_icon.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/backend/wayland/wl_icon.c b/src/backend/wayland/wl_icon.c index 657db24..8b10afb 100644 --- a/src/backend/wayland/wl_icon.c +++ b/src/backend/wayland/wl_icon.c @@ -316,12 +316,17 @@ wl_create_rimage_from_drawable(void *rcontext, WMDrawable drawable) if (!drawable) return NULL; + pixman_image_t *pimg = NULL; struct wl_frame_buf *fb = frame_buf_find((WNativeWindow)drawable); - if (!fb || !fb->image) - return NULL; + if (fb && fb->image) { + pimg = fb->image; + } else { + /* drawable may be a raw pixman_image_t* (e.g. icon->pixmap from RConvertImage) */ + pimg = (pixman_image_t *)(uintptr_t)drawable; + } - int w = pixman_image_get_width(fb->image); - int h = pixman_image_get_height(fb->image); + int w = pixman_image_get_width(pimg); + int h = pixman_image_get_height(pimg); if (w <= 0 || h <= 0) return NULL; @@ -329,8 +334,8 @@ wl_create_rimage_from_drawable(void *rcontext, WMDrawable drawable) if (!img) return NULL; - uint32_t *src = (uint32_t *)pixman_image_get_data(fb->image); - int stride = pixman_image_get_stride(fb->image) / 4; + uint32_t *src = (uint32_t *)pixman_image_get_data(pimg); + int stride = pixman_image_get_stride(pimg) / 4; unsigned char *dst = img->data; for (int row = 0; row < h; row++) {