From fd73e94a58c5d066b6c25c0fd78eac53b6747a57 Mon Sep 17 00:00:00 2001 From: Window Maker Date: Sun, 24 May 2026 18:05:36 +0200 Subject: [PATCH] WINGs/wview_wl: stub pointer_grab/ungrab; mark unmanaged toplevels popup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit WMPopUpButton's popUpMenu calls viewBackend->pointer_grab which was NULL on Wayland — calling NULL function pointer crashed WPrefs when clicking the popup dropdown. Provide no-op stubs (Wayland uses implicit grab on button press). Also mark W_CreateUnmanagedTopView views with flags.popup=1 so they go through the same borderless/skip-taskbar path as editmenu standalone windows. --- WINGs/wview.c | 1 + WINGs/wview_wl.c | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/WINGs/wview.c b/WINGs/wview.c index 1d0f82f..04aa90a 100644 --- a/WINGs/wview.c +++ b/WINGs/wview.c @@ -142,6 +142,7 @@ W_View *W_CreateUnmanagedTopView(W_Screen * screen) return NULL; view->flags.topLevel = 1; + view->flags.popup = 1; return view; } diff --git a/WINGs/wview_wl.c b/WINGs/wview_wl.c index c47c0d7..20e3912 100644 --- a/WINGs/wview_wl.c +++ b/WINGs/wview_wl.c @@ -700,6 +700,18 @@ static void wl_window_realize(void *vctx, W_View *view, const char *name, (void)vctx; (void)view; (void)name; (void)class; (void)owner; } +static void wl_pointer_grab(void *vctx, W_View *view, int owner_events, unsigned long time) +{ + (void)vctx; (void)view; (void)owner_events; (void)time; + /* No-op: Wayland uses implicit grab on button press; popup menus + * receive events via the pointer focus mechanism. */ +} + +static void wl_pointer_ungrab(void *vctx, unsigned long time) +{ + (void)vctx; (void)time; +} + static void wl_window_set_geometry(void *vctx, W_View *view) { (void)vctx; @@ -747,8 +759,8 @@ const W_ViewBackend W_ViewBackendWL = { .window_realize = wl_window_realize, .window_set_geometry = wl_window_set_geometry, .window_withdraw = wl_window_withdraw, - .pointer_grab = NULL, - .pointer_ungrab = NULL, + .pointer_grab = wl_pointer_grab, + .pointer_ungrab = wl_pointer_ungrab, .bell = NULL, .balloon_draw = wl_balloon_draw, .text_init = wl_text_init,