From 8970494c73acdbfd4de932e595cc173d5daaf4db Mon Sep 17 00:00:00 2001 From: vriesd Date: Wed, 28 Oct 2026 01:33:40 +0100 Subject: [PATCH] fix: drop the Wayland titlebar workaround now that tao fixes it show_main_window toggled resizability after restoring a tray-hidden window on Wayland because titlebar buttons stopped responding (tauri-apps/tauri#11856). tao 0.36 (tauri-apps/tao#1218) restored GTK's own client-side decorations, and Tauri 2.12 ships tao 0.37.2, so the workaround is no longer needed. --- .../2026-10-28-wayland-titlebar-workaround.md | 10 +++++++ src-tauri/src/main.rs | 26 ------------------- 2 files changed, 10 insertions(+), 26 deletions(-) create mode 100644 docs/plans/2026-10-28-wayland-titlebar-workaround.md diff --git a/docs/plans/2026-10-28-wayland-titlebar-workaround.md b/docs/plans/2026-10-28-wayland-titlebar-workaround.md new file mode 100644 index 0000000..05ba7d2 --- /dev/null +++ b/docs/plans/2026-10-28-wayland-titlebar-workaround.md @@ -0,0 +1,10 @@ +# Remove the Wayland titlebar workaround + +`show_main_window` toggles resizability after restoring a tray-hidden window on +Wayland so the titlebar buttons respond (tauri#11856). tao 0.36 (#1218) fixed +the cause, and Tauri 2.12 ships tao 0.37.2. + +- [x] Wayland test harness drives the real GNOME session (empty workspace, PID namespace, isolated D-Bus). The installed Echo exited at the first Mutter RemoteDesktop session and was relaunched; cause unconfirmed +- [x] Remove the workaround from `show_main_window`; fmt, clippy, tests pass +- [x] On Wayland: hide to tray, reopen, titlebar maximize and close respond (screenshots) +- [ ] PR CI green diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 118c2d8..770d44a 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -30,34 +30,8 @@ const APP_ID: &str = "io.github.ddv1982.echo"; fn show_main_window(app: &tauri::AppHandle) { if let Some(window) = app.get_webview_window("main") { - #[cfg(target_os = "linux")] - let was_hidden = matches!(window.is_visible(), Ok(false)); let _ = window.show(); let _ = window.unminimize(); - #[cfg(target_os = "linux")] - if was_hidden - && env::var_os("WAYLAND_DISPLAY") - .map(|display| !display.is_empty()) - .unwrap_or(false) - && !env::var_os("GDK_BACKEND") - .map(|backends| { - backends - .to_string_lossy() - .split(',') - .any(|backend| backend.trim().eq_ignore_ascii_case("x11")) - }) - .unwrap_or(false) - { - // Remove with the Tauri 2.12/tao 0.36 Wayland decoration fix. - if let Err(err) = window.set_resizable(false) { - eprintln!("window workaround: failed to disable resizability: {err}"); - } else if let Err(err) = window.set_resizable(true) { - eprintln!("window workaround: failed to restore resizability: {err}; retrying"); - if let Err(retry_err) = window.set_resizable(true) { - eprintln!("window workaround: resizability restore retry failed: {retry_err}"); - } - } - } let _ = window.set_focus(); } }