Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
Checking mergeability… Don’t worry, you can still create the pull request.
  • 1 commit
  • 1 file changed
  • 0 commit comments
  • 1 contributor
Showing with 11 additions and 0 deletions.
  1. +11 −0 monsterwm.c
View
11 monsterwm.c
@@ -167,6 +167,7 @@ static void sigchld(int sig);
static void stack(int x, int y, int w, int h, const Desktop *d);
static void tile(Desktop *d);
static void unmapnotify(XEvent *e);
+static void warpcursor(Client *c);
static Bool wintoclient(Window w, Client **c, Desktop **d);
static int xerror(Display *dis, XErrorEvent *ee);
static int xerrorstart(Display *dis, XErrorEvent *ee);
@@ -552,6 +553,7 @@ void focus(Client *c, Desktop *d) {
XChangeProperty(dis, root, netatoms[NET_ACTIVE], XA_WINDOW, 32,
PropModeReplace, (unsigned char *)&d->curr->win, 1);
+ warpcursor(d->curr);
XSync(dis, False);
}
@@ -1209,6 +1211,15 @@ Bool wintoclient(Window w, Client **c, Desktop **d) {
}
/**
+ * warps the mouse pointer to the center of the client c
+ */
+void warpcursor(Client *c) {
+ XWindowAttributes wa;
+ if (c && XGetWindowAttributes(dis, c->win, &wa))
+ XWarpPointer(dis, None, c->win, 0,0,0,0, wa.width/2, wa.height/2);
+}
+
+/**
* There's no way to check accesses to destroyed windows,
* thus those cases are ignored (especially on UnmapNotify's).
*/

No commit comments for this range

Something went wrong with that request. Please try again.