From 90bca5139085e7e43a5c3d71b62984608bc7829e Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Thu, 20 Aug 2009 10:37:21 +0200 Subject: [PATCH] client: disallow client border change when fullscreen Signed-off-by: Julien Danjou --- client.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/client.c b/client.c index 1fd1074d0..c6070d361 100644 --- a/client.c +++ b/client.c @@ -936,13 +936,11 @@ client_set_fullscreen(lua_State *L, int cidx, bool s) { area_t geometry; - /* Make sure the current geometry is stored without titlebar. */ - if(s) - titlebar_ban(c->titlebar); - /* become fullscreen! */ - if((c->fullscreen = s)) + if(s) { + /* Make sure the current geometry is stored without titlebar. */ + titlebar_ban(c->titlebar); /* remove any max state */ client_set_maximized_horizontal(L, cidx, false); client_set_maximized_vertical(L, cidx, false); @@ -955,10 +953,12 @@ client_set_fullscreen(lua_State *L, int cidx, bool s) c->geometries.fullscreen = c->geometry; c->border_width_fs = c->border_width; client_set_border_width(L, cidx, 0); + c->fullscreen = true; } else { geometry = c->geometries.fullscreen; + c->fullscreen = false; client_set_border_width(L, cidx, c->border_width_fs); } client_resize(c, geometry, false); @@ -1344,6 +1344,10 @@ client_set_border_width(lua_State *L, int cidx, int width) if(width == c->border_width || width < 0) return; + /* disallow change of border width if the client is fullscreen */ + if(c->fullscreen) + return; + /* Update geometry with the new border. */ c->geometry.width -= 2 * c->border_width; c->geometry.height -= 2 * c->border_width;