From d16f7dab25bd9508271017bc6dc15024c30cbf71 Mon Sep 17 00:00:00 2001 From: srdusr <99972264+srdusr@users.noreply.github.com> Date: Wed, 28 Jan 2026 14:20:00 +0200 Subject: Redesign the titlebar right-click menu: real separators/headers, live customization Reported live: "looks very ugly currently and some of it doesn't make sense." Both were real. Every row, including a bare divider, took one full TITLEBAR_HEIGHT slot, so a separator was a 1px hairline in the middle of 32px of empty space; "Move to Workspace" faked a section caption by embedding box-drawing characters directly in an ordinary item's label, which rendered - and behaved, until the click-dispatch site's own special case - exactly like a clickable row that did nothing. Separately, "Floating" was always offered even though Window::floating only affects the "tiling" layout: toggling it under this project's own default "dynamic" layout visibly changes nothing, reading as a broken control rather than an inapplicable one. ContextMenu (crates/core/src/context_menu.rs) gained real Separator (9px) and Header (22px, non-interactive, dimmed) row kinds with their own small heights, replacing the label-hack outright. Both backends' rendering now sum each row's own real height instead of assuming one uniform value, so hit-testing and pixels can't disagree about where a row is. Floating is omitted entirely outside the tiling layout. New, in direct response to "allow customizing from there as well": a Customize section with live Button Style / Button Side toggles. Each flips the matching ThemeConfig field and immediately redraws every open window's titlebar - not routed through srd set's own path, which is scoped to windows created after the call for lack of a redraw hook it can reach; a menu action that didn't visibly change the titlebar you clicked would be its own "doesn't make sense" bug. Full workspace build/test/clippy clean (242 core tests, +8; 152 wayland, net-even after rewriting the old label-hack tests). --- crates/x11/src/platform/events.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/x11/src/platform/events.rs') diff --git a/crates/x11/src/platform/events.rs b/crates/x11/src/platform/events.rs index 10f96a9..545e8f3 100644 --- a/crates/x11/src/platform/events.rs +++ b/crates/x11/src/platform/events.rs @@ -89,7 +89,7 @@ impl X11Platform { (menu.row_at(x, y).map(|r| menu.items[r].1), menu.window) }; match row_action { - Some(srdwm_core::context_menu::MenuAction::Separator) => {} + Some(action) if !action.is_interactive() => {} Some(action) => { self.close_context_menu()?; self.run_context_menu_action(menu_window, action)?; -- cgit v1.2.3