diff --git a/src/backend/wayland/wl_backend.c b/src/backend/wayland/wl_backend.c index 74b7563..2cdfb25 100644 --- a/src/backend/wayland/wl_backend.c +++ b/src/backend/wayland/wl_backend.c @@ -8096,7 +8096,64 @@ static void wl_clip_icon_paint(WAppIcon *aicon) /* Commit updated buffer */ wlr_scene_buffer_set_buffer(fb->scene_buf, &fb->base); } -static void wl_drawer_icon_paint(WAppIcon *aicon) { wl_appicon_paint(aicon); } +static void wl_drawer_icon_paint(WAppIcon *aicon) +{ + if (!aicon || !aicon->icon || !aicon->icon->core) + return; + + wl_appicon_paint(aicon); + + struct wl_frame_buf *fb = frame_buf_find((WNativeWindow)aicon->icon->core->window); + if (!fb || !fb->image) + return; + + WScreen *scr = aicon->icon->core->screen_ptr; + WMColor *color; + if (!aicon->dock->collapsed) + color = scr->clip_title_color[CLIP_NORMAL]; + else + color = scr->clip_title_color[CLIP_COLLAPSED]; + if (!color) + return; + + int size = wPreferences.icon_size; + uint32_t pixel = ((uint32_t)0xFF << 24) | + ((uint32_t)WMRedComponentOfColor(color) >> 8 << 16) | + ((uint32_t)WMGreenComponentOfColor(color) >> 8 << 8) | + ((uint32_t)WMBlueComponentOfColor(color) >> 8); + uint32_t *data = (uint32_t *)pixman_image_get_data(fb->image); + int stride = pixman_image_get_stride(fb->image) / 4; + + /* Draw directional arrow (triangle) */ + int cx, cy = size / 2; + if (aicon->dock->on_right_side) { + /* Arrow pointing left: tip at x=5, base at x=10 */ + for (int dy = -5; dy <= 5; dy++) { + int row = cy + dy; + if (row < 0 || row >= size) continue; + int width = 5 - abs(dy); + for (int dx = 0; dx <= width; dx++) { + cx = 10 - dx; + if (cx >= 0 && cx < size) + data[row * stride + cx] = pixel; + } + } + } else { + /* Arrow pointing right: tip at x=size-6, base at x=size-11 */ + for (int dy = -5; dy <= 5; dy++) { + int row = cy + dy; + if (row < 0 || row >= size) continue; + int width = 5 - abs(dy); + for (int dx = 0; dx <= width; dx++) { + cx = size - 11 + dx; + if (cx >= 0 && cx < size) + data[row * stride + cx] = pixel; + } + } + } + + wlr_scene_buffer_set_buffer(fb->scene_buf, &fb->base); +} static void wl_balloon_init(WScreen *scr) { scr->balloon = wmalloc(sizeof(WBalloon));