fix error

This commit is contained in:
Haapy
2026-05-14 23:31:53 +00:00
parent 6a4f4b4aa9
commit 72c2afb1a4
2 changed files with 15 additions and 3 deletions

View File

@@ -104,9 +104,12 @@ fn fetch_tauri_xid(app: &AppHandle, window: tauri::WebviewWindow) -> Result<u32,
use gtk::prelude::*;
let gtk_win = window.gtk_window().map_err(|e| e.to_string())?;
let gdk_win = gtk_win.window().ok_or_else(|| "no GDK window yet".to_string())?;
let x11: gdkx11::X11Window = gdk_win
.downcast()
.map_err(|_| "GDK window is not an X11Window".to_string())?;
let x11: gdkx11::X11Window = gdk_win.downcast().map_err(|_| {
"Tauri's window is not an X11 window — likely running on Wayland. \
GDK_BACKEND=x11 should force X11; check that XWayland is installed \
(apt install xwayland) and restart the app."
.to_string()
})?;
Ok(x11.xid() as u32)
})();
let _ = tx.send(result);