From e6b14c1d399b324684532296d09c0b30e0636916 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Wed, 11 Jun 2008 08:12:38 +0200 Subject: [PATCH] [client] Fix border width setting Signed-off-by: Julien Danjou --- client.c | 10 ++++++---- client.h | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/client.c b/client.c index ca293ced..5374e773 100644 --- a/client.c +++ b/client.c @@ -934,14 +934,16 @@ luaA_client_focus_get(lua_State *L __attribute__ ((unused))) * \param width The border width. */ void -client_setborder(client_t *c, uint32_t width) +client_setborder(client_t *c, int width) { - if(c->noborder && width > 0) + uint32_t w = width; + + if((c->noborder && width > 0) || width == c->border || width < 0) return; c->border = width; xcb_configure_window(globalconf.connection, c->win, - XCB_CONFIG_WINDOW_BORDER_WIDTH, &width); + XCB_CONFIG_WINDOW_BORDER_WIDTH, &w); globalconf.screens[c->screen].need_arrange = true; } @@ -956,7 +958,7 @@ static int luaA_client_border_set(lua_State *L) { client_t **c = luaA_checkudata(L, 1, "client"); - uint32_t width = luaA_getopt_number(L, 2, "width", 0); + int width = luaA_getopt_number(L, 2, "width", (*c)->border); const char *colorstr = luaA_getopt_string(L, 2, "color", NULL); xcolor_t color; diff --git a/client.h b/client.h index 108e1a3d..e6ed99b9 100644 --- a/client.h +++ b/client.h @@ -42,7 +42,7 @@ void client_saveprops(client_t *); void client_kill(client_t *); void client_setfloating(client_t *, bool, layer_t); char * client_markup_parse(client_t *, const char *, ssize_t); -void client_setborder(client_t *, uint32_t); +void client_setborder(client_t *, int); int luaA_client_userdata_new(client_t *);