Skip to content
Myr

render: regression: selected entry's background not rendered on top of regular background

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Closes #405

authored by Daniel Eklöf · committed by Mark Stosberg · parent 20660ef · Browse files · 2 files+26 added−7 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+26 added−7 removed

  • other:+26 added−7 removed

2 files+26 added−7 removed

modified:CHANGELOG.md+3 added-2 removed
36 unmodified lines
37* Crash when the border size is larger than the border radius38 ([#401][401]).39* Regression: cursor not centered when using a custom line height40 ([#403][403]).41* Regression: selected background not rendered on top of the regular42 background ([#405][405]).4344[401]: https://codeberg.org/dnkl/fuzzel/issues/40145[403]: https://codeberg.org/dnkl/fuzzel/issues/40346[405]: https://codeberg.org/dnkl/fuzzel/issues/405474548### Security49### Contributors504951## 1.11.05253### Added54
779 unmodified lines
modified:render.c+23 added-5 removed
924 unmodified lines
925}926927static void928render_match_entry_background(const struct render *render,929 int idx, int row_count, bool is_selected,929 int idx, int row_count,930 pixman_image_t *pix, int width)931{932 pixman_color_t bg = is_selected933 ? render->pix_selection_color : render->pix_background_color;932 pixman_color_t bg = render->pix_background_color;933934 const int sel_margin = render->x_margin / 3;935936 const int x = render->border_size + render->x_margin - sel_margin;
5 unmodified lines
942 PIXMAN_OP_SRC, pix, &bg, 1, &(pixman_rectangle16_t){x, y, w, h});943}944945static void946render_selected_match_entry_background(const struct render *render,947 int idx, pixman_image_t *pix, int width)948{949 pixman_color_t bg = render->pix_selection_color;950951 const int sel_margin = render->x_margin / 3;952953 const int x = render->border_size + render->x_margin - sel_margin;954 const int y = first_row_y(render) + idx * render->row_height;955 const int w = width - 2 * (render->border_size + render->x_margin - sel_margin);956 const int h = 1 * render->row_height;957958 pixman_image_fill_rectangles(959 PIXMAN_OP_OVER, pix, &bg, 1, &(pixman_rectangle16_t){x, y, w, h});960}961962static void963render_one_match_entry(const struct render *render, const struct matches *matches,964 const struct match *match, bool render_icons,965 int idx, bool is_selected, int width, int height,966 pixman_image_t *pix, cairo_t *cairo)
11 unmodified lines
978 const int first_row = first_row_y(render);979 double cur_x = render->border_size + render->x_margin;980 double max_x = width - render->border_size - render->x_margin;981966 render_match_entry_background(render, idx, 1, is_selected, pix, width);982 render_match_entry_background(render, idx, 1, pix, width);983984 if (is_selected) {985 render_selected_match_entry_background(render, idx, pix, width);986987 /* If currently selected item has a scalable icon, and if988 * there's "enough" free space, render a large representation989 * of the icon */990
110 unmodified lines
1101 }11021103 /* Erase background of the "empty" area, after the last match */1104 render_match_entry_background(1087 render, match_count, render->conf->lines - match_count, false,1105 render, match_count, render->conf->lines - match_count,1106 buf->pix[0], buf->width);11071108 for (size_t i = 0; i < match_count; i++) {1109 if (render->workers.count == 0) {
347 unmodified lines