paintMenuEntry: redraw full row on non-highlight instead of just gray fill

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.
This commit is contained in:
lkn 2026-06-07 12:53:46 +02:00
parent 3ccf87ff4f
commit 7285ca6286
1 changed files with 22 additions and 0 deletions

View File

@ -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;
}