From 8fc827a3b30de16b6adbf80abea3bc224d507268 Mon Sep 17 00:00:00 2001 From: tcmal Date: Fri, 30 Aug 2024 16:51:50 +0100 Subject: Add bind for going back and forth between tags --- src/clients/mod.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/clients/mod.rs') diff --git a/src/clients/mod.rs b/src/clients/mod.rs index 70ffb00..d093fb1 100644 --- a/src/clients/mod.rs +++ b/src/clients/mod.rs @@ -432,11 +432,17 @@ impl ClientState { .for_each(|c| c.ensure_unmapped(conn)); debug!("setting tag focus to {:?} on mon {}", tag_focus, mon); + self.mons[mon].last_focused_tag = curr_focus; self.mons[mon].focused_tag = tag_focus; self.unfocus(conn); self.rearrange_mon(conn, mon); } + /// Set the given monitor's focused tag to its previous value + pub fn mon_prev_tag_focus(&mut self, conn: &Connection<'_>, mon: MonitorIdx) { + self.set_mon_tag_focus(conn, mon, self.mons[mon].last_focused_tag); + } + /// Set the tag for the given client pub fn set_client_tag(&mut self, conn: &Connection<'_>, pos: ClientIdx, tag: Tag) { let c = self.client_mut(pos); -- cgit v1.2.3