From 12fc19d1b0b12f9a6b1ae5f6f318d54fefcf87ea Mon Sep 17 00:00:00 2001 From: Martin Duquesnoy Date: Wed, 22 Apr 2009 10:39:39 +0200 Subject: [PATCH] Conf: Add option resize_transparent in misc section for light client resize. --- src/config.c | 7 ++++--- src/config_struct.h | 7 ++++--- src/mouse.c | 7 ++++++- src/structs.h | 1 + 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/config.c b/src/config.c index b9b9d95..054b413 100644 --- a/src/config.c +++ b/src/config.c @@ -125,9 +125,10 @@ conf_alias_section(cfg_t *cfg_a) void conf_misc_section(cfg_t *cfg_m) { - conf.font = alias_to_str(_strdup(cfg_getstr(cfg_m, "font"))); - conf.raisefocus = cfg_getbool(cfg_m, "raisefocus"); - conf.raiseswitch = cfg_getbool(cfg_m, "raiseswitch"); + conf.font = alias_to_str(_strdup(cfg_getstr(cfg_m, "font"))); + conf.raisefocus = cfg_getbool(cfg_m, "raisefocus"); + conf.raiseswitch = cfg_getbool(cfg_m, "raiseswitch"); + conf.resize_transparent = cfg_getbool(cfg_m, "resize_transparent"); return; } diff --git a/src/config_struct.h b/src/config_struct.h index 87f0082..04a6719 100644 --- a/src/config_struct.h +++ b/src/config_struct.h @@ -39,9 +39,10 @@ char final_path[128]; cfg_opt_t misc_opts[] = { - CFG_STR("font", "sans-9", CFGF_NONE), - CFG_BOOL("raisefocus", cfg_false, CFGF_NONE), - CFG_BOOL("raiseswitch", cfg_true, CFGF_NONE), + CFG_STR("font", "sans-9", CFGF_NONE), + CFG_BOOL("raisefocus", cfg_false, CFGF_NONE), + CFG_BOOL("raiseswitch", cfg_true, CFGF_NONE), + CFG_BOOL("resize_transparent", cfg_false, CFGF_NONE), CFG_END() }; diff --git a/src/mouse.c b/src/mouse.c index c79848f..ae9fce6 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -169,7 +169,8 @@ mouse_resize(Client *c) geo.width = ((ev.xmotion.x - ocx < 1) ? 1 : ev.xmotion.x - ocx); geo.height = ((ev.xmotion.y - ocy < 1) ? 1 : ev.xmotion.y - ocy); - client_moveresize(c, geo, True); + if(!conf.resize_transparent) + client_moveresize(c, geo, True); XSync(dpy, False); } @@ -181,9 +182,13 @@ mouse_resize(Client *c) while(ev.type != ButtonRelease); if(!c->tile) + { XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->geo.width + conf.client.borderheight, c->geo.height); + client_moveresize(c, geo, True); + } else tags[selscreen][seltag[selscreen]].layout.func(c->screen); + XUngrabPointer(dpy, CurrentTime); diff --git a/src/structs.h b/src/structs.h index 830f31f..310383f 100644 --- a/src/structs.h +++ b/src/structs.h @@ -274,6 +274,7 @@ typedef struct char *font; Bool raisefocus; Bool raiseswitch; + Bool resize_transparent; struct { /*