Advertisement
Guest User

dwm-systrayfix-6.2.diff

a guest
Jul 21st, 2021
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.47 KB | None | 0 0
  1. diff --git a/chadwm/dwm.c b/chadwm/dwm.c
  2. index 50f473f..cb58347 100644
  3. --- a/chadwm/dwm.c
  4. +++ b/chadwm/dwm.c
  5. @@ -2738,22 +2738,24 @@ updatestatus(void)
  6. void
  7. updatesystrayicongeom(Client *i, int w, int h)
  8. {
  9. + int rh = bh - vertpadbar;
  10. if (i) {
  11. - i->h = bh;
  12. + i->h = rh;
  13. if (w == h)
  14. - i->w = bh;
  15. - else if (h == bh)
  16. + i->w = rh;
  17. + else if (h == rh)
  18. i->w = w;
  19. else
  20. - i->w = (int) ((float)bh * ((float)w / (float)h));
  21. + i->w = (int) ((float)rh * ((float)w / (float)h));
  22. + i->y = i->y + vertpadbar / 2;
  23. applysizehints(i, &(i->x), &(i->y), &(i->w), &(i->h), False);
  24. /* force icons into the systray dimensions if they don't want to */
  25. - if (i->h > bh) {
  26. + if (i->h > (rh)) {
  27. if (i->w == i->h)
  28. - i->w = bh;
  29. + i->w = rh;
  30. else
  31. - i->w = (int) ((float)bh * ((float)i->w / (float)i->h));
  32. - i->h = bh;
  33. + i->w = (int) ((float)rh * ((float)i->w / (float)i->h));
  34. + i->h = rh;
  35. }
  36. }
  37. }
  38. @@ -2793,7 +2795,7 @@ updatesystray(void)
  39. XWindowChanges wc;
  40. Client *i;
  41. Monitor *m = systraytomon(NULL);
  42. - unsigned int x = m->mx + m->mw;
  43. + unsigned int x = m->mx + m->mw - sp;
  44. unsigned int w = 1;
  45.  
  46. if (!showsystray)
  47. @@ -2802,7 +2804,7 @@ updatesystray(void)
  48. /* init systray */
  49. if (!(systray = (Systray *)calloc(1, sizeof(Systray))))
  50. die("fatal: could not malloc() %u bytes\n", sizeof(Systray));
  51. - systray->win = XCreateSimpleWindow(dpy, root, x, m->by, w, bh, 0, 0, scheme[SchemeSel][ColBg].pixel);
  52. + systray->win = XCreateSimpleWindow(dpy, root, x, m->by + vp, w, bh, 0, 0, scheme[SchemeSel][ColBg].pixel);
  53. wa.event_mask = ButtonPressMask | ExposureMask;
  54. wa.override_redirect = True;
  55. wa.background_pixel = scheme[SchemeNorm][ColBg].pixel;
  56. @@ -2830,15 +2832,15 @@ updatesystray(void)
  57. XMapRaised(dpy, i->win);
  58. w += systrayspacing;
  59. i->x = w;
  60. - XMoveResizeWindow(dpy, i->win, i->x, 0, i->w, i->h);
  61. + XMoveResizeWindow(dpy, i->win, i->x, vertpadbar / 2, i->w, i->h);
  62. w += i->w;
  63. if (i->mon != m)
  64. i->mon = m;
  65. }
  66. w = w ? w + systrayspacing : 1;
  67. x -= w;
  68. - XMoveResizeWindow(dpy, systray->win, x, m->by, w, bh);
  69. - wc.x = x; wc.y = m->by; wc.width = w; wc.height = bh;
  70. + XMoveResizeWindow(dpy, systray->win, x, m->by + vp, w, bh);
  71. + wc.x = x; wc.y = m->by + vp; wc.width = w; wc.height = bh;
  72. wc.stack_mode = Above; wc.sibling = m->barwin;
  73. XConfigureWindow(dpy, systray->win, CWX|CWY|CWWidth|CWHeight|CWSibling|CWStackMode, &wc);
  74. XMapWindow(dpy, systray->win);
  75.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement