updated on Thu Jan 19 20:01:47 UTC 2012
[aur-mirror.git] / fvwm+ / 06-BorderUnderTitle.patch
blob170670be4ef5dc73f0fcefbfba722b6ac077bcfe
1 diff -U3 -r fvwm/borders.c fvwm/borders.c
2 --- fvwm/borders.c 2011-12-09 19:19:30.354527773 +0100
3 +++ fvwm/borders.c 2011-12-09 19:32:33.277812649 +0100
4 @@ -4992,6 +4992,7 @@
5 rectangle *ret_g, Window *ret_w)
7 int bw;
8 + Bool title;
10 bw = fw->boundary_width;
11 /* ret_g->x and ret->y is just an offset relatively to the w,
12 @@ -5062,7 +5063,32 @@
13 ret_g->height = sidebar_g->y;
14 break;
15 default:
16 - return;
17 + break;
18 + }
20 + if (HAS_BORDER_UNDER_TITLE(fw))
21 + {
22 + title = False;
23 + switch (GET_TITLE_DIR(fw))
24 + {
25 + case DIR_N: title = part & PART_TOP; break;
26 + case DIR_E: title = part & PART_RIGHT; break;
27 + case DIR_S: title = part & PART_BOTTOM; break;
28 + case DIR_W: title = part & PART_LEFT; break;
29 + }
30 + if (title)
31 + {
32 + ret_g->width = max(ret_g->width, 2 * bw + fw->title_thickness);
33 + ret_g->height = max(ret_g->height, 2 * bw + fw->title_thickness);
34 + if (part & PART_RIGHT)
35 + {
36 + ret_g->x = 2 * sidebar_g->x + sidebar_g->width - ret_g->width;
37 + }
38 + if (part & PART_BOTTOM)
39 + {
40 + ret_g->y = 2 * sidebar_g->y + sidebar_g->height - ret_g->height;
41 + }
42 + }
45 return;
46 diff -U3 -r fvwm/borders.h fvwm/borders.h
47 --- fvwm/borders.h 2003-06-29 21:53:23.000000000 +0200
48 +++ fvwm/borders.h 2011-12-09 19:32:33.277812649 +0100
49 @@ -36,7 +36,12 @@
50 PART_FRAME = 0xff,
51 PART_TITLEBAR = 0x300,
52 PART_HANDLES = 0xc00,
53 - PART_ALL = 0xfff
54 + PART_ALL = 0xfff,
56 + PART_TOP = 0x31,
57 + PART_BOTTOM = 0xc2,
58 + PART_LEFT = 0x58,
59 + PART_RIGHT = 0xa4
60 } window_parts;
62 typedef enum
63 diff -U3 -r fvwm/fvwm.h fvwm/fvwm.h
64 --- fvwm/fvwm.h 2011-12-09 19:19:30.357861021 +0100
65 +++ fvwm/fvwm.h 2011-12-09 19:32:33.277812649 +0100
66 @@ -271,6 +271,7 @@
67 #define WINDOWSHADE_LAZY_MASK 0x3
68 unsigned windowshade_laziness : 2;
69 unsigned use_title_decor_rotation : 1;
70 + unsigned has_border_under_title : 1;
71 focus_policy_t focus_policy;
72 } s;
73 } common_flags_t;
74 diff -U3 -r fvwm/geometry.c fvwm/geometry.c
75 --- fvwm/geometry.c 2009-08-22 17:58:23.000000000 +0200
76 +++ fvwm/geometry.c 2011-12-09 19:32:33.277812649 +0100
77 @@ -46,6 +46,9 @@
79 /* ---------------------------- forward declarations ----------------------- */
81 +static void __get_window_borders(
82 + const FvwmWindow *fw, size_borders *borders, Bool is_shaded);
84 /* ---------------------------- local variables ---------------------------- */
86 /* ---------------------------- exported variables (globals) --------------- */
87 @@ -343,7 +346,8 @@
88 int big_height = big_g->height;
89 int d;
91 - get_window_borders(fw, &b);
92 + __get_window_borders(fw, &b, 1);
94 *small_g = *big_g;
95 d = 0;
96 switch (SHADED_DIR(fw))
97 @@ -469,23 +473,38 @@
98 void get_window_borders(
99 const FvwmWindow *fw, size_borders *borders)
101 + __get_window_borders(fw, borders, 0);
104 +static void __get_window_borders(
105 + const FvwmWindow *fw, size_borders *borders, Bool is_shaded)
107 + int title_thickness;
109 borders->top_left.width = fw->boundary_width;
110 borders->bottom_right.width = fw->boundary_width;
111 borders->top_left.height = fw->boundary_width;
112 borders->bottom_right.height = fw->boundary_width;
114 + title_thickness = fw->title_thickness;
115 + if (HAS_TITLE(fw) && HAS_BORDER_UNDER_TITLE(fw) && !is_shaded)
117 + title_thickness += fw->boundary_width;
120 switch (GET_TITLE_DIR(fw))
122 case DIR_N:
123 - borders->top_left.height += fw->title_thickness;
124 + borders->top_left.height += title_thickness;
125 break;
126 case DIR_S:
127 - borders->bottom_right.height += fw->title_thickness;
128 + borders->bottom_right.height += title_thickness;
129 break;
130 case DIR_W:
131 - borders->top_left.width += fw->title_thickness;
132 + borders->top_left.width += title_thickness;
133 break;
134 case DIR_E:
135 - borders->bottom_right.width += fw->title_thickness;
136 + borders->bottom_right.width += title_thickness;
137 break;
139 borders->total_size.width =
140 diff -U3 -r fvwm/geometry.h fvwm/geometry.h
141 --- fvwm/geometry.h 2007-01-13 16:07:14.000000000 +0100
142 +++ fvwm/geometry.h 2011-12-09 19:32:33.277812649 +0100
143 @@ -44,6 +44,8 @@
144 FvwmWindow *fw, rectangle *ret_g);
145 void get_window_borders(
146 const FvwmWindow *fw, size_borders *borders);
147 +void get_window_borders_shaded(
148 + const FvwmWindow *fw, size_borders *borders);
149 void get_window_borders_no_title(
150 const FvwmWindow *fw, size_borders *borders);
151 void set_window_border_size(
152 Seulement dans fvwm: menustyle.c.rej
153 diff -U3 -r fvwm/style.c fvwm/style.c
154 --- fvwm/style.c 2011-12-09 19:19:30.361194269 +0100
155 +++ fvwm/style.c 2011-12-09 19:32:33.274479401 +0100
156 @@ -2259,6 +2259,12 @@
158 rest = style_parse_button_style(ps, rest, on);
160 + else if (StrEquals(token, "BORDERUNDERTITLE"))
162 + S_SET_HAS_BORDER_UNDER_TITLE(SCF(*ps), on);
163 + S_SET_HAS_BORDER_UNDER_TITLE(SCM(*ps), 1);
164 + S_SET_HAS_BORDER_UNDER_TITLE(SCC(*ps), 1);
166 else if (StrEquals(token, "BorderWidth"))
168 if (GetIntegerArguments(rest, &rest, val, 1))
169 @@ -5229,6 +5235,11 @@
171 flags->do_update_rotated_title = 1;
174 + if (S_HAS_BORDER_UNDER_TITLE(SCC(*ret_style)))
176 + flags->do_redecorate = True;
179 /* has_mwm_border
180 * has_mwm_buttons */
181 diff -U3 -r fvwm/style.h fvwm/style.h
182 --- fvwm/style.h 2011-12-09 19:19:30.361194269 +0100
183 +++ fvwm/style.h 2011-12-09 19:32:33.274479401 +0100
184 @@ -376,6 +376,10 @@
185 ((c).s.use_title_decor_rotation)
186 #define S_SET_USE_TITLE_DECOR_ROTATION(c,x) \
187 ((c).s.use_title_decor_rotation = !!(x))
188 +#define S_HAS_BORDER_UNDER_TITLE(c) \
189 + ((c).s.has_border_under_title)
190 +#define S_SET_HAS_BORDER_UNDER_TITLE(c,x) \
191 + ((c).s.has_border_under_title = !!(x))
192 #define S_DO_EWMH_MINI_ICON_OVERRIDE(c) \
193 ((c).s.do_ewmh_mini_icon_override)
194 #define S_SET_DO_EWMH_MINI_ICON_OVERRIDE(c,x) \
195 diff -U3 -r fvwm/window_flags.h fvwm/window_flags.h
196 --- fvwm/window_flags.h 2011-12-09 19:19:30.361194269 +0100
197 +++ fvwm/window_flags.h 2011-12-09 19:32:33.277812649 +0100
198 @@ -328,6 +328,12 @@
199 (fw)->flags.common.s.use_title_decor_rotation = !!(x)
200 #define SETM_USE_TITLE_DECOR_ROTATION(fw,x) \
201 (fw)->flag_mask.common.s.use_title_decor_rotation = !!(x)
202 +#define HAS_BORDER_UNDER_TITLE(fw) \
203 + ((fw)->flags.common.s.has_border_under_title)
204 +#define SET_HAS_BORDER_UNDER_TITLE(fw,x) \
205 + (fw)->flags.common.s.has_border_under_title = !!(x)
206 +#define SETM_HAS_BORDER_UNDER_TITLE(fw,x) \
207 + (fw)->flag_mask.common.s.has_border_under_title = !!(x)
209 /* access to the special flags of a window */
210 #define DO_REUSE_DESTROYED(fw) \