WINGs/wpanel: use WMEvent keysym instead of XLookupString

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.
This commit is contained in:
Levi Neely 2026-05-14 16:47:07 +02:00
parent 4f462357e1
commit bb420ef536
1 changed files with 3 additions and 13 deletions

View File

@ -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);