From 03fe6771cc05b8ae5e3e2d4eacb8f858764df993 Mon Sep 17 00:00:00 2001 From: Window Maker Date: Mon, 25 May 2026 17:17:03 +0200 Subject: [PATCH] WINGs/wevent_x11: fix MapRequest/ConfigureRequest not reaching WM dispatch SubstructureRedirect events (MapRequest, ConfigureRequest) are delivered to the root window. Since the root window has a WINGs view registered (the WMScreen root view), W_GetViewForXWindow resolves it and WMHandleEvent dispatches to the view handlers instead of falling through to extraEventHandler (DispatchEvent). This caused WINGs-based apps like WPrefs to never have their windows managed by the WM - the MapRequest was silently consumed. Fix: skip the view lookup for MapRequest and ConfigureRequest events so they always reach DispatchEvent via extraEventHandler. --- WINGs/wevent_x11.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/WINGs/wevent_x11.c b/WINGs/wevent_x11.c index f653365..4e17101 100644 --- a/WINGs/wevent_x11.c +++ b/WINGs/wevent_x11.c @@ -291,7 +291,13 @@ x11_fetch(void *ectx, WMEvent *ev) } xev_to_wme(slot, ev); - ev->_view_target = W_GetViewForXWindow(ctx->dpy, slot->xany.window); + /* SubstructureRedirect events (MapRequest, ConfigureRequest) are + * delivered to the root window but must reach the WM's DispatchEvent + * via extraEventHandler. Skip view lookup so they fall through. */ + if (slot->type == MapRequest || slot->type == ConfigureRequest) + ev->_view_target = NULL; + else + ev->_view_target = W_GetViewForXWindow(ctx->dpy, slot->xany.window); } static Bool