瀏覽代碼

Merge pull request #13 from Avimitin/main

fixed crashed when focus on hided windows
siduck76 3 年之前
父節點
當前提交
c87a416095
共有 1 個文件被更改,包括 4 次插入4 次删除
  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) {