Commit Graph
30 Commits
Author SHA1 Message Date
Lukasz Kasprzak 9610f461c2 keychord: bind a sequence of keys, and dispatch events while waiting
Original keychord patch by Hai Nguyen <hhai2105@gmail.com>, updated for
dwm 6.4+ grabkeys() by Aaron Zueger <contact@azureorange.xyz>. This
revision rebases onto dwm 6.8 and fixes an event-loss bug in the chord
wait loop.

The wait loop used to discard every event that was not a KeyPress:

    while (running && !XNextEvent(dpy, &event) && !ran)
            if(event.type == KeyPress)
                    break;

Two consequences, both reproduced on Xephyr:

1. Unrecoverable input freeze. grabbuttons() grabs unfocused clients
   GrabModeSync/GrabModeSync, so clicking one freezes pointer AND
   keyboard until the grabbing client calls XAllowEvents. dwm does that
   in buttonpress() -- but if the ButtonPress is discarded here,
   buttonpress() never runs. The grab stays frozen forever and the loop
   can never exit, because a frozen keyboard cannot deliver the KeyPress
   it is waiting for. Only killing dwm ends it; XSendEvent is discarded
   by this same loop and XTEST queues behind the frozen device.
   Repro: press a chord prefix, then click any unfocused client.
   Observed: XGrabKeyboard -> GrabFrozen, XQueryPointer -> Button1 held.

2. Orphaned windows. A MapRequest arriving mid-chord is dropped, so a
   window opening during a chord is never managed. DestroyNotify,
   Expose and ConfigureRequest are lost the same way.

Dispatch through handler[] as run() does, breaking on KeyPress before
dispatch so keypress() cannot recurse. The `&& !ran` term is dropped:
ran is always 0 on entry and nothing in the body can set it.
2026-10-19 09:10:49 +02:00
Arda Atci f6aaf3e786 preserve clients on old tags when renewing dwm
By default, when dwm is recompiled-restarted all clients will
lose it's current tag and collapse to first tag. This patch preserves
clients on old tags, however note that layout order is not preserved.
2026-10-19 08:01:16 +02:00
Anselm R. Garbe 17d39ee014 renamed config.h into config.def.h, config.h will be created if not present, this seems less annoying after all 2007-09-23 11:24:12 +02:00
Anselm R. Garbe 8d1810c85b introduced ISTILE, which can be easily extended with other layout functions to allow reuse of setmwfact() and zoom() 2007-09-22 21:55:19 +02:00
arg@suckless.org fe2775a15b made all stuff non-static - so you can choose wether to use dwm the static or the extern way when extending it 2007-09-17 16:42:37 +02:00
Anselm R. Garbe 0235a84ef2 micromizing dwm step 1 2007-09-15 22:25:27 +02:00
Anselm R. Garbe 2091200c95 new colorscheme (16-bit compliant) 2007-09-15 20:39:31 +02:00
Anselm R. Garbe 5d831eaa94 renamed config.default.h into config.h 2007-09-15 10:35:18 +02:00
arg@10ksloc.org 0f8249f262 removed config.h (stupid hg) 2006-08-02 16:52:02 +02:00
arg@10ksloc.org 95e8d12b71 made fullscreen apps working fine in floating mode (there is no sane way to make them work in tiled mode, thus I switch to floating mode if I run such kind of app), also fixed the xterm issue reported by Sander 2006-08-02 16:32:05 +02:00
arg@10ksloc.org 3af6434085 applied Sanders patches (numlock2) 2006-08-02 11:13:32 +02:00
arg@10ksloc.org ab7a11c0c7 renamed ARRANGE into DEFMODE 2006-08-01 16:39:20 +02:00
arg@10ksloc.org b38905b004 removed 5LOC 2006-08-01 16:20:03 +02:00
arg@10ksloc.org 7c2e3bb67d cleaned config.*h to prevent some confusion 2006-08-01 15:29:37 +02:00
arg@10ksloc.org 33b4821cd6 fixed config.h files 2006-08-01 14:03:29 +02:00
arg@10ksloc.org a73a882806 centralized/externalized configuration to config.h 2006-08-01 13:59:13 +02:00
Anselm R. Garbe 8b59083eb1 removed unnecessary crap 2006-07-13 01:30:55 +02:00
Anselm R. Garbe da2bbd371c before leaning things up 2006-07-13 01:04:38 +02:00
Anselm R. Garbe dfd84f9bf3 simplified several portions of code through replacing rect structs with x,y,h,w counterparts (much more readable) 2006-07-12 15:17:22 +02:00
Anselm R. Garbe b41c56ae6b new colors 2006-07-12 00:50:09 +02:00
Anselm R. Garbe 896f08d7d5 fixed several other stuff, coming closer to something useful 2006-07-11 23:46:39 +02:00
Anselm R. Garbe d6e0e6e987 several changes, new stuff 2006-07-11 18:53:41 +02:00
Anselm R. Garbe 586f66331d added bar event timer 2006-07-11 18:15:11 +02:00
Anselm R. Garbe 26e134b8a7 added gridsel to gridwm 2006-07-11 13:21:57 +02:00
Anselm R. Garbe 16c67f32d6 fixed several stuff (gridwm gets better and better) 2006-07-11 12:52:57 +02:00
Anselm R. Garbe 366d81e313 added key handling 2006-07-11 11:50:18 +02:00
Anselm R. Garbe 3a69c5173c implemented pipe_spawn 2006-07-11 11:10:05 +02:00
Anselm R. Garbe 439e15d09f added several other stuff 2006-07-10 22:16:48 +02:00
Anselm R. Garbe 39677ec766 several new changes, made gridmenu working 2006-07-10 19:46:24 +02:00
Anselm R. Garbe 8a34fa50f7 added new stuff 2006-07-10 18:35:39 +02:00