[wiki] [sites] wiki updated

From: <hg_AT_suckless.org>
Date: Sat, 11 Sep 2010 20:10:12 +0000 (UTC)

changeset: 624:933ef2ce4861
tag: tip
user: Moritz Wilhelmy <moritz plus suckless at wzff dot de>
date: Sat Sep 11 22:11:25 2010 +0200
files: dwm.suckless.org/patches/dwm-r1525-warp.diff dwm.suckless.org/patches/warp.md
description:
dwm: added warp patch from dwm-gtx


diff -r 399f823ce8de -r 933ef2ce4861 dwm.suckless.org/patches/dwm-r1525-warp.diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/dwm.suckless.org/patches/dwm-r1525-warp.diff Sat Sep 11 22:11:25 2010 +0200
_AT_@ -0,0 +1,99 @@
+diff -r c361034c5a1c dwm.c
+--- a/dwm.c Sat Sep 11 19:00:18 2010 +0000
++++ b/dwm.c Sat Sep 11 21:47:56 2010 +0200
+_AT_@ -236,6 +236,7 @@
+ static void updatetitle(Client *c);
+ static void updatewmhints(Client *c);
+ static void view(const Arg *arg);
++static void warp(const Client *c);
+ static Client *wintoclient(Window w);
+ static Monitor *wintomon(Window w);
+ static int xerror(Display *dpy, XErrorEvent *ee);
+_AT_@ -274,6 +275,7 @@
+ static DC dc;
+ static Monitor *mons = NULL, *selmon = NULL;
+ static Window root;
++static Bool warpmouse = True;
+
+ /* configuration, allows nested code to access above variables */
+ #include "config.h"
+_AT_@ -452,10 +454,12 @@
+ focus(c);
+ click = ClkClientWin;
+ }
++ warpmouse = False;
+ for(i = 0; i < LENGTH(buttons); i++)
+ if(click == buttons[i].click && buttons[i].func && buttons[i].button == ev->button
+ && CLEANMASK(buttons[i].mask) == CLEANMASK(ev->state))
+ buttons[i].func(click == ClkTagBar && buttons[i].arg.i == 0 ? &arg : &buttons[i].arg);
++ warpmouse = True;
+ }
+
+ void
+_AT_@ -854,6 +858,7 @@
+ unfocus(selmon->sel, True);
+ selmon = m;
+ focus(NULL);
++ warp(selmon->sel);
+ }
+
+ void
+_AT_@ -879,6 +884,7 @@
+ if(c) {
+ focus(c);
+ restack(selmon);
++ warp(c);
+ }
+ }
+
+_AT_@ -1150,6 +1156,7 @@
+ XMapWindow(dpy, c->win);
+ setclientstate(c, NormalState);
+ arrange(c->mon);
++ warp(c);
+ }
+
+ void
+_AT_@ -1609,6 +1616,7 @@
+ if(selmon->sel && arg->ui & TAGMASK) {
+ selmon->sel->tags = arg->ui & TAGMASK;
+ arrange(selmon);
++ warp(selmon->sel);
+ }
+ }
+
+_AT_@ -1689,6 +1697,7 @@
+ if(newtags) {
+ selmon->sel->tags = newtags;
+ arrange(selmon);
++ warp(selmon->sel);
+ }
+ }
+
+_AT_@ -1962,6 +1971,26 @@
+ arrange(selmon);
+ }
+
++void
++warp(const Client *c) {
++ Window dummy;
++ int x, y, di;
++ unsigned int dui;
++
++ if(!c || !warpmouse)
++ return;
++ XQueryPointer(dpy, root, &dummy, &dummy, &x, &y, &di, &di, &dui);
++ if(x > c->x && y > c->y && x < c->y + c->w && y < c->y + c->h)
++ return;
++ XSelectInput(dpy, root, SubstructureRedirectMask
++ & EnterWindowMask);
++ XWarpPointer(dpy, None, c->win, 0, 0, 0, 0,
++ c->w / 2, c->h / 2);
++ XSelectInput(dpy, root, SubstructureRedirectMask | SubstructureNotifyMask
++ | EnterWindowMask | LeaveWindowMask | StructureNotifyMask);
++}
++
++
+ Client *
+ wintoclient(Window w) {
+ Client *c;
diff -r 399f823ce8de -r 933ef2ce4861 dwm.suckless.org/patches/warp.md
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/dwm.suckless.org/patches/warp.md Sat Sep 11 22:11:25 2010 +0200
_AT_@ -0,0 +1,24 @@
+WARP
+====
+
+Description
+-----------
+
+This patch warps the mouse cursor each time another window gets focused to the
+middle of the window. It was shamelessly copied by me from dwm-gtx 5.2 without
+any modifications except those to make it work on newer vanilla-dwm.
+
+Download
+--------
+
+* [dwm-r1525-warp.diff](dwm-r1525-warp.diff) (2.3k) (20100911)
+
+Author
+------
+
+* Enno Boland (Gottox)
+
+Contributor
+-----------
+
+* Moritz Wilhelmy (n0nsense) <moritz plus dwm at wzff dot de>
Received on Sat Sep 11 2010 - 22:10:12 CEST

This archive was generated by hypermail 2.3.0 : Thu Sep 13 2012 - 19:31:28 CEST