1
0
Fork 0
forked from wry/wry

output: don't focus the workspace when clicking on the separator

This commit is contained in:
Julian Orth 2026-02-17 18:19:12 +01:00
parent d3ee69863a
commit dd89355d80
3 changed files with 11 additions and 0 deletions

View file

@ -96,6 +96,7 @@ pub struct OutputNode {
pub bar_rect: Cell<Rect>,
pub bar_rect_rel: Cell<Rect>,
pub bar_rect_with_separator: Cell<Rect>,
pub bar_rect_with_separator_rel: Cell<Rect>,
pub bar_separator_rect: Cell<Rect>,
pub bar_separator_rect_rel: Cell<Rect>,
pub render_data: RefCell<OutputRenderData>,
@ -776,6 +777,7 @@ impl OutputNode {
let mut bar_rect = Rect::default();
let mut bar_rect_rel = Rect::default();
let mut bar_rect_with_separator = Rect::default();
let mut bar_rect_with_separator_rel = Rect::default();
let mut bar_separator_rect = Rect::default();
let mut bar_separator_rect_rel = Rect::default();
let mut workspace_rect = non_exclusive_rect;
@ -800,6 +802,7 @@ impl OutputNode {
}
let to_rel = |r: Rect| r.move_(-rect.x1(), -rect.y1());
bar_rect_rel = to_rel(bar_rect);
bar_rect_with_separator_rel = to_rel(bar_rect_with_separator);
bar_separator_rect_rel = to_rel(bar_separator_rect);
workspace_rect_rel = to_rel(workspace_rect);
}
@ -808,6 +811,8 @@ impl OutputNode {
self.bar_rect.set(bar_rect);
self.bar_rect_rel.set(bar_rect_rel);
self.bar_rect_with_separator.set(bar_rect_with_separator);
self.bar_rect_with_separator_rel
.set(bar_rect_with_separator_rel);
self.bar_separator_rect.set(bar_separator_rect);
self.bar_separator_rect_rel.set(bar_separator_rect_rel);
self.workspace_rect.set(workspace_rect);
@ -1184,6 +1189,10 @@ impl OutputNode {
if self.bar_button(seat, x, y) {
return;
}
let bar_rect_with_separator_rel = self.bar_rect_with_separator_rel.get();
if bar_rect_with_separator_rel.contains(x, y) {
return;
}
let ws = self.ensure_workspace();
seat.focus_node(ws);
}