diff --git a/src-tauri/src/callbacks.rs b/src-tauri/src/callbacks.rs index b3ffb97..b4b9f2a 100644 --- a/src-tauri/src/callbacks.rs +++ b/src-tauri/src/callbacks.rs @@ -9,11 +9,11 @@ use std::{ use anyhow::Result; use jj_lib::{git::RemoteCallbacks, repo::MutableRepo}; -use tauri::{Manager, WebviewWindow}; +use tauri::{Manager, Window}; use crate::{messages::InputRequest, worker::WorkerCallbacks, AppState}; -pub struct FrontendCallbacks(pub WebviewWindow); +pub struct FrontendCallbacks(pub Window); impl WorkerCallbacks for FrontendCallbacks { fn with_git( diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index cd95868..311ee39 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -17,7 +17,7 @@ use anyhow::{anyhow, Context, Result}; use log::LevelFilter; use tauri::menu::Menu; use tauri::{ipc::InvokeError, Manager}; -use tauri::{State, WebviewWindow, Window, WindowEvent, Wry}; +use tauri::{State, Window, WindowEvent, Wry}; use tauri_plugin_window_state::StateFlags; use messages::{ @@ -138,7 +138,7 @@ fn main() -> Result<()> { .ok_or(anyhow!("preconfigured window not found"))?; let (sender, receiver) = channel(); - let handle = window.clone(); + let mut handle = window.as_ref().window(); let window_worker = thread::spawn(move || { log::info!("start worker"); @@ -160,10 +160,10 @@ fn main() -> Result<()> { window.on_menu_event(|w, e| handler::fatal!(menu::handle_event(w, e))); - let handle = window.clone(); + handle = window.as_ref().window(); window.on_window_event(move |event| handle_window_event(&handle, event)); - let handle = window.clone(); + handle = window.as_ref().window(); window.listen("gg://revision/select", move |event| { let payload: Result, serde_json::Error> = serde_json::from_str(event.payload()); @@ -497,7 +497,7 @@ fn try_mutate( call_rx.recv().map_err(InvokeError::from_error) } -fn handle_window_event(window: &WebviewWindow, event: &WindowEvent) { +fn handle_window_event(window: &Window, event: &WindowEvent) { match *event { WindowEvent::Focused(true) => { log::debug!("window focused; requesting snapshot");