Commit 45a383fca811
tarball5 files changed+15-7
@@ -17,8 +17,8 @@ focus_follows_mouse = false
1717
# Put the pointer in the middle of a window focused from the keyboard, a1818
# rule or a new map. Bare metal only, a nested pointer belongs to the host.1919
mouse_follows_focus = false20
-# A window landing on an empty tag that is not in view brings the tag into21
-# view, alongside the tags already shown.20
+# A window landing on or moved to an empty tag that is not in view brings21
+# the tag into view, alongside the tags already shown.2222
view_tag_on_first_window = true2323
2424
[decoration]@@ -33,8 +33,8 @@ pub struct General {
3333
pub move_mode: MoveMode,3434
pub focus_follows_mouse: bool,3535
pub mouse_follows_focus: bool,36
- /// The first window on an empty tag nobody is viewing brings that tag37
- /// into view on its output.36
+ /// The first window to land on or move to an empty tag nobody is37
+ /// viewing brings that tag into view on its output.3838
pub view_tag_on_first_window: bool,3939
}4040
@@ -58,6 +58,7 @@ impl XdgActivationHandler for State {
5858
&& let Some(ctx) = ctx5959
{6060
self.wm.layout.relocate(id, ctx.output, ctx.tag);61
+ self.view_if_first(id);6162
}6263
let may_focus = ctx.is_some_and(|c| c.may_focus) && data.timestamp.elapsed() < FRESH;6364
if may_focus && self.wm.layout.visible(id) {@@ -114,6 +114,7 @@ impl State {
114114
let t = self.wm.layout.tag(&tag);115115
if let Some(w) = focused {116116
self.wm.layout.set_tag(w, t);117
+ self.view_if_first(w);117118
}118119
}119120
Command::ReorderTag { tag, index } => {@@ -60,9 +60,7 @@ impl State {
6060
if let Some(name) = &rule.scratchpad {6161
self.wm.layout.scratchpad_add(id, name);6262
}63
- if self.settings.config.general.view_tag_on_first_window {64
- self.wm.layout.view_if_alone(id);65
- }63
+ self.view_if_first(id);6664
let by_rule = rule.tag.is_some() || rule.output.is_some();6765
self.wm.insert(id, window, by_rule, app_id, title);6866
self.await_first_buffer(id);@@ -191,6 +189,14 @@ impl State {
191189
}192190
}193191
192
+ /// Brings a window's tag into view when it is the tag's first window,193
+ /// whether it mapped there, was moved there or was placed by activation.194
+ pub fn view_if_first(&mut self, id: WindowId) {195
+ if self.settings.config.general.view_tag_on_first_window {196
+ self.wm.layout.view_if_alone(id);197
+ }198
+ }199
+194200
pub fn window_id(&self, surface: &WlSurface) -> Option<WindowId> {195201
self.wm.id_of(surface)196202
}