From 2c9a693ca97da72f469f22fd8e9502f7d6c18f31 Mon Sep 17 00:00:00 2001 From: Reginald Kennedy Date: Fri, 21 Mar 2014 00:51:32 +0800 Subject: [PATCH] Fix segfault when loading "layout" with non-zero parameters. This affected multi-region. stack() must be called after the region bars are created. Fix layout entry in man page. Fixes #38 --- spectrwm.1 | 2 +- spectrwm.c | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/spectrwm.1 b/spectrwm.1 index 54b8123..c4f7169 100644 --- a/spectrwm.1 +++ b/spectrwm.1 @@ -287,7 +287,7 @@ section below for a list of keyboard mapping files that have been provided for several keyboard layouts. .It Ic layout Select layout to use at start-of-day. Defined in the format -ws[idx]:master_grow:master_add:stack_inc:layout:always_raise:stack_mode, e.g. +ws[idx]:master_grow:master_add:stack_inc:always_raise:stack_mode, e.g. ws[2]:-4:0:1:0:horizontal sets worskspace 2 to the horizontal stack mode and shrinks the master area by 4 ticks and adds one window to the stack, while maintaining default floating window behavior. diff --git a/spectrwm.c b/spectrwm.c index 2a809ad..317d4b7 100644 --- a/spectrwm.c +++ b/spectrwm.c @@ -8311,32 +8311,26 @@ setlayout(const char *selector, const char *value, int flags) ws[ws_id].cur_layout->l_config(&ws[ws_id], mg >= 0 ? SWM_ARG_ID_MASTERGROW : SWM_ARG_ID_MASTERSHRINK); - stack(); } /* master add */ for (x = 0; x < abs(ma); x++) { ws[ws_id].cur_layout->l_config(&ws[ws_id], ma >= 0 ? SWM_ARG_ID_MASTERADD : SWM_ARG_ID_MASTERDEL); - stack(); } /* stack inc */ for (x = 0; x < abs(si); x++) { ws[ws_id].cur_layout->l_config(&ws[ws_id], si >= 0 ? SWM_ARG_ID_STACKINC : SWM_ARG_ID_STACKDEC); - stack(); } /* Apply flip */ if (f) { ws[ws_id].cur_layout->l_config(&ws[ws_id], SWM_ARG_ID_FLIPLAYOUT); - stack(); } } - focus_flush(); - return (0); } -- 1.7.10.4