X11 backend: ignore a stale _NET_SUPPORTING_WM_CHECK; tested on NVIDIA Xorg
CI / test (push) Failing after 2m3s

A window manager that was killed leaves the property on the root window,
so Chandra opened a 1280x720 window instead of taking the screen (seen on
a Vast.ai NVIDIA rig after pkill -9 openbox). Check that the window it
names exists and points at itself, as EWMH says. docs/x11.md records the
NVIDIA test (GTX 1650, driver 595.91.07).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hhLFs4VtHV26G1iyeo
This commit is contained in:
Claude committed 2026-11-26 01:59:17 +00:00
1 parent ae48cc5bf4
commit e184e29600
2 files changed
+21 -3

No files matched your search

+12 -3
View File
@@ -748,9 +748,17 @@ pub fn X11Window::open(
let a_wm_check = self.intern("_NET_SUPPORTING_WM_CHECK")
let a_pid = self.intern("_NET_WM_PID")
// A window manager announces itself on the root window (EWMH); without one, take the screen.
// The property outlives a window manager that was killed, so also check that the window it
// names still exists and points at itself (EWMH).
let has_wm = match self.get_prop(root, a_wm_check) {
Some(_) => true
None => false
Some(v) if v.length() >= 4 => {
let child = get32(v, 0)
match self.get_prop(child, a_wm_check) {
Some(c) if c.length() >= 4 && get32(c, 0) == child => true
_ => false
}
}
_ => false
}
self.session = !has_wm
if self.session {
@@ -1027,7 +1035,8 @@ fn X11Window::dispatch(self : X11Window, off : Int) -> Int {
self.seg_attached = false
self.frame_pending = false
self.redraw = true
} else if self.errors_logged < 20 {
} else if self.errors_logged < 20 && !(major == 20 && err == 3) {
// (BadWindow from GetProperty is the window-manager check finding a stale window.)
self.errors_logged = self.errors_logged + 1
@sys.log(
"x11: X error " +