From c7acf9d89df3110b226b88d97dcf6310f3e48e56 Mon Sep 17 00:00:00 2001 From: Levi Neely Date: Sat, 28 Mar 2026 10:01:45 +0100 Subject: [PATCH] =?UTF-8?q?wayland:=20Phase=2076=20=E2=80=94=20frame=20NUL?= =?UTF-8?q?L=20guard=20in=20switchpanel.c=20title=20display?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit wSwitchPanelSelectNext, wSwitchPanelSelectFirst, and wSwitchPanelHandleEvent all access wwin->frame->title to display the window title in the Alt-Tab switcher panel. Fall back to wwin->wm_class when frame is NULL so Wayland windows appear in the switcher without crashing. Co-Authored-By: Claude Sonnet 4.6 --- src/switchpanel.c | 11 ++++++++--- tests/wl-smoke-test.sh | 7 +++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/switchpanel.c b/src/switchpanel.c index fa61032..651e154 100644 --- a/src/switchpanel.c +++ b/src/switchpanel.c @@ -645,7 +645,9 @@ WWindow *wSwitchPanelSelectNext(WSwitchPanel *panel, int back, int ignore_minimi scrollIcons(panel, panel->current - panel->firstVisible - panel->visibleCount + 1); if (panel->win) { - drawTitle(panel, panel->current, wwin->frame->title); + /* Phase 76: Wayland windows have no frame — fall back to wm_class */ + drawTitle(panel, panel->current, + wwin->frame ? wwin->frame->title : wwin->wm_class); if (panel->current != orig) changeImage(panel, orig, 0, dim, False); changeImage(panel, panel->current, 1, False, False); @@ -673,7 +675,8 @@ WWindow *wSwitchPanelSelectFirst(WSwitchPanel *panel, int back) } wwin = WMGetFromArray(panel->windows, panel->current); - title = wwin->frame->title; + /* Phase 76: Wayland windows have no frame — fall back to wm_class */ + title = wwin->frame ? wwin->frame->title : wwin->wm_class; if (panel->win) { for (WMArrayFirst(panel->windows, &(i)); (i) != WANotFound; WMArrayNext(panel->windows, &(i))) @@ -713,7 +716,9 @@ WWindow *wSwitchPanelHandleEvent(WSwitchPanel *panel, XEvent *event) wwin = WMGetFromArray(panel->windows, focus); - drawTitle(panel, panel->current, wwin->frame->title); + /* Phase 76: Wayland windows have no frame — fall back to wm_class */ + drawTitle(panel, panel->current, + wwin->frame ? wwin->frame->title : wwin->wm_class); return wwin; } diff --git a/tests/wl-smoke-test.sh b/tests/wl-smoke-test.sh index 18320df..3b950ee 100755 --- a/tests/wl-smoke-test.sh +++ b/tests/wl-smoke-test.sh @@ -86,8 +86,11 @@ # 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). +# for Wayland windows; change_focus_and_raise guards fullscreen stacking +# restore (build-only check). +# 34. (Phase 76) switchpanel.c: Alt-Tab panel title falls back to +# wwin->wm_class when frame is NULL so Wayland windows appear in the +# switcher without crashing (build-only check). # # This test grows as wl_backend vtable slots are implemented. #