From bb420ef53615f6b430bf156fc5f5205f51c753ba Mon Sep 17 00:00:00 2001 From: Levi Neely <141506390+lneely@users.noreply.github.com> Date: Thu, 14 May 2026 16:47:07 +0200 Subject: [PATCH] WINGs/wpanel: use WMEvent keysym instead of XLookupString MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All three handleKeyPress functions in wpanel.c were dereferencing event->_x11_raw (NULL in Wayland mode) to call XLookupString. Use event->u.key.keysym directly — it's already translated by the backend. --- WINGs/wpanel.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/WINGs/wpanel.c b/WINGs/wpanel.c index e8d1767..6c8b306 100644 --- a/WINGs/wpanel.c +++ b/WINGs/wpanel.c @@ -21,10 +21,7 @@ static void alertPanelOnClick(WMWidget * self, void *clientData) static void handleKeyPress(WMEvent * event, void *clientData) { WMAlertPanel *panel = (WMAlertPanel *) clientData; - KeySym ksym; - XEvent *xev = (XEvent *)event->_x11_raw; - - XLookupString(&xev->xkey, NULL, 0, &ksym, NULL); + unsigned long ksym = event->u.key.keysym; if ((ksym == XK_Return || ksym == XK_KP_Enter) && panel->defBtn) { WMPerformButtonClick(panel->defBtn); @@ -418,10 +415,7 @@ static void inputBoxOnClick(WMWidget * self, void *clientData) static void handleKeyPress2(WMEvent * event, void *clientData) { WMInputPanel *panel = (WMInputPanel *) clientData; - KeySym ksym; - XEvent *xev = (XEvent *)event->_x11_raw; - - XLookupString(&xev->xkey, NULL, 0, &ksym, NULL); + unsigned long ksym = event->u.key.keysym; if ((ksym == XK_Return || ksym == XK_KP_Enter) && panel->defBtn) { WMPerformButtonClick(panel->defBtn); @@ -429,7 +423,6 @@ static void handleKeyPress2(WMEvent * event, void *clientData) if (panel->altBtn) { WMPerformButtonClick(panel->altBtn); } else { - /* printf("got esc\n"); */ WMBreakModalLoop(WMWidgetScreen(panel->win)); panel->result = WAPRDefault; } @@ -707,10 +700,7 @@ WMInputPanel *WMCreateScaledInputPanel(WMScreen * scrPtr, WMWindow * owner, cons static void handleKeyPress3(WMEvent * event, void *clientData) { WMGenericPanel *panel = (WMGenericPanel *) clientData; - KeySym ksym; - XEvent *xev = (XEvent *)event->_x11_raw; - - XLookupString(&xev->xkey, NULL, 0, &ksym, NULL); + unsigned long ksym = event->u.key.keysym; if ((ksym == XK_Return || ksym == XK_KP_Enter) && panel->defBtn) { WMPerformButtonClick(panel->defBtn);