From 341413b7e3ed542850e6aa423c8d8ad05942ab3b Mon Sep 17 00:00:00 2001 From: Levi Neely Date: Sat, 28 Mar 2026 09:51:50 +0100 Subject: [PATCH] =?UTF-8?q?wayland:=20Phase=2071b=20=E2=80=94=20additional?= =?UTF-8?q?=20frame=20NULL=20guards=20in=20actions.c?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Guard the remaining wwin->frame dereferences that are reachable for Wayland windows: - wSetFocusTo: skip ChangeStackingLevel for fullscreen if !frame - set_window_coords: fall back to client size when frame is NULL (called by find_Maximus_geometry on neighbour windows) - wFullscreenMonitorsWindow: early return if !frame - wMakeWindowVisible: skip wRaiseFrame if !frame Co-Authored-By: Claude Sonnet 4.6 --- src/actions.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/actions.c b/src/actions.c index ed393a7..b8a929a 100644 --- a/src/actions.c +++ b/src/actions.c @@ -217,7 +217,7 @@ void wSetFocusTo(WScreen *scr, WWindow *wwin) } /* reset fullscreen if temporarily removed due to lost focus*/ - if (wwin->flags.fullscreen) + if (wwin->flags.fullscreen && wwin->frame) ChangeStackingLevel(wwin->frame->core, WMFullscreenLevel); } @@ -814,8 +814,9 @@ static void set_window_coords(WWindow *wwin, win_coords *obs) { obs->left = wwin->frame_x; obs->top = wwin->frame_y; - obs->width = wwin->frame->core->width; - obs->height = wwin->frame->core->height; + /* Phase 71: Wayland windows have no frame; fall back to client size */ + obs->width = wwin->frame ? wwin->frame->core->width : wwin->client.width; + obs->height = wwin->frame ? wwin->frame->core->height : wwin->client.height; obs->bottom = obs->top + obs->height; obs->right = obs->left + obs->width; } @@ -967,6 +968,9 @@ void wFullscreenMonitorsWindow(WWindow *wwin, unsigned long top, unsigned long b int i; long monitor; WMRect rect1, rect2; + if (!wwin->frame) + return; /* Phase 71: Wayland — no frame for fullscreen-monitors */ + if ((int)top < wwin->screen_ptr->head_count && (int)bottom < wwin->screen_ptr->head_count && @@ -2236,7 +2240,8 @@ void wMakeWindowVisible(WWindow *wwin) } else { if (!WFLAGP(wwin, no_focusable)) wSetFocusTo(wwin->screen_ptr, wwin); - wRaiseFrame(wwin->frame->core); + if (wwin->frame) + wRaiseFrame(wwin->frame->core); /* Phase 71: skip for Wayland */ } }