From 5a6f9473f2ebd8a85db681432d2af89a6b6f9e60 Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Sat, 6 Sep 2014 15:43:55 +0200 Subject: [PATCH] Add 'maximize_hide_bar' to also hide the bar when maximing a window. --- spectrwm.1 | 5 +++++ spectrwm.c | 8 +++++++- spectrwm.conf | 1 + 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/spectrwm.1 b/spectrwm.1 index 837b5db..048b589 100644 --- a/spectrwm.1 +++ b/spectrwm.1 @@ -315,6 +315,11 @@ and changes to layout. .It Ar manual Set window focus on window interaction only. .El +.It Ic maximize_hide_bar +When set to 1, +.Ic maximize_toggle +will also hide/restore the bar visibility of the affected workspace. +Defaults to 0. .It Ic java_workaround Workaround a Java GUI rendering issue on non-reparenting window managers by impersonating the LG3D window manager, written by Sun. diff --git a/spectrwm.c b/spectrwm.c index 680f5c1..c5f7d1c 100644 --- a/spectrwm.c +++ b/spectrwm.c @@ -404,6 +404,7 @@ char *bar_format = NULL; bool stack_enabled = true; bool clock_enabled = true; bool iconic_enabled = false; +bool maximize_hide_bar = false; bool urgent_enabled = false; bool urgent_collapse = false; char *clock_format = NULL; @@ -4654,7 +4655,7 @@ update_floater(struct ws_win *win) win->g = r->g; - if (bar_enabled && ws->bar_enabled) { + if (bar_enabled && ws->bar_enabled && !maximize_hide_bar) { if (!bar_at_bottom) Y(win) += bar_height; HEIGHT(win) -= bar_height; @@ -8036,6 +8037,7 @@ enum { SWM_S_FOCUS_MODE, SWM_S_ICONIC_ENABLED, SWM_S_JAVA_WORKAROUND, + SWM_S_MAXIMIZE_HIDE_BAR, SWM_S_REGION_PADDING, SWM_S_SPAWN_ORDER, SWM_S_SPAWN_TERM, @@ -8209,6 +8211,9 @@ setconfvalue(const char *selector, const char *value, int flags) case SWM_S_JAVA_WORKAROUND: java_workaround = (atoi(value) != 0); break; + case SWM_S_MAXIMIZE_HIDE_BAR: + maximize_hide_bar = atoi(value); + break; case SWM_S_REGION_PADDING: region_padding = atoi(value); if (region_padding < 0) @@ -8624,6 +8629,7 @@ struct config_option configopt[] = { { "focus_mode", setconfvalue, SWM_S_FOCUS_MODE }, { "iconic_enabled", setconfvalue, SWM_S_ICONIC_ENABLED }, { "java_workaround", setconfvalue, SWM_S_JAVA_WORKAROUND }, + { "maximize_hide_bar", setconfvalue, SWM_S_MAXIMIZE_HIDE_BAR }, { "keyboard_mapping", setkeymapping, 0 }, { "layout", setlayout, 0 }, { "modkey", setconfmodkey, 0 }, diff --git a/spectrwm.conf b/spectrwm.conf index a15898f..36c8fc8 100644 --- a/spectrwm.conf +++ b/spectrwm.conf @@ -43,6 +43,7 @@ # clock_enabled = 1 # clock_format = %a %b %d %R %Z %Y # iconic_enabled = 0 +# maximize_hide_bar = 0 # window_class_enabled = 0 # window_instance_enabled = 0 # window_name_enabled = 0 -- 2.39.2