WINGs/wevent: fix NULL toplevel crash on Wayland expose dispatch

W_TopLevelOfView returns NULL for views without a topLevel ancestor
(e.g. geometry display widgets parented directly to root). On X11 this
never triggered because expose events only arrived for mapped windows
with proper widget hierarchy. On Wayland, wl_redisplay synthesizes
expose events for any view, exposing the NULL case.

Fix: fall back to the view itself when no topLevel ancestor exists.
This commit is contained in:
Ollie 2026-05-23 16:17:18 +02:00
parent 8ec338016a
commit 1ab108f7aa
1 changed files with 2 additions and 0 deletions

View File

@ -212,6 +212,8 @@ int WMHandleEvent(WMEvent * event)
view->screen->lastEventTime = getEventTime(view->screen, event);
toplevel = W_TopLevelOfView(view);
if (!toplevel)
toplevel = view;
if (mask & (KeyPressMask | KeyReleaseMask)) {
W_View *focused = W_FocusedViewOfToplevel(toplevel);