Skip to content

info-window: build the context menu - #198

Merged
kou merged 1 commit into
rabbit-shocker:mainfrom
matz:fix-info-window-menu
Oct 17, 2026
Merged

kou merged 1 commit into
rabbit-shocker:mainfrom
matz:fix-info-window-menu

Conversation

@matz

@matz matz commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

Right-clicking the information window crashes Rabbit:

lib/rabbit/menu.rb:69:in 'Rabbit::Menu#toggle': undefined method 'visible?' for nil (NoMethodError)

InfoWindow calls init_menu and attach_menu, but it never calls update_menu(). So Menu#update_menu, which creates @popover_menu, never runs for the information window. The main window's renderer does call it, from post_parse, post_apply_theme and similar hooks.

This change calls update_menu at the end of init_window, after the grid is added, because Menu#update_menu uses @window.child. It also calls it in parsed, so the "Jump to" items follow the re-parsed slides.

Tested with Rabbit 4.0.1 on Ruby 4.0.7, Ruby-GNOME 4.3.9, GTK 3.24.52 and Hyprland (XWayland): the context menu now opens in the information window. test/run-test.rb gives the same result as main (one BlockDiagTest failure because blockdiag isn't installed here).

🤖 Generated with Claude Code

InfoWindow creates and attaches a Menu but never calls update_menu(),
so the popover menu is never built. Right-clicking the information
window raises:

    menu.rb:69:in 'Rabbit::Menu#toggle': undefined method 'visible?' for nil (NoMethodError)

Build the menu after the window is set up, and rebuild it when the
source is re-parsed so that the "Jump to" items follow the slides.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@matz
matz deployed to release October 17, 2026 22:26 — with GitHub Actions Active
@kou

kou commented Oct 17, 2026

Copy link
Copy Markdown
Member

Good catch.

@kou
kou merged commit 6713692 into rabbit-shocker:main Oct 17, 2026
6 checks passed

This branch was successfully deployed

1 active deployment
release — 6cc89747 Deployed Oct 17, 2026 by matz via RubyGems #219
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants