From 54c8d585c39bb555c5f58387b82e154104ee8d31 Mon Sep 17 00:00:00 2001 From: Window Maker Date: Sun, 24 May 2026 19:08:52 +0200 Subject: [PATCH] WINGs/wpopupbutton: paint all items in expose, not just highlighted MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit paintMenuEntry was only called for the highlighted item on expose. On X11 the X server auto-filled the rest of the window with the background pixel, so unpainted items looked grey-but-empty. On Wayland the buffer starts transparent — unpainted items showed through to whatever was behind, making the popup invisible. Iterate all items in the expose handler so the menu's full content is visible when it first appears. --- WINGs/wpopupbutton.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/WINGs/wpopupbutton.c b/WINGs/wpopupbutton.c index 155c649..4899230 100644 --- a/WINGs/wpopupbutton.c +++ b/WINGs/wpopupbutton.c @@ -566,7 +566,17 @@ static void handleActionEvents(WMEvent * event, void *data) switch (event->type) { /* called for menuView */ case WME_EXPOSE: - paintMenuEntry(bPtr, bPtr->highlightedItem, True); + { + /* Paint all items: highlighted one with white bg + text, + * the rest with grey bg. X11 used to rely on the X server + * auto-filling the window background; on Wayland we paint + * everything ourselves. */ + int n = WMGetArrayItemCount(bPtr->items); + int i; + for (i = 0; i < n; i++) { + paintMenuEntry(bPtr, i, i == bPtr->highlightedItem); + } + } break; case WME_LEAVE: