Advertisement
Guest User

Untitled

a guest
Dec 11th, 2012
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.67 KB | None | 0 0
  1. diff -rup dwm-6.0-orig/dwm.c dwm-6.0/dwm.c
  2. --- dwm-6.0-orig/dwm.c 2011-12-19 22:22:25.000000000 +0100
  3. +++ dwm-6.0/dwm.c 2011-12-19 22:56:43.000000000 +0100
  4. @@ -180,7 +180,6 @@ static void drawbar(Monitor *m);
  5. static void drawbars(void);
  6. static void drawsquare(Bool filled, Bool empty, Bool invert, unsigned long col[ColLast]);
  7. static void drawtext(const char *text, unsigned long col[ColLast], Bool invert);
  8. -static void enternotify(XEvent *e);
  9. static void expose(XEvent *e);
  10. static void focus(Client *c);
  11. static void focusin(XEvent *e);
  12. @@ -266,7 +265,6 @@ static void (*handler[LASTEvent]) (XEven
  13. [ConfigureRequest] = configurerequest,
  14. [ConfigureNotify] = configurenotify,
  15. [DestroyNotify] = destroynotify,
  16. - [EnterNotify] = enternotify,
  17. [Expose] = expose,
  18. [FocusIn] = focusin,
  19. [KeyPress] = keypress,
  20. @@ -456,6 +454,8 @@ buttonpress(XEvent *e) {
  21. }
  22. else if((c = wintoclient(ev->window))) {
  23. focus(c);
  24. + restack(selmon);
  25. + XAllowEvents(dpy, ReplayPointer, CurrentTime);
  26. click = ClkClientWin;
  27. }
  28. for(i = 0; i < LENGTH(buttons); i++)
  29. @@ -813,25 +813,6 @@ drawtext(const char *text, unsigned long
  30. }
  31.  
  32. void
  33. -enternotify(XEvent *e) {
  34. - Client *c;
  35. - Monitor *m;
  36. - XCrossingEvent *ev = &e->xcrossing;
  37. -
  38. - if((ev->mode != NotifyNormal || ev->detail == NotifyInferior) && ev->window != root)
  39. - return;
  40. - c = wintoclient(ev->window);
  41. - m = c ? c->mon : wintomon(ev->window);
  42. - if(m != selmon) {
  43. - unfocus(selmon->sel, True);
  44. - selmon = m;
  45. - }
  46. - else if(!c || c == selmon->sel)
  47. - return;
  48. - focus(c);
  49. -}
  50. -
  51. -void
  52. expose(XEvent *e) {
  53. Monitor *m;
  54. XExposeEvent *ev = &e->xexpose;
  55. @@ -994,18 +975,16 @@ grabbuttons(Client *c, Bool focused) {
  56. unsigned int i, j;
  57. unsigned int modifiers[] = { 0, LockMask, numlockmask, numlockmask|LockMask };
  58. XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
  59. - if(focused) {
  60. - for(i = 0; i < LENGTH(buttons); i++)
  61. - if(buttons[i].click == ClkClientWin)
  62. - for(j = 0; j < LENGTH(modifiers); j++)
  63. - XGrabButton(dpy, buttons[i].button,
  64. - buttons[i].mask | modifiers[j],
  65. - c->win, False, BUTTONMASK,
  66. - GrabModeAsync, GrabModeSync, None, None);
  67. - }
  68. - else
  69. + if(!focused)
  70. XGrabButton(dpy, AnyButton, AnyModifier, c->win, False,
  71. - BUTTONMASK, GrabModeAsync, GrabModeSync, None, None);
  72. + BUTTONMASK, GrabModeSync, GrabModeSync, None, None);
  73. + for(i = 0; i < LENGTH(buttons); i++)
  74. + if(buttons[i].click == ClkClientWin)
  75. + for(j = 0; j < LENGTH(modifiers); j++)
  76. + XGrabButton(dpy, buttons[i].button,
  77. + buttons[i].mask | modifiers[j],
  78. + c->win, False, BUTTONMASK,
  79. + GrabModeAsync, GrabModeSync, None, None);
  80. }
  81. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement