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:
parent
8ec338016a
commit
1ab108f7aa
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue