[client] Fix border width setting

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-06-11 08:12:38 +02:00
parent 0ccfea330a
commit e6b14c1d39
2 changed files with 7 additions and 5 deletions

View File

@ -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;

View File

@ -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 *);