From 0ac2e7fb5269b9dbdab85f7213b30d76ba2d49f9 Mon Sep 17 00:00:00 2001 From: Vorschreibung <70081698+Vorschreibung@users.noreply.github.com> Date: Wed, 16 Sep 2026 14:24:50 +0200 Subject: [PATCH] Avoid Xwayland scans on X11 sessions (#16232) Desktop refresh runs repeatedly for active sessions, spawning 'psgrep' procs and producing significant CPU load. Guard the Xwayland process scan with the session protocol so X11 sessions skip work that cannot contribute session information. This preserves the existing Wayland discovery path while leaving X11 refresh behavior on its established display and xauth values. --- src/platform/linux.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/platform/linux.rs b/src/platform/linux.rs index 7b52a3571..169e63021 100644 --- a/src/platform/linux.rs +++ b/src/platform/linux.rs @@ -2370,10 +2370,17 @@ mod desktop { last } + /// Preserves an active seat0 session's cached identity so the service loop only retries + /// late Wayland display discovery instead of repeating the full seat lookup. pub fn refresh(&mut self) { if !self.sid.is_empty() && is_active_and_seat0(&self.sid) { // Xwayland display and xauth may not be available in a short time after login. - if is_xwayland_running(&self.uid) && !self.is_login_wayland() { + // Avoid scanning processes on X11, where Xwayland discovery cannot provide any + // useful session information. + if self.is_wayland() + && !self.is_login_wayland() + && is_xwayland_running(&self.uid) + { self.get_display_xauth_xwayland(); } else if self.is_wayland() { self.get_display_xauth_wayland();