Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions docs/plans/2026-10-28-wayland-titlebar-workaround.md
Original file line number Diff line number Diff line change
@@ -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
26 changes: 0 additions & 26 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
Expand Down
Loading