From 7285ca628674f7b054b7ddaaad67d1f540881b8f Mon Sep 17 00:00:00 2001 From: lkn Date: Sun, 7 Jun 2026 12:53:46 +0200 Subject: [PATCH] paintMenuEntry: redraw full row on non-highlight instead of just gray fill MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The non-highlight path in paintMenuEntry only filled the row with gray and returned early, erasing the item text, relief border, and indicator pixmap. On Wayland this was immediately visible because the cascade+commit on fill_rect commits every draw operation to the wl_surface. Fix: after filling the gray background, redraw the relief border, the item text (in black or darkGray depending on enabled state), and the indicator pixmap for the selected item — matching what the highlight path and makeMenuPixmap do. --- WINGs/wpopupbutton.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/WINGs/wpopupbutton.c b/WINGs/wpopupbutton.c index 06f0841..8140131 100644 --- a/WINGs/wpopupbutton.c +++ b/WINGs/wpopupbutton.c @@ -344,6 +344,28 @@ static void paintMenuEntry(PopUpButton * bPtr, int index, int highlight) if (!highlight) { R->fill_rect(rctx, (WMDrawable)bPtr->menuView->window, scr->gray, 0, index * itemHeight, width, itemHeight); + title = WMGetPopUpButtonItem(bPtr, index); + W_DrawRelief(scr, (WMDrawable)bPtr->menuView->window, + 0, index * itemHeight, width, itemHeight, WRRaised); + { + WMMenuItem *item = WMGetPopUpButtonMenuItem(bPtr, index); + WMColor *color = (item && WMGetMenuItemEnabled(item)) + ? scr->black : scr->darkGray; + W_PaintText(bPtr->menuView, bPtr->menuView->window, + scr->normalFont, 6, + index * itemHeight + yo, width, WALeft, + color, False, title, strlen(title)); + } + if (!bPtr->flags.pullsDown && index == bPtr->selectedItemIndex) { + R->composite_pixmap(rctx, + (WMDrawable)bPtr->menuView->window, + scr->popUpIndicator, 0, 0, + scr->popUpIndicator->width, + scr->popUpIndicator->height, + width - scr->popUpIndicator->width - 4, + index * itemHeight + + (itemHeight - scr->popUpIndicator->height) / 2); + } return; }