feat(wm): add cmd to toggle new window behaviour

This commit introduces a new command, toggle-new-window-behaviour, which
can be used to toggle how new windows on the screen will be handled.

The default setting is to add a new window in a dedicated container, but
when toggled, new windows will be stacked on top of the currently
focused window container.

This can be useful if you only want to use a certain number of columns,
and when you have enough windows on the screen for them, you can toggle
the new window behaviour to start appending to the existing column
stacks.

This commit also fixes a bug where stacked windows being closed did
cause the next window underneath in the stack to be shown.

re #72
This commit is contained in:
LGUG2Z
2021-11-13 14:31:00 -08:00
parent 7f74640dbd
commit 676b643faf
9 changed files with 127 additions and 80 deletions

View File

@@ -51,6 +51,7 @@ pub enum SocketMessage {
ToggleFloat,
ToggleMonocle,
ToggleMaximize,
ToggleNewWindowBehaviour,
// Current Workspace Commands
ManageFocusedWindow,
UnmanageFocusedWindow,
@@ -139,6 +140,13 @@ pub enum FocusFollowsMouseImplementation {
Windows,
}
#[derive(Clone, Copy, Debug, Serialize, Deserialize, Display, EnumString, ArgEnum)]
#[strum(serialize_all = "snake_case")]
pub enum NewWindowBehaviour {
CreateNewContainer,
AppendToFocusedContainer,
}
#[derive(Clone, Copy, Debug, Serialize, Deserialize, Display, EnumString, ArgEnum)]
#[strum(serialize_all = "snake_case")]
pub enum Sizing {