making window manager not break when attempting to shuffle single window

This commit is contained in:
Benji Dial 2021-02-16 23:38:48 -05:00
parent 676cce6809
commit be05b9b23f

View file

@ -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;