Cli gauntlet open now hides window when pressed while window is open, matching behavior of global shortcut

This commit is contained in:
Exidex 2025-07-03 18:59:24 +02:00
parent 283285c317
commit bced4daedd
No known key found for this signature in database
GPG key ID: AC63AA86DD4F2D45
5 changed files with 6 additions and 12 deletions

View file

@ -297,7 +297,7 @@ pub fn run(minimized: bool, scenario_runner_data: Option<ScenarioRunnerData>) {
.subscription(subscription)
.theme(|state, _| state.theme.clone())
.run()
.expect("Unable to start scenario application");
.expect("Unable to start application");
}
fn new(minimized: bool, #[allow(unused)] scenario_runner_data: Option<ScenarioRunnerData>) -> (AppModel, Task<AppMsg>) {

View file

@ -115,10 +115,10 @@ async fn request_loop(
AppMsg::ClearInlineView { plugin_id }
}
FrontendApiRequestData::ShowWindow {} => {
responder.respond(Ok(FrontendApiResponseData::ShowWindow { data: () }));
FrontendApiRequestData::ToggleWindow {} => {
responder.respond(Ok(FrontendApiResponseData::ToggleWindow { data: () }));
AppMsg::WindowAction(WindowActionMsg::ShowWindow)
AppMsg::WindowAction(WindowActionMsg::ToggleWindow)
}
FrontendApiRequestData::HideWindow {} => {
responder.respond(Ok(FrontendApiResponseData::HideWindow { data: () }));

View file

@ -313,7 +313,7 @@ fn window_settings(position: Position) -> window::Settings {
}
#[cfg(target_os = "macos")]
pub fn macos_focus_previous_app() -> Task<WindowActionMsg> {
pub fn macos_focus_previous_app() {
unsafe {
// when closing NSPanel current active application doesn't automatically become key window
// is there a proper way? without doing this manually

View file

@ -30,7 +30,7 @@ pub trait FrontendApi {
async fn clear_inline_view(&self, plugin_id: PluginId) -> RequestResult<()>;
async fn show_window(&self) -> RequestResult<()>;
async fn toggle_window(&self) -> RequestResult<()>;
async fn hide_window(&self) -> RequestResult<()>;

View file

@ -185,12 +185,6 @@ impl ApplicationManager {
result
}
pub async fn show_window(&self) -> anyhow::Result<()> {
self.frontend_api.show_window().await?;
Ok(())
}
pub async fn run_action(
&self,
plugin_id: PluginId,