fix(lunarbar): agent-review findings — keycodes, popup zone, stale-in… - #744
Merged
Conversation
…dex races Three defects found by the review pass, all reproducible on a real compositor but invisible to the offline dumps: - Keycodes: wl_keyboard.key delivers BARE Linux evdev scancodes; the +8 offset is xkb's client-side keymap convention and never appears on the wire. Every keyboard constant and the key_char() table were shifted by 8 (a pre-existing bug for Esc, extended to the whole menu keyboard by the rewrite): Esc arrived as code 1 but was matched against 9, Enter (28) would have typed 't' into the search filter, arrows did nothing. All constants and ranges now use bare evdev values. - Popup geometry: the menu/calendar overlay left exclusive_zone at its default 0, so wlroots compositors size it to the usable area (already excluding both bars) and every bar_h offset in the panel math double-subtracted — panels floated 40px from their bar, the scrim never covered the bars, and taskbar clicks could activate windows while the popup held the exclusive keyboard. set_exclusive_zone(-1) makes the overlay span the full output as the drawing math assumes. - Stale-index races: taskbar hitboxes, hover state and the tooltip tracked windows by list index, and menu rows tracked the filtered-row index; a toplevel closing (or a refilter) racing a dirty-skipped repaint could aim a click, hover highlight or tooltip one slot off. Hits/hover/tooltips now carry the foreign-toplevel protocol id and menu hits the stable entry index, so a stale hit still resolves to exactly the item that was drawn under the cursor. Also cap the tooltip text to the output width so long titles cannot map a surface wider than the screen. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014YbamoBW4CkPxj5Jou3QmC
There was a problem hiding this comment.
Pull request overview
This PR fixes several real-world interaction bugs in lunarbar by aligning keyboard handling with Wayland’s delivered evdev keycodes, correcting popup overlay sizing to cover the full output (including bars), and removing index-based UI identity to prevent stale-hit races.
Changes:
- Switch wl_keyboard key handling and the
key_char()mapping to bare evdev keycodes (no +8 offset). - Make the popup overlay span the full output by setting
exclusive_zone = -1, preventing incorrect geometry and input pass-through. - Replace index-based taskbar/menu hit identification with stable IDs (foreign-toplevel protocol id for tasks; stable entry index for app rows), and cap tooltip text to output width.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…dex races
Three defects found by the review pass, all reproducible on a real compositor but invisible to the offline dumps:
Keycodes: wl_keyboard.key delivers BARE Linux evdev scancodes; the +8 offset is xkb's client-side keymap convention and never appears on the wire. Every keyboard constant and the key_char() table were shifted by 8 (a pre-existing bug for Esc, extended to the whole menu keyboard by the rewrite): Esc arrived as code 1 but was matched against 9, Enter (28) would have typed 't' into the search filter, arrows did nothing. All constants and ranges now use bare evdev values.
Popup geometry: the menu/calendar overlay left exclusive_zone at its default 0, so wlroots compositors size it to the usable area (already excluding both bars) and every bar_h offset in the panel math double-subtracted — panels floated 40px from their bar, the scrim never covered the bars, and taskbar clicks could activate windows while the popup held the exclusive keyboard. set_exclusive_zone(-1) makes the overlay span the full output as the drawing math assumes.
Stale-index races: taskbar hitboxes, hover state and the tooltip tracked windows by list index, and menu rows tracked the filtered-row index; a toplevel closing (or a refilter) racing a dirty-skipped repaint could aim a click, hover highlight or tooltip one slot off. Hits/hover/tooltips now carry the foreign-toplevel protocol id and menu hits the stable entry index, so a stale hit still resolves to exactly the item that was drawn under the cursor.
Also cap the tooltip text to the output width so long titles cannot map a surface wider than the screen.
Claude-Session: https://claude.ai/code/session_014YbamoBW4CkPxj5Jou3QmC