1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-03-19 17:23:33 +01:00

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.
This commit is contained in:
David Maciejak
2026-01-24 16:46:31 -05:00
committed by Carlos R. Mafra
parent 156841f80e
commit 7778df2fc5

View File

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