diff options
author | ecolinux | 2015-06-08 15:36:55 +0200 |
---|---|---|
committer | ecolinux | 2015-06-08 15:36:55 +0200 |
commit | 5aed3bcd35055ceb088c9e03d8d1ca3e5493b79f (patch) | |
tree | a5793bc6cabfa566bafd49240a2d37a626b2cf7e /06-BorderUnderTitle.patch | |
download | aur-fvwm+.tar.gz |
Initial commit
Diffstat (limited to '06-BorderUnderTitle.patch')
-rw-r--r-- | 06-BorderUnderTitle.patch | 210 |
1 files changed, 210 insertions, 0 deletions
diff --git a/06-BorderUnderTitle.patch b/06-BorderUnderTitle.patch new file mode 100644 index 000000000000..170670be4ef5 --- /dev/null +++ b/06-BorderUnderTitle.patch @@ -0,0 +1,210 @@ +diff -U3 -r fvwm/borders.c fvwm/borders.c +--- fvwm/borders.c 2011-12-09 19:19:30.354527773 +0100 ++++ fvwm/borders.c 2011-12-09 19:32:33.277812649 +0100 +@@ -4992,6 +4992,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, +@@ -5062,7 +5063,32 @@ + 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; +diff -U3 -r fvwm/borders.h fvwm/borders.h +--- fvwm/borders.h 2003-06-29 21:53:23.000000000 +0200 ++++ fvwm/borders.h 2011-12-09 19:32:33.277812649 +0100 +@@ -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 +diff -U3 -r fvwm/fvwm.h fvwm/fvwm.h +--- fvwm/fvwm.h 2011-12-09 19:19:30.357861021 +0100 ++++ fvwm/fvwm.h 2011-12-09 19:32:33.277812649 +0100 +@@ -271,6 +271,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; +diff -U3 -r fvwm/geometry.c fvwm/geometry.c +--- fvwm/geometry.c 2009-08-22 17:58:23.000000000 +0200 ++++ fvwm/geometry.c 2011-12-09 19:32:33.277812649 +0100 +@@ -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) --------------- */ +@@ -343,7 +346,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)) +@@ -469,23 +473,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 = +diff -U3 -r fvwm/geometry.h fvwm/geometry.h +--- fvwm/geometry.h 2007-01-13 16:07:14.000000000 +0100 ++++ fvwm/geometry.h 2011-12-09 19:32:33.277812649 +0100 +@@ -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( +Seulement dans fvwm: menustyle.c.rej +diff -U3 -r fvwm/style.c fvwm/style.c +--- fvwm/style.c 2011-12-09 19:19:30.361194269 +0100 ++++ fvwm/style.c 2011-12-09 19:32:33.274479401 +0100 +@@ -2259,6 +2259,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)) +@@ -5229,6 +5235,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 */ +diff -U3 -r fvwm/style.h fvwm/style.h +--- fvwm/style.h 2011-12-09 19:19:30.361194269 +0100 ++++ fvwm/style.h 2011-12-09 19:32:33.274479401 +0100 +@@ -376,6 +376,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) \ +diff -U3 -r fvwm/window_flags.h fvwm/window_flags.h +--- fvwm/window_flags.h 2011-12-09 19:19:30.361194269 +0100 ++++ fvwm/window_flags.h 2011-12-09 19:32:33.277812649 +0100 +@@ -328,6 +328,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) \ |