-
Notifications
You must be signed in to change notification settings - Fork 145
Description
Summary
The right-click context menu on the header bar (system window menu with Sticky, Always on Top, move to workspace, etc.) stopped working after commit 03d0171 ("chore: update iced", 2026-03-06).
Apps compiled against the previous checkout (384e8f6, 2026-02-20) still have a working right-click menu. Apps compiled against 03d0171 or later do not.
Root Cause
In iced/widget/src/mouse_area.rs, the ButtonPressed(mouse::Button::Right) event handler was dropped during the iced update. The on_right_press field, setter method, and all call sites (including header_bar.rs line 444) still exist — only the event dispatch is missing.
384e8f6 (working) has at line 520:
if let Some(message) = widget.on_right_press.as_ref() {
if let Event::Mouse(mouse::Event::ButtonPressed(mouse::Button::Right)) =
event
{
shell.publish(message.clone());
return event::Status::Captured;
}
}03d0171 (broken) — the above block is entirely absent. The match event block handles ButtonReleased(Right), ButtonPressed(Middle), ButtonReleased(Middle), and WheelScrolled, but not ButtonPressed(Right).
Fix
Add the missing handler back into the match event block in mouse_area.rs:
Event::Mouse(mouse::Event::ButtonPressed(mouse::Button::Right)) => {
if let Some(message) = widget.on_right_press.as_ref() {
shell.publish(message.clone());
shell.capture_event();
}
}Impact
Every libcosmic app loses the header bar right-click system window menu (Sticky Window, Always on Top, Move to Workspace, etc.). This affects all apps using cosmic::Application since the header bar unconditionally sets .on_right_click(Action::ShowWindowMenu).