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:
parent
3ccf87ff4f
commit
7285ca6286
|
|
@ -344,6 +344,28 @@ static void paintMenuEntry(PopUpButton * bPtr, int index, int highlight)
|
||||||
if (!highlight) {
|
if (!highlight) {
|
||||||
R->fill_rect(rctx, (WMDrawable)bPtr->menuView->window, scr->gray,
|
R->fill_rect(rctx, (WMDrawable)bPtr->menuView->window, scr->gray,
|
||||||
0, index * itemHeight, width, itemHeight);
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue