feat(wm): reintroduce remove-title-bar cmds

This commit reintroduces some old code from the feature/remove-titlebars
branch. This feature is very unstable and it is strongly advised that
nobody actually uses it. Wherever possible, please use the "remove
titlebar" functionality provided directly within an application.
This commit is contained in:
LGUG2Z
2023-05-15 13:49:43 -07:00
parent d0c081feae
commit c37ba42825
8 changed files with 99 additions and 11 deletions

View File

@@ -513,6 +513,7 @@ gen_application_target_subcommand_args! {
IdentifyLayeredApplication,
IdentifyObjectNameChangeApplication,
IdentifyBorderOverflowApplication,
RemoveTitleBar,
}
#[derive(Parser, AhkFunction)]
@@ -964,6 +965,11 @@ enum SubCommand {
/// Identify an application that has WS_EX_LAYERED, but should still be managed
#[clap(arg_required_else_help = true)]
IdentifyLayeredApplication(IdentifyLayeredApplication),
/// Whitelist an application for title bar removal
#[clap(arg_required_else_help = true)]
RemoveTitleBar(RemoveTitleBar),
/// Toggle title bars for whitelisted applications
ToggleTitleBars,
/// Identify an application that has overflowing borders
#[clap(arg_required_else_help = true)]
#[clap(alias = "identify-border-overflow")]
@@ -1710,6 +1716,21 @@ fn main() -> Result<()> {
.as_bytes()?,
)?;
}
SubCommand::RemoveTitleBar(target) => {
match target.identifier {
ApplicationIdentifier::Exe => {}
_ => {
return Err(anyhow!(
"this command requires applications to be identified by their exe"
))
}
}
send_message(&SocketMessage::RemoveTitleBar(target.identifier, target.id).as_bytes()?)?;
}
SubCommand::ToggleTitleBars => {
send_message(&SocketMessage::ToggleTitleBars.as_bytes()?)?;
}
SubCommand::Manage => {
send_message(&SocketMessage::ManageFocusedWindow.as_bytes()?)?;
}