[PATCH 2/2] wmaker: add keyboard control to crash window

3 views
Skip to first unread message

david.m...@gmail.com

unread,
Jan 24, 2026, 5:01:44 PM (9 days ago) Jan 24
to Window Maker Development
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);
--
2.43.0
0002-wmaker-add-keyboard-control-to-crash-window.patch
Reply all
Reply to author
Forward
0 new messages