From af77379009105536a2a314a1ebacd89ddbf4f57c Mon Sep 17 00:00:00 2001 From: Marco Peereboom Date: Thu, 1 Jul 2010 23:44:16 +0000 Subject: [PATCH] Bring border behavior back to normal default. Use knob when a knob... --- scrotwm.1 | 2 ++ scrotwm.c | 11 ++++++++--- scrotwm.conf | 1 + 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/scrotwm.1 b/scrotwm.1 index 07d9ab3..007aa09 100644 --- a/scrotwm.1 +++ b/scrotwm.1 @@ -145,6 +145,8 @@ Mod1 is generally the ALT key and Mod4 is the windows key on a PC. .It Cm focus_mode Using a value of follow_cursor will make the window manager focus the window under the mouse when switching workspaces and creating windows. +.It Cm disable_border +Remove border when bar is disabled and there is only one window on the screen. .It Cm program Ns Bq Ar p Define new action to spawn a program .Ar p . diff --git a/scrotwm.c b/scrotwm.c index 9f6d7ff..a8a4f31 100644 --- a/scrotwm.c +++ b/scrotwm.c @@ -206,6 +206,7 @@ char *clock_format = NULL; int title_name_enabled = 0; int title_class_enabled = 0; int focus_mode = SWM_FOCUS_DEFAULT; +int disable_border = 0; pid_t bar_pid; GC bar_gc; XGCValues bar_gcv; @@ -2113,7 +2114,7 @@ stack_master(struct workspace *ws, struct swm_geometry *g, int rot, int flip) win_g.y += last_h + 2; bzero(&wc, sizeof wc); - if (bar_enabled == 0 && winno == 1){ + if (disable_border && bar_enabled == 0 && winno == 1){ wc.border_width = 0; win_g.w += 2; win_g.h += 2; @@ -3514,8 +3515,8 @@ enum { SWM_S_BAR_DELAY, SWM_S_BAR_ENABLED, SWM_S_STACK_ENABLED, SWM_S_CLOCK_ENABLED, SWM_S_CLOCK_FORMAT, SWM_S_CYCLE_EMPTY, SWM_S_CYCLE_VISIBLE, SWM_S_SS_ENABLED, SWM_S_TERM_WIDTH, SWM_S_TITLE_CLASS_ENABLED, SWM_S_TITLE_NAME_ENABLED, - SWM_S_FOCUS_MODE, SWM_S_BAR_FONT, SWM_S_BAR_ACTION, SWM_S_SPAWN_TERM, - SWM_S_SS_APP, SWM_S_DIALOG_RATIO + SWM_S_FOCUS_MODE, SWM_S_DISABLE_BORDER, SWM_S_BAR_FONT, + SWM_S_BAR_ACTION, SWM_S_SPAWN_TERM, SWM_S_SS_APP, SWM_S_DIALOG_RATIO }; int @@ -3569,6 +3570,9 @@ setconfvalue(char *selector, char *value, int flags) else err(1, "focus_mode"); break; + case SWM_S_DISABLE_BORDER: + disable_border = atoi(value); + break; case SWM_S_BAR_FONT: free(bar_fonts[0]); if ((bar_fonts[0] = strdup(value)) == NULL) @@ -3661,6 +3665,7 @@ struct config_option configopt[] = { { "title_class_enabled", setconfvalue, SWM_S_TITLE_CLASS_ENABLED }, { "title_name_enabled", setconfvalue, SWM_S_TITLE_NAME_ENABLED }, { "focus_mode", setconfvalue, SWM_S_FOCUS_MODE }, + { "disable_border", setconfvalue, SWM_S_DISABLE_BORDER }, }; diff --git a/scrotwm.conf b/scrotwm.conf index 3eb5baf..1b79c7a 100644 --- a/scrotwm.conf +++ b/scrotwm.conf @@ -18,6 +18,7 @@ clock_enabled = 1 title_name_enabled = 0 title_class_enabled = 0 #focus_mode = default +#disable_border = 1 # spawn app # program[term] = xterm -- 1.7.10.4