summaryrefslogtreecommitdiff
path: root/switcher.c
diff options
context:
space:
mode:
authorMitja Felicijan <mitja.felicijan@gmail.com>2026-04-15 16:12:52 +0200
committerMitja Felicijan <mitja.felicijan@gmail.com>2026-04-15 16:12:52 +0200
commit91fe87974e8c0d02b230fb1218905920154f5af5 (patch)
treebe8b95a24da5fe23edc2a572a5000249a2f7d703 /switcher.c
parentc7bdedb36bde9e26cc0ce4e58a9ce7e425f19ac2 (diff)
downloadglitch-91fe87974e8c0d02b230fb1218905920154f5af5.tar.gz
Fix XError handling and Display Lock on Event handling
Diffstat (limited to 'switcher.c')
-rw-r--r--switcher.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/switcher.c b/switcher.c
index 949bcef..cde8c90 100644
--- a/switcher.c
+++ b/switcher.c
@@ -109,7 +109,7 @@ void cycle_active_window(const Arg *arg) {
// We grab it on the root window.
XGrabKeyboard(wm.dpy, wm.root, True, GrabModeAsync, GrabModeAsync, CurrentTime);
- // Count clients
+ // Count clients - allocate extra to handle new windows mapping during this process
int count = 0;
Client *c = wm.clients;
while (c) {
@@ -122,7 +122,7 @@ void cycle_active_window(const Arg *arg) {
return;
}
- wm.cycle_clients = malloc(sizeof(Window) * count);
+ wm.cycle_clients = malloc(sizeof(Window) * (count + 10));
wm.cycle_count = 0;
wm.active_cycle_index = 0;