From 91fe87974e8c0d02b230fb1218905920154f5af5 Mon Sep 17 00:00:00 2001 From: Mitja Felicijan Date: Wed, 15 Apr 2026 16:12:52 +0200 Subject: Fix XError handling and Display Lock on Event handling --- switcher.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'switcher.c') 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; -- cgit v1.2.3