summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/kernel/window.c4
1 files changed, 4 insertions, 0 deletions
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;