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(); } }