kwo pushed a commit to branch master.

http://git.enlightenment.org/e16/e16.git/commit/?id=f4b11e47ec6373ef7ad2bbff415d0cc6629ab76a

commit f4b11e47ec6373ef7ad2bbff415d0cc6629ab76a
Author: Kim Woelders <k...@woelders.dk>
Date:   Sun May 3 18:52:53 2015 +0200

    Fix stacking when there is only one window.
    
    Thanks to Daniel Nobuto for tracking this one down and reporting it.
---
 src/desktops.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/desktops.c b/src/desktops.c
index 3a4f702..9a80c0c 100644
--- a/src/desktops.c
+++ b/src/desktops.c
@@ -1414,20 +1414,20 @@ DeskRestackSimple(Desk * dsk)
    eo = dsk->stack.latest;
 
    lst = EobjListStackGetForDesk(&num, dsk);
-   if (num < 2)
-      return;
-
    for (i = 0; i < num; i++)
       if (lst[i] == eo)
         break;
    if (i >= num)
-      return;
+      return;                  /* eo not in list (can this happen?) */
 
    eo->stacked = 1;
 
    if (EDebug(EDBUG_TYPE_STACKING))
       Eprintf("%s: %#x %s\n", __func__, EobjGetXwin(eo), EobjGetName(eo));
 
+   if (num < 2)
+      return;                  /* Only one window in stack - done */
+
    if (i < num - 1)
      {
        xwc.stack_mode = Above;

-- 


Reply via email to