From be05b9b23f988f934af2fd49976fd97c22dfc19a Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Tue, 16 Feb 2021 23:38:48 -0500 Subject: making window manager not break when attempting to shuffle single window --- src/kernel/window.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/kernel/window.c b/src/kernel/window.c index ac03fc9..80780d4 100644 --- a/src/kernel/window.c +++ b/src/kernel/window.c @@ -265,6 +265,8 @@ void on_action(struct window_action packet) { struct window *old_top, *old_bottom; switch (i) { case WM_SHUFFLE_UP: + if (!top_window->below) + break; old_top = top_window; old_bottom = bottom_window; top_window = old_top->below; @@ -276,6 +278,8 @@ void on_action(struct window_action packet) { paint_and_above(bottom_window->above); break; case WM_SHUFFLE_DOWN: + if (!top_window->below) + break; old_top = top_window; old_bottom = bottom_window; bottom_window = old_bottom->above; -- cgit v1.2.3