upgrade gpauth

This commit is contained in:
Kevin Yue
2024-12-13 10:58:39 +00:00
parent f474ab36c0
commit 0c1d239736
32 changed files with 930 additions and 4288 deletions

View File

@@ -7,17 +7,12 @@ use tokio::process::Command;
pub trait WindowExt {
fn raise(&self) -> anyhow::Result<()>;
fn hide_menu(&self);
}
impl WindowExt for WebviewWindow {
fn raise(&self) -> anyhow::Result<()> {
raise_window(self)
}
fn hide_menu(&self) {
hide_menu(self);
}
}
pub fn raise_window(win: &WebviewWindow) -> anyhow::Result<()> {
@@ -40,7 +35,7 @@ pub fn raise_window(win: &WebviewWindow) -> anyhow::Result<()> {
// Calling window.show() on Windows will cause the menu to be shown.
// We need to hide it again.
hide_menu(win);
win.hide_menu()?;
Ok(())
}
@@ -76,22 +71,3 @@ async fn wmctrl_try_raise_window(title: &str) -> anyhow::Result<ExitStatus> {
Ok(exit_status)
}
fn hide_menu(win: &WebviewWindow) {
// let menu_handle = win.menu_handle();
// tokio::spawn(async move {
// loop {
// let menu_visible = menu_handle.is_visible().unwrap_or(false);
// if !menu_visible {
// break;
// }
// if menu_visible {
// let _ = menu_handle.hide();
// tokio::time::sleep(Duration::from_millis(10)).await;
// }
// }
// });
}