Mouse: Add drag border for cfactor resizing
This commit is contained in:
parent
9d44177f20
commit
c8b9b41a3e
@ -932,8 +932,10 @@ client_manage(Window w, XWindowAttributes *wa, Bool ar)
|
||||
|
||||
ewmh_get_client_list();
|
||||
client_update_attributes(c);
|
||||
|
||||
if(c->tag == (uint)seltag[selscreen])
|
||||
client_map(c);
|
||||
|
||||
ewmh_manage_window_type(c);
|
||||
|
||||
if(ar)
|
||||
|
||||
@ -531,7 +531,7 @@ conf_tag_section(void)
|
||||
fetch_opt_first(def_tag, "1", "nmaster").num,
|
||||
False, fetch_opt_first(def_tag, "False", "resizehint").bool,
|
||||
False, False, False, bar_pos, bar_pos,
|
||||
layout_name_to_struct(conf.layout, fetch_opt_first(def_tag, "title_right", "layout").str, conf.nlayout, layout_list),
|
||||
layout_name_to_struct(conf.layout, fetch_opt_first(def_tag, "tile_right", "layout").str, conf.nlayout, layout_list),
|
||||
0, NULL, 0, False };
|
||||
|
||||
conf.default_tag = default_tag;
|
||||
|
||||
20
src/mouse.c
20
src/mouse.c
@ -46,6 +46,17 @@ mouse_dragborder(XRectangle geo, GC g)
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
mouse_cfactor_border(Client *c, int f[4], GC g)
|
||||
{
|
||||
int e;
|
||||
|
||||
mouse_dragborder(cfactor_geo(c->geo, f, &e), g);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/** Move a client in tile grid with the mouse
|
||||
*\param c Client double pointer
|
||||
*/
|
||||
@ -238,6 +249,8 @@ mouse_resize(Client *c)
|
||||
XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, 0, c->geo.height);
|
||||
mouse_dragborder(c->geo, gci);
|
||||
}
|
||||
else
|
||||
mouse_cfactor_border(c, f, gci);
|
||||
|
||||
do
|
||||
{
|
||||
@ -248,6 +261,8 @@ mouse_resize(Client *c)
|
||||
/* To resize client in tile mode with cfactor */
|
||||
if(c->flags & TileFlag)
|
||||
{
|
||||
mouse_cfactor_border(c, f, gci);
|
||||
|
||||
if(omx >= c->frame_geo.x + (c->frame_geo.width / 2))
|
||||
f[Right] = ev.xmotion.x_root - omx;
|
||||
else
|
||||
@ -257,6 +272,8 @@ mouse_resize(Client *c)
|
||||
f[Bottom] = ev.xmotion.y_root - omy;
|
||||
else
|
||||
f[Top] = omy - ev.xmotion.y_root;
|
||||
|
||||
mouse_cfactor_border(c, f, gci);
|
||||
}
|
||||
/* Free mode */
|
||||
else if(!(c->flags & TileFlag))
|
||||
@ -295,7 +312,10 @@ mouse_resize(Client *c)
|
||||
XUngrabServer(dpy);
|
||||
}
|
||||
else
|
||||
{
|
||||
mouse_cfactor_border(c, f, gci);
|
||||
cfactor_multi_set(c, f);
|
||||
}
|
||||
|
||||
client_update_attributes(c);
|
||||
XUngrabPointer(dpy, CurrentTime);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user