feat: add activation on fill
All checks were successful
Nix Build / nix build (push) Successful in 34s
All checks were successful
Nix Build / nix build (push) Successful in 34s
This commit is contained in:
parent
555ffca915
commit
3f06af22a3
3 changed files with 20 additions and 0 deletions
|
@ -295,7 +295,14 @@ impl NiriTag {
|
|||
TagCmd::AddTagToWin(t) => {
|
||||
let wid = self.get_focused_window().await?.id;
|
||||
self.change_window_tag(wid, Some(t)).await?;
|
||||
let entry = self.tags.entry(t).or_default();
|
||||
if entry.windows.len() == 1 && self.config.activation_on_fill {
|
||||
entry.enabled = true;
|
||||
self.fire_event(TagEvent::TagEnabled(t)).await;
|
||||
&[Tag(t), Window(wid)]
|
||||
} else {
|
||||
&[Window(wid)]
|
||||
}
|
||||
}
|
||||
TagCmd::RemoveTagFromWin(_) => {
|
||||
let wid = self.get_focused_window().await?.id;
|
||||
|
@ -311,7 +318,14 @@ impl NiriTag {
|
|||
};
|
||||
self.change_window_tag(wid, Some(new_tag)).await?;
|
||||
tracing::debug!("toggling {} to tag {}", wid, new_tag);
|
||||
let entry = self.tags.entry(new_tag).or_default();
|
||||
if new_tag != 0 && entry.windows.len() == 1 && self.config.activation_on_fill {
|
||||
entry.enabled = true;
|
||||
self.fire_event(TagEvent::TagEnabled(t)).await;
|
||||
&[Tag(t), Window(wid)]
|
||||
} else {
|
||||
&[Window(wid)]
|
||||
}
|
||||
}
|
||||
|
||||
TagCmd::EnableTag(t) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue