From 7778df2fc598dfb85d90330fdc6d8c412c94f695 Mon Sep 17 00:00:00 2001 From: David Maciejak Date: Sat, 24 Jan 2026 16:46:31 -0500 Subject: [PATCH] wmaker: add keyboard control to crash window This patch is allowing to control the wpopupbutton entries via keyboard up/down arrows. It happens to me a few weeks ago during development, wmaker crashed and I lost the mouse control. I was stuck on that dialog box without a way to select another entry. --- src/dialog.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/dialog.c b/src/dialog.c index 391dda23..6568a158 100644 --- a/src/dialog.c +++ b/src/dialog.c @@ -1641,6 +1641,8 @@ typedef struct _CrashPanel { int action; /* what to do after */ KeyCode retKey; + KeyCode upKey; + KeyCode downKey; } CrashPanel; @@ -1650,6 +1652,17 @@ static void handleKeyPress(XEvent * event, void *clientData) if (event->xkey.keycode == panel->retKey) { WMPerformButtonClick(panel->okB); + return; + } + + if (event->xkey.keycode == panel->upKey) { + WMSelectPopUpButtonPreviousItem(panel->whatP); + return; + } + + if (event->xkey.keycode == panel->downKey) { + WMSelectPopUpButtonNextItem(panel->whatP); + return; } } @@ -1721,6 +1734,8 @@ int wShowCrashingDialogPanel(int whatSig) panel = wmalloc(sizeof(CrashPanel)); panel->retKey = XKeysymToKeycode(dpy, XK_Return); + panel->upKey = XKeysymToKeycode(dpy, XK_Up); + panel->downKey = XKeysymToKeycode(dpy, XK_Down); panel->win = WMCreateWindow(scr, "crashingDialog"); WMResizeWidget(panel->win, PWIDTH, PHEIGHT);