client_adjust(loc.client);
if (X.mode == M_RESIZE && Focused == loc.client)
{
- warp_mouse(loc.client);
+ mouse_tocorner(loc.client);
}
}
else
void client_readprops(Client* c);
void client_shade(Client* c);
void client_setshade(Client* c, int shade);
-void client_warpmouse(Client* c);
/* mouse.c */
void mouse_down(XButtonEvent* ev, Location* loc);
void mouse_up(XButtonEvent* ev, Location* loc);
void mouse_drag(XMotionEvent* ev, Location* loc);
+void mouse_tocorner(Client* c);
+void mouse_totitle(Client* c);
/* tile.c */
void monocled_add(Monitor* mon, Column* col, Client* c);
void xfree(void* p);
Atom atom(char* str);
void sendmsg(Window win, Atom proto, Atom type);
-void warp_mouse(Client* c);
void get_mouse(int* ptrx, int* ptry);
XUnmapWindow(X.disp, c->win);
}
}
-
-void client_warpmouse(Client* c)
-{
- (void)c;
-// XWarpPointer(X.disp, None, X.root, 0, 0, 0, 0, (c->x + c->w/2), c->y + (MIN_HEIGHT/2));
-}
{
Monitor* mon = pickmon();
add_client(mon, c, PtrX);
- client_warpmouse(c);
+ mouse_totitle(c);
}
void mons_delclient(Location* loc)
{
stacked_addheight(loc->monitor, loc->column, loc->client, hdiff);
}
+ mouse_totitle(loc->client);
}
void mons_activate(Window win)
if ((ev->button == Button1) && (ev->y > MIN_HEIGHT))
{
X.mode = M_RESIZE;
- warp_mouse(loc->client);
+ mouse_tocorner(loc->client);
}
else if (ev->button == Button2)
{
float_drag(ev, loc);
}
}
+
+void mouse_tocorner(Client* c)
+{
+ int new_w = c->w - BORDER_WIDTH/2;
+ int new_h = c->h - BORDER_WIDTH/2;
+ XWarpPointer(X.disp, None, c->frame, 0, 0, 0, 0, new_w, new_h);
+ X.last_x = c->x + new_w;
+ X.last_y = c->y + new_h;
+}
+
+void mouse_totitle(Client* c)
+{
+ XWarpPointer(X.disp, None, X.root, 0, 0, 0, 0, (c->x + c->w/2), c->y + (MIN_HEIGHT/2));
+}
+
+
client_setshade(prev, (prev->h <= MIN_HEIGHT));
client_setshade(c, (c->h <= MIN_HEIGHT));
client_adjust(prev);
- client_warpmouse(c);
+ mouse_totitle(c);
client_adjust(c);
}
}
XSync(X.disp, False);
}
-void warp_mouse(Client* c)
-{
- int new_w = c->w - BORDER_WIDTH/2;
- int new_h = c->h - BORDER_WIDTH/2;
- XWarpPointer(X.disp, None, c->frame, 0, 0, 0, 0, new_w, new_h);
- X.last_x = c->x + new_w;
- X.last_y = c->y + new_h;
-}
-
void get_mouse(int* ptrx, int* ptry)
{
Window root = 0, child = 0;