From 2c7407a6c8e36e4ee72a2c4a15e54ecb22d59a20 Mon Sep 17 00:00:00 2001 From: Levi Neely Date: Sat, 28 Mar 2026 10:00:02 +0100 Subject: [PATCH] =?UTF-8?q?wayland:=20Phase=2075=20=E2=80=94=20frame=20NUL?= =?UTF-8?q?L=20guards=20in=20cycling.c?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit raiseWindow: skip stacking operations when wwin->frame is NULL (Wayland windows have no X11 frame window to restack). change_focus_and_raise: skip fullscreen stacking-level restore when oldFocused->frame is NULL. Co-Authored-By: Claude Sonnet 4.6 --- src/cycling.c | 5 ++++- tests/wl-smoke-test.sh | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/cycling.c b/src/cycling.c index 4c7612f..4fab84c 100644 --- a/src/cycling.c +++ b/src/cycling.c @@ -40,6 +40,9 @@ static void raiseWindow(WSwitchPanel * swpanel, WWindow * wwin) { WNativeWindow swwin = wSwitchPanelGetWindow(swpanel); + if (!wwin->frame) + return; /* Phase 75: Wayland — no frame window to raise */ + if (wwin->flags.mapped || wwin->flags.shaded) { if (swwin != WNATIVE_NONE) { WNativeWindow win[2]; @@ -60,7 +63,7 @@ static WWindow *change_focus_and_raise(WWindow *newFocused, WWindow *oldFocused, return oldFocused; /* allow the focused window to float on top of a fullscreen window */ - if (oldFocused->flags.fullscreen) + if (oldFocused->flags.fullscreen && oldFocused->frame) ChangeStackingLevel(oldFocused->frame->core, WMNormalLevel); wWindowFocus(newFocused, oldFocused); diff --git a/tests/wl-smoke-test.sh b/tests/wl-smoke-test.sh index 73e6fd3..18320df 100755 --- a/tests/wl-smoke-test.sh +++ b/tests/wl-smoke-test.sh @@ -85,6 +85,9 @@ # client_synth_configure for Wayland windows; wWindowSingleFocus and # wWindowSaveState use client geometry fallback when frame is NULL # (build-only check). +# 33. (Phase 75) Frame NULL guards in cycling.c: raiseWindow skips stacking +# for Wayland windows; change_focus_and_raise skips fullscreen stacking +# restore when frame is NULL (build-only check). # # This test grows as wl_backend vtable slots are implemented. #