SaraF

dwm-5.8.2-nosticky.diff

Aug 18th, 2011
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 3.77 KB | None | 0 0
  1. --- a/config.def.h 2010-06-04 06:39:15.000000000 -0400
  2. +++ b/config.def.h 2011-08-18 11:02:24.919696686 -0400
  3. @@ -17,9 +17,9 @@
  4.  static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
  5.  
  6.  static const Rule rules[] = {
  7. -   /* class      instance    title       tags mask     isfloating   monitor */
  8. -   { "Gimp",     NULL,       NULL,       0,            True,        -1 },
  9. -   { "Firefox",  NULL,       NULL,       1 << 8,       False,       -1 },
  10. +   /* class      instance    title       tags mask     flags        monitor */
  11. +   { "Gimp",     NULL,       NULL,       0,            Floating,    -1 },
  12. +   { "Firefox",  NULL,       NULL,       1 << 8,       Normal,      -1 },
  13.  };
  14.  
  15.  /* layout(s) */
  16. --- a/dwm.c 2010-06-04 06:39:15.000000000 -0400
  17. +++ b/dwm.c 2011-08-18 10:54:30.903031123 -0400
  18. @@ -62,6 +62,8 @@
  19.  enum { WMProtocols, WMDelete, WMState, WMLast };        /* default atoms */
  20.  enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle,
  21.         ClkClientWin, ClkRootWin, ClkLast };             /* clicks */
  22. +enum { Normal, Floating, NoFocus=2 };                   /* Client flags for
  23. +Rules */
  24.  
  25.  typedef union {
  26.     int i;
  27. @@ -88,7 +90,7 @@
  28.     int basew, baseh, incw, inch, maxw, maxh, minw, minh;
  29.     int bw, oldbw;
  30.     unsigned int tags;
  31. -   Bool isfixed, isfloating, isurgent, oldstate;
  32. +    Bool isfixed, isfloating, isurgent, oldstate, nofocus;
  33.     Client *next;
  34.     Client *snext;
  35.     Monitor *mon;
  36. @@ -147,7 +149,7 @@
  37.     const char *instance;
  38.     const char *title;
  39.     unsigned int tags;
  40. -   Bool isfloating;
  41. +    unsigned int flags;
  42.     int monitor;
  43.  } Rule;
  44.  
  45. @@ -301,7 +303,8 @@
  46.             && (!r->class || strstr(class, r->class))
  47.             && (!r->instance || strstr(instance, r->instance)))
  48.             {
  49. -               c->isfloating = r->isfloating;
  50. +                c->isfloating = (r->flags&Floating)!=0;
  51. +                c->nofocus = (r->flags&NoFocus)!=0;
  52.                 c->tags |= r->tags;
  53.                 for(m = mons; m && m->num != r->monitor; m = m->next);
  54.                 if(m)
  55. @@ -689,7 +692,8 @@
  56.     Client *c;
  57.  
  58.     for(c = m->clients; c; c = c->next) {
  59. -       occ |= c->tags;
  60. +        if(c->tags!=TAGMASK)
  61. +            occ |= c->tags;
  62.         if(c->isurgent)
  63.             urg |= c->tags;
  64.     }
  65. @@ -698,8 +702,8 @@
  66.         dc.w = TEXTW(tags[i]);
  67.         col = m->tagset[m->seltags] & 1 << i ? dc.sel : dc.norm;
  68.         drawtext(tags[i], col, urg & 1 << i);
  69. -       drawsquare(m == selmon && selmon->sel && selmon->sel->tags & 1 << i,
  70. -                  occ & 1 << i, urg & 1 << i, col);
  71. +        drawsquare(m == selmon && selmon->sel && m->tagset[m->seltags] & selmon->sel->tags & 1 << i,
  72. +                   occ & 1 << i, urg & 1 << i, col);
  73.         dc.x += dc.w;
  74.     }
  75.     dc.w = blw = TEXTW(m->ltsymbol);
  76. @@ -817,6 +821,7 @@
  77.  
  78.  void
  79.  focus(Client *c) {
  80. +    Client *inc=c;
  81.     if(!c || !ISVISIBLE(c))
  82.         for(c = selmon->stack; c && !ISVISIBLE(c); c = c->snext);
  83.     /* was if(selmon->sel) */
  84. @@ -829,6 +834,9 @@
  85.             clearurgent(c);
  86.         detachstack(c);
  87.         attachstack(c);
  88. +    }
  89. +    while( !inc && c && c->nofocus ) c=c->next;
  90. +    if(c) {
  91.         grabbuttons(c, True);
  92.         XSetWindowBorder(dpy, c->win, dc.sel[ColBorder]);
  93.         XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime);
  94. @@ -867,17 +875,17 @@
  95.     if(!selmon->sel)
  96.         return;
  97.     if(arg->i > 0) {
  98. -       for(c = selmon->sel->next; c && !ISVISIBLE(c); c = c->next);
  99. +        for(c = selmon->sel->next; c && !ISVISIBLE(c) && c->nofocus; c = c->next);
  100.         if(!c)
  101. -           for(c = selmon->clients; c && !ISVISIBLE(c); c = c->next);
  102. +            for(c = selmon->clients; c && !ISVISIBLE(c) && c->nofocus; c = c->next);
  103.     }
  104.     else {
  105.         for(i = selmon->clients; i != selmon->sel; i = i->next)
  106. -           if(ISVISIBLE(i))
  107. +            if(ISVISIBLE(i) && i->nofocus)
  108.                 c = i;
  109.         if(!c)
  110.             for(; i; i = i->next)
  111. -               if(ISVISIBLE(i))
  112. +                if(ISVISIBLE(i) && i->nofocus)
  113.                     c = i;
  114.     }
  115.     if(c) {
Advertisement
Add Comment
Please, Sign In to add comment