My build of dwm
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. void
  2. movestack(const Arg *arg) {
  3. Client *c = NULL, *p = NULL, *pc = NULL, *i;
  4. if(arg->i > 0) {
  5. /* find the client after selmon->sel */
  6. for(c = selmon->sel->next; c && (!ISVISIBLE(c) || c->isfloating); c = c->next);
  7. if(!c)
  8. for(c = selmon->clients; c && (!ISVISIBLE(c) || c->isfloating); c = c->next);
  9. }
  10. else {
  11. /* find the client before selmon->sel */
  12. for(i = selmon->clients; i != selmon->sel; i = i->next)
  13. if(ISVISIBLE(i) && !i->isfloating)
  14. c = i;
  15. if(!c)
  16. for(; i; i = i->next)
  17. if(ISVISIBLE(i) && !i->isfloating)
  18. c = i;
  19. }
  20. /* find the client before selmon->sel and c */
  21. for(i = selmon->clients; i && (!p || !pc); i = i->next) {
  22. if(i->next == selmon->sel)
  23. p = i;
  24. if(i->next == c)
  25. pc = i;
  26. }
  27. /* printf("%s", c->name); */
  28. /* swap c and selmon->sel selmon->clients in the selmon->clients list */
  29. if(c && c != selmon->sel) {
  30. Client *temp = selmon->sel->next==c?selmon->sel:selmon->sel->next;
  31. /* Client *temp = selmon->sel; */
  32. selmon->sel->next = c->next==selmon->sel?c:c->next;
  33. /* selmon->sel->next = c->next; */
  34. c->next = temp;
  35. if(p && p != c)
  36. p->next = c;
  37. if(pc && pc != selmon->sel)
  38. pc->next = selmon->sel;
  39. if(selmon->sel == selmon->clients)
  40. selmon->clients = c;
  41. else if(c == selmon->clients)
  42. selmon->clients = selmon->sel;
  43. arrange(selmon);
  44. }
  45. }