diff options
Diffstat (limited to 'switcher.c')
| -rw-r--r-- | switcher.c | 4 |
1 files changed, 2 insertions, 2 deletions
| @@ -109,7 +109,7 @@ void cycle_active_window(const Arg *arg) { | |||
| 109 | // We grab it on the root window. | 109 | // We grab it on the root window. |
| 110 | XGrabKeyboard(wm.dpy, wm.root, True, GrabModeAsync, GrabModeAsync, CurrentTime); | 110 | XGrabKeyboard(wm.dpy, wm.root, True, GrabModeAsync, GrabModeAsync, CurrentTime); |
| 111 | 111 | ||
| 112 | // Count clients | 112 | // Count clients - allocate extra to handle new windows mapping during this process |
| 113 | int count = 0; | 113 | int count = 0; |
| 114 | Client *c = wm.clients; | 114 | Client *c = wm.clients; |
| 115 | while (c) { | 115 | while (c) { |
| @@ -122,7 +122,7 @@ void cycle_active_window(const Arg *arg) { | |||
| 122 | return; | 122 | return; |
| 123 | } | 123 | } |
| 124 | 124 | ||
| 125 | wm.cycle_clients = malloc(sizeof(Window) * count); | 125 | wm.cycle_clients = malloc(sizeof(Window) * (count + 10)); |
| 126 | wm.cycle_count = 0; | 126 | wm.cycle_count = 0; |
| 127 | wm.active_cycle_index = 0; | 127 | wm.active_cycle_index = 0; |
| 128 | 128 | ||
