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