Index: fvwm/style.c =================================================================== --- fvwm/style.c (revision 5) +++ fvwm/style.c (revision 6) @@ -2055,6 +2055,12 @@ { rest = style_parse_button_style(ps, rest, on); } + else if (StrEquals(token, "BORDERUNDERTITLE")) + { + S_SET_HAS_BORDER_UNDER_TITLE(SCF(*ps), on); + S_SET_HAS_BORDER_UNDER_TITLE(SCM(*ps), 1); + S_SET_HAS_BORDER_UNDER_TITLE(SCC(*ps), 1); + } else if (StrEquals(token, "BorderWidth")) { if (GetIntegerArguments(rest, &rest, val, 1)) @@ -4396,6 +4402,11 @@ { flags->do_update_rotated_title = 1; } + + if (S_HAS_BORDER_UNDER_TITLE(SCC(*ret_style))) + { + flags->do_redecorate = True; + } /* has_mwm_border * has_mwm_buttons */ Index: fvwm/style.h =================================================================== --- fvwm/style.h (revision 5) +++ fvwm/style.h (revision 6) @@ -323,6 +323,10 @@ ((c).s.use_title_decor_rotation) #define S_SET_USE_TITLE_DECOR_ROTATION(c,x) \ ((c).s.use_title_decor_rotation = !!(x)) +#define S_HAS_BORDER_UNDER_TITLE(c) \ + ((c).s.has_border_under_title) +#define S_SET_HAS_BORDER_UNDER_TITLE(c,x) \ + ((c).s.has_border_under_title = !!(x)) #define S_DO_EWMH_MINI_ICON_OVERRIDE(c) \ ((c).s.do_ewmh_mini_icon_override) #define S_SET_DO_EWMH_MINI_ICON_OVERRIDE(c,x) \ Index: fvwm/geometry.c =================================================================== --- fvwm/geometry.c (revision 5) +++ fvwm/geometry.c (revision 6) @@ -46,6 +46,9 @@ /* ---------------------------- forward declarations ----------------------- */ +static void __get_window_borders( + const FvwmWindow *fw, size_borders *borders, Bool is_shaded); + /* ---------------------------- local variables ---------------------------- */ /* ---------------------------- exported variables (globals) --------------- */ @@ -342,7 +345,8 @@ int big_height = big_g->height; int d; - get_window_borders(fw, &b); + __get_window_borders(fw, &b, 1); + *small_g = *big_g; d = 0; switch (SHADED_DIR(fw)) @@ -468,23 +472,38 @@ void get_window_borders( const FvwmWindow *fw, size_borders *borders) { + __get_window_borders(fw, borders, 0); +} + +static void __get_window_borders( + const FvwmWindow *fw, size_borders *borders, Bool is_shaded) +{ + int title_thickness; + borders->top_left.width = fw->boundary_width; borders->bottom_right.width = fw->boundary_width; borders->top_left.height = fw->boundary_width; borders->bottom_right.height = fw->boundary_width; + + title_thickness = fw->title_thickness; + if (HAS_TITLE(fw) && HAS_BORDER_UNDER_TITLE(fw) && !is_shaded) + { + title_thickness += fw->boundary_width; + } + switch (GET_TITLE_DIR(fw)) { case DIR_N: - borders->top_left.height += fw->title_thickness; + borders->top_left.height += title_thickness; break; case DIR_S: - borders->bottom_right.height += fw->title_thickness; + borders->bottom_right.height += title_thickness; break; case DIR_W: - borders->top_left.width += fw->title_thickness; + borders->top_left.width += title_thickness; break; case DIR_E: - borders->bottom_right.width += fw->title_thickness; + borders->bottom_right.width += title_thickness; break; } borders->total_size.width = Index: fvwm/geometry.h =================================================================== --- fvwm/geometry.h (revision 5) +++ fvwm/geometry.h (revision 6) @@ -44,6 +44,8 @@ FvwmWindow *fw, rectangle *ret_g); void get_window_borders( const FvwmWindow *fw, size_borders *borders); +void get_window_borders_shaded( + const FvwmWindow *fw, size_borders *borders); void get_window_borders_no_title( const FvwmWindow *fw, size_borders *borders); void set_window_border_size( Index: fvwm/fvwm.h =================================================================== --- fvwm/fvwm.h (revision 5) +++ fvwm/fvwm.h (revision 6) @@ -265,6 +265,7 @@ #define WINDOWSHADE_LAZY_MASK 0x3 unsigned windowshade_laziness : 2; unsigned use_title_decor_rotation : 1; + unsigned has_border_under_title : 1; focus_policy_t focus_policy; } s; } common_flags_t; Index: fvwm/window_flags.h =================================================================== --- fvwm/window_flags.h (revision 5) +++ fvwm/window_flags.h (revision 6) @@ -310,6 +310,12 @@ (fw)->flags.common.s.use_title_decor_rotation = !!(x) #define SETM_USE_TITLE_DECOR_ROTATION(fw,x) \ (fw)->flag_mask.common.s.use_title_decor_rotation = !!(x) +#define HAS_BORDER_UNDER_TITLE(fw) \ + ((fw)->flags.common.s.has_border_under_title) +#define SET_HAS_BORDER_UNDER_TITLE(fw,x) \ + (fw)->flags.common.s.has_border_under_title = !!(x) +#define SETM_HAS_BORDER_UNDER_TITLE(fw,x) \ + (fw)->flag_mask.common.s.has_border_under_title = !!(x) /* access to the special flags of a window */ #define DO_REUSE_DESTROYED(fw) \ Index: fvwm/borders.c =================================================================== --- fvwm/borders.c (revision 5) +++ fvwm/borders.c (revision 6) @@ -4582,6 +4582,7 @@ rectangle *ret_g, Window *ret_w) { int bw; + Bool title; bw = fw->boundary_width; /* ret_g->x and ret->y is just an offset relatively to the w, @@ -4652,9 +4653,34 @@ ret_g->height = sidebar_g->y; break; default: - return; + break; } + if (HAS_BORDER_UNDER_TITLE(fw)) + { + title = False; + switch (GET_TITLE_DIR(fw)) + { + case DIR_N: title = part & PART_TOP; break; + case DIR_E: title = part & PART_RIGHT; break; + case DIR_S: title = part & PART_BOTTOM; break; + case DIR_W: title = part & PART_LEFT; break; + } + if (title) + { + ret_g->width = max(ret_g->width, 2 * bw + fw->title_thickness); + ret_g->height = max(ret_g->height, 2 * bw + fw->title_thickness); + if (part & PART_RIGHT) + { + ret_g->x = 2 * sidebar_g->x + sidebar_g->width - ret_g->width; + } + if (part & PART_BOTTOM) + { + ret_g->y = 2 * sidebar_g->y + sidebar_g->height - ret_g->height; + } + } + } + return; } Index: fvwm/borders.h =================================================================== --- fvwm/borders.h (revision 5) +++ fvwm/borders.h (revision 6) @@ -36,7 +36,12 @@ PART_FRAME = 0xff, PART_TITLEBAR = 0x300, PART_HANDLES = 0xc00, - PART_ALL = 0xfff + PART_ALL = 0xfff, + + PART_TOP = 0x31, + PART_BOTTOM = 0xc2, + PART_LEFT = 0x58, + PART_RIGHT = 0xa4 } window_parts; typedef enum