From 9919ba2d4b6bf63cc5d7a48be4518ea180db4d3d Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Tue, 18 Sep 2007 23:36:52 +0200 Subject: [PATCH] add uicb_setborder to change conf borderpx while running --- TODO | 3 --- client.c | 21 +++++++++++++++++++++ client.h | 1 + config.c | 1 + 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/TODO b/TODO index 0ce25a671..1d668b470 100644 --- a/TODO +++ b/TODO @@ -1,6 +1,3 @@ -For v1.0: -- Add uicb for sel->border++-- and awesomeconf->border++-- - For future: - Move windows from one place to another with mouse in tiled layout - draw _NET_WM_ICON diff --git a/client.c b/client.c index 11954d78a..ff7763df9 100644 --- a/client.c +++ b/client.c @@ -700,3 +700,24 @@ uicb_settrans(Display *disp __attribute__ ((unused)), else setclienttrans(sel, delta); } + + +/** Set borrder size + * \param disp Display ref + * \param drawcontext Drawcontext ref + * \param awesomeconf awesome config + * \param arg X, +X or -X + */ +void +uicb_setborder(Display *disp __attribute__ ((unused)), + DC *drawcontext __attribute__ ((unused)), + awesome_config *awesomeconf, + const char *arg) +{ + if(!arg) + return; + + if((awesomeconf->borderpx = (int) compute_new_value_from_arg(arg, (double) awesomeconf->borderpx)) < 0) + awesomeconf->borderpx = 0; +} + diff --git a/client.h b/client.h index fba651320..29e8005f8 100644 --- a/client.h +++ b/client.h @@ -71,5 +71,6 @@ void set_shape(Client *); void uicb_killclient(Display *, DC *, awesome_config *, const char *); /* kill client */ void uicb_moveresize(Display *, DC *, awesome_config *, const char *); /* move and resize window */ void uicb_settrans(Display *, DC *, awesome_config *, const char *); +void uicb_setborder(Display *, DC *, awesome_config *, const char *); #endif diff --git a/config.c b/config.c index 4d4a87209..d37fde93b 100644 --- a/config.c +++ b/config.c @@ -85,6 +85,7 @@ static const NameFuncLink KeyfuncList[] = { {"killclient", uicb_killclient}, {"moveresize", uicb_moveresize}, {"settrans", uicb_settrans}, + {"setborder", uicb_setborder}, /* tag.c */ {"tag", uicb_tag}, {"togglefloating", uicb_togglefloating},