From c8b9b41a3ef40d6b9fa0d1ac192ecf17fd43d980 Mon Sep 17 00:00:00 2001 From: Martin Duquesnoy Date: Mon, 9 May 2011 22:15:14 +0200 Subject: [PATCH] Mouse: Add drag border for cfactor resizing --- src/client.c | 2 ++ src/config.c | 2 +- src/mouse.c | 20 ++++++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/client.c b/src/client.c index 4761c82..2ffbea0 100644 --- a/src/client.c +++ b/src/client.c @@ -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) diff --git a/src/config.c b/src/config.c index 87107cb..ac78c9f 100644 --- a/src/config.c +++ b/src/config.c @@ -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; diff --git a/src/mouse.c b/src/mouse.c index 6109422..8b30334 100644 --- a/src/mouse.c +++ b/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);