Skip to content
Myr

wayland: reset hovered_row_idx to -1 in pointer entry

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

This ensures the first entry can be hovered without first hovering other entries. Before this patch, select_hovered_match() would exit without doing anything since it didn't think the hovered row had changed. Closes #765

authored by Daniel Eklöf · committed by Daniel Eklöf · parent 30e7998 · Browse files · 2 files+13 added−4 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+13 added−4 removed

  • other:+13 added−4 removed

2 files+13 added−4 removed

modified:CHANGELOG.md+4 added
55 unmodified lines
56### Fixed5758* `image-size-ratio=0` causing a crash due to a zero-size allocation59 ([#739][739]).60* First entry not being hover-able until other entries have been61 hovered ([#765][765]).626364[739]: https://codeberg.org/dnkl/fuzzel/issues/73965[765]: https://codeberg.org/dnkl/fuzzel/issues/7656667### Security68### Contributors69
1149 unmodified lines
modified:wayland.c+9 added-4 removed
1150 unmodified lines
1151 uint32_t serial, struct wl_surface *surface,1152 wl_fixed_t surface_x, wl_fixed_t surface_y)1153{1154 struct seat *seat = data;1155 if (!seat->wayl->enable_mouse) return;1155 if (!seat->wayl->enable_mouse)1156 return;1157 seat->pointer.serial = serial;1158 seat->pointer.hovered_row_idx = -1;11591160 /*1161 * Note: do *not* set seat->pointer.{x,y} here!1162 *
20 unmodified lines
1183wl_pointer_leave(void *data, struct wl_pointer *wl_pointer,1184 uint32_t serial, struct wl_surface *surface)1185{1186 struct seat *seat = data;1185 if (!seat->wayl->enable_mouse) return;1187 if (!seat->wayl->enable_mouse)1188 return;1189 seat->pointer.serial = serial;1190}11911192static void1193wl_pointer_motion(void *data, struct wl_pointer *wl_pointer,1194 uint32_t time, wl_fixed_t surface_x, wl_fixed_t surface_y)1195{1196 struct seat *seat = data;1194 if (!seat->wayl->enable_mouse) return;1197 if (!seat->wayl->enable_mouse)1198 return;11991200 const int x = wl_fixed_to_int(surface_x);1201 const int y = wl_fixed_to_int(surface_y);1202
12 unmodified lines
1215 uint32_t serial, uint32_t time, uint32_t button, uint32_t state)1216{1217 struct seat *seat = data;1218 struct wayland *wayl = seat->wayl;1215 if (!wayl->enable_mouse) return;1219 if (!wayl->enable_mouse)1220 return;12211222 if (state == WL_POINTER_BUTTON_STATE_RELEASED) {1223 if (button == BTN_LEFT && seat->pointer.hovered_row_idx != -1) {1224 ssize_t clicked_row = render_get_row_num(
1980 unmodified lines