mirror of
https://github.com/project-gauntlet/gauntlet.git
synced 2025-12-23 10:35:53 +00:00
Cli gauntlet open now hides window when pressed while window is open, matching behavior of global shortcut
This commit is contained in:
parent
283285c317
commit
bced4daedd
5 changed files with 6 additions and 12 deletions
|
|
@ -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>) {
|
||||
|
|
|
|||
|
|
@ -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: () }));
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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<()>;
|
||||
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue