1
0
Fork 0
forked from wry/wry

feat: implement scratchpad window toggling

This commit is contained in:
atagen 2026-05-31 17:23:56 +10:00
parent 5c2f631fdb
commit d756c8a6a2
17 changed files with 515 additions and 3 deletions

View file

@ -117,6 +117,8 @@ impl ActionParser<'_> {
"toggle-fullscreen" => ToggleFullscreen,
"enter-fullscreen" => SetFullscreen(true),
"exit-fullscreen" => SetFullscreen(false),
"send-to-scratchpad" => SendToScratchpad,
"toggle-scratchpad" => ToggleScratchpad,
"focus-parent" => FocusParent,
"close" => Close,
"disable-pointer-constraint" => DisablePointerConstraint,
@ -222,6 +224,24 @@ impl ActionParser<'_> {
Ok(Action::MoveToWorkspace { name })
}
fn parse_send_to_scratchpad(&mut self, ext: &mut Extractor<'_>) -> ParseResult<Self> {
let name = ext
.extract(opt(str("name")))?
.map(|name| name.value)
.unwrap_or("")
.to_string();
Ok(Action::SendToScratchpad { name })
}
fn parse_toggle_scratchpad(&mut self, ext: &mut Extractor<'_>) -> ParseResult<Self> {
let name = ext
.extract(opt(str("name")))?
.map(|name| name.value)
.unwrap_or("")
.to_string();
Ok(Action::ToggleScratchpad { name })
}
fn parse_configure_connector(&mut self, ext: &mut Extractor<'_>) -> ParseResult<Self> {
let con = ext
.extract(val("connector"))?
@ -551,6 +571,8 @@ impl Parser for ActionParser<'_> {
"switch-to-vt" => self.parse_switch_to_vt(&mut ext),
"show-workspace" => self.parse_show_workspace(&mut ext),
"move-to-workspace" => self.parse_move_to_workspace(&mut ext),
"send-to-scratchpad" => self.parse_send_to_scratchpad(&mut ext),
"toggle-scratchpad" => self.parse_toggle_scratchpad(&mut ext),
"configure-connector" => self.parse_configure_connector(&mut ext),
"configure-input" => self.parse_configure_input(&mut ext),
"configure-output" => self.parse_configure_output(&mut ext),