diff options
author | Benji Dial <benji6283@gmail.com> | 2021-02-16 23:38:48 -0500 |
---|---|---|
committer | Benji Dial <benji6283@gmail.com> | 2021-02-16 23:38:48 -0500 |
commit | be05b9b23f988f934af2fd49976fd97c22dfc19a (patch) | |
tree | 19c5c80ccaeb8d83726a241709123986d5f7f918 | |
parent | 676cce6809a82a9e0251dc04bddb9804de54a736 (diff) | |
download | portland-os-be05b9b23f988f934af2fd49976fd97c22dfc19a.tar.gz |
making window manager not break when attempting to shuffle single window
-rw-r--r-- | src/kernel/window.c | 4 |
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; |