Kaynağa Gözat

fixed crashed when focus on hided windows

avimitin 3 yıl önce
ebeveyn
işleme
1796564ad2
1 değiştirilmiş dosya ile 4 ekleme ve 4 silme
  1. 4 4
      chadwm/dwm.c

+ 4 - 4
chadwm/dwm.c

@@ -1619,18 +1619,18 @@ void focusstack(const Arg *arg) {
   if (!selmon->sel || (selmon->sel->isfullscreen && lockfullscreen))
     return;
   if (arg->i > 0) {
-    for (c = selmon->sel->next; c && !ISVISIBLE(c); c = c->next)
+    for (c = selmon->sel->next; c && (!ISVISIBLE(c) || HIDDEN(c)); c = c->next)
       ;
     if (!c)
-      for (c = selmon->clients; c && !ISVISIBLE(c); c = c->next)
+      for (c = selmon->clients; c && (!ISVISIBLE(c) || HIDDEN(c)); c = c->next)
         ;
   } else {
     for (i = selmon->clients; i != selmon->sel; i = i->next)
-      if (ISVISIBLE(i))
+      if (ISVISIBLE(i) && !HIDDEN(i))
         c = i;
     if (!c)
       for (; i; i = i->next)
-        if (ISVISIBLE(i))
+        if (ISVISIBLE(i) && !HIDDEN(i))
           c = i;
   }
   if (c) {