feat(wm): add visual feedback for preselection

This commit adds visual feedback in the form of a ghost tile for
preselections made by the preselect-direction command.

A container with the id "PRESELECT" will be added to the workspace, and
replaced when the next manage-able window is spawned.

A new command, cancel-preselect, has been added to remove both the
preselection index and the ghost tile if the user changes their mind.
This commit is contained in:
LGUG2Z
2025-11-02 10:58:43 -08:00
parent 3491dc7590
commit d0ae92ca3a
8 changed files with 62 additions and 7 deletions

View File

@@ -1099,6 +1099,8 @@ enum SubCommand {
/// Preselect the specified direction for the next window to be spawned on supported layouts
#[clap(arg_required_else_help = true)]
PreselectDirection(PreselectDirection),
/// Cancel a workspace preselect set by the preselect-direction command, if one exists
CancelPreselect,
/// Minimize the focused window
Minimize,
/// Close the focused window
@@ -2045,6 +2047,9 @@ fn main() -> eyre::Result<()> {
SubCommand::PreselectDirection(arg) => {
send_message(&SocketMessage::PreselectDirection(arg.operation_direction))?;
}
SubCommand::CancelPreselect => {
send_message(&SocketMessage::CancelPreselect)?;
}
SubCommand::CycleFocus(arg) => {
send_message(&SocketMessage::CycleFocusWindow(arg.cycle_direction))?;
}