updated on Mon Jan 23 12:00:23 UTC 2012
[aur-mirror.git] / fvwm+ / 09-TopBorder.patch
blobe31159d0df8cfb9dbc95b215ac3819d038503b36
1 diff -U3 -r fvwm/builtins.c fvwm/builtins.c
2 --- fvwm/builtins.c 2011-08-07 00:03:31.000000000 +0200
3 +++ fvwm/builtins.c 2011-12-09 20:53:09.537508019 +0100
4 @@ -494,6 +494,21 @@
5 if (action)
6 action += next;
8 + else if (!do_add && StrEquals(parm,"buttonwidth"))
9 + {
10 + int width = 0;
11 + int next = 0;
13 + sscanf(action, "%d%n", &width, &next);
15 + if (decor->button_width != width)
16 + {
17 + decor->button_width = width;
18 + decor->flags.has_changed = 1;
19 + }
20 + if (action)
21 + action += next;
22 + }
23 else if (!do_add && StrEquals(parm,"MinHeight"))
25 int height = 0;
26 diff -U3 -r fvwm/frame.c fvwm/frame.c
27 --- fvwm/frame.c 2011-12-09 19:51:38.705188705 +0100
28 +++ fvwm/frame.c 2011-12-09 20:53:09.537508019 +0100
29 @@ -1369,7 +1369,14 @@
30 tb_thick = fw->title_thickness;
31 nbuttons = fw->nr_left_buttons + fw->nr_right_buttons;
32 nbuttons_big = 0;
33 - b_length = tb_thick;
34 + if (fw->decor->button_width == 0)
35 + {
36 + b_length = tb_thick;
37 + }
38 + else
39 + {
40 + b_length = fw->decor->button_width;
41 + }
42 t_length = tb_length - nbuttons * b_length;
43 if (nbuttons > 0 && t_length < MIN_WINDOW_TITLE_LENGTH)
45 diff -U3 -r fvwm/fvwm.h fvwm/fvwm.h
46 --- fvwm/fvwm.h 2011-12-09 19:51:38.705188705 +0100
47 +++ fvwm/fvwm.h 2011-12-09 20:53:09.534174771 +0100
48 @@ -277,6 +277,7 @@
49 unsigned has_rounded_corners_top : 1;
50 unsigned has_rounded_corners_bottom : 1;
51 unsigned has_slightly_rounded_corners : 1;
52 + unsigned has_no_top_border : 1;
53 focus_policy_t focus_policy;
54 } s;
55 } common_flags_t;
56 diff -U3 -r fvwm/geometry.c fvwm/geometry.c
57 --- fvwm/geometry.c 2011-12-09 19:51:38.705188705 +0100
58 +++ fvwm/geometry.c 2011-12-09 20:53:09.534174771 +0100
59 @@ -480,6 +480,7 @@
60 const FvwmWindow *fw, size_borders *borders, Bool is_shaded)
62 int title_thickness;
63 + int *title_border = NULL;
64 int bw;
66 bw = HAS_FLUXBOX_HANDLES(fw) ? 1 : fw->boundary_width;
67 @@ -497,18 +498,25 @@
68 switch (GET_TITLE_DIR(fw))
70 case DIR_N:
71 - borders->top_left.height += title_thickness;
72 + title_border = &borders->top_left.height;
73 break;
74 case DIR_S:
75 - borders->bottom_right.height += title_thickness;
76 + title_border = &borders->bottom_right.height;
77 break;
78 case DIR_W:
79 - borders->top_left.width += title_thickness;
80 + title_border = &borders->top_left.width;
81 break;
82 case DIR_E:
83 - borders->bottom_right.width += title_thickness;
84 + title_border = &borders->bottom_right.width;
85 break;
88 + if (HAS_NO_TOP_BORDER(fw))
89 + {
90 + *title_border = 1;
91 + }
92 + *title_border += title_thickness;
94 borders->total_size.width =
95 borders->top_left.width + borders->bottom_right.width;
96 borders->total_size.height =
97 @@ -529,6 +537,26 @@
98 borders->bottom_right.width = bw;
99 borders->top_left.height = bw;
100 borders->bottom_right.height = fw->boundary_width;
102 + if (HAS_NO_TOP_BORDER(fw))
104 + switch (GET_TITLE_DIR(fw))
106 + case DIR_N:
107 + borders->top_left.height = 1;
108 + break;
109 + case DIR_S:
110 + borders->bottom_right.height = 1;
111 + break;
112 + case DIR_W:
113 + borders->top_left.width = 1;
114 + break;
115 + case DIR_E:
116 + borders->bottom_right.width = 1;
117 + break;
121 borders->total_size.width =
122 borders->top_left.width + borders->bottom_right.width;
123 borders->total_size.height =
124 diff -U3 -r fvwm/screen.h fvwm/screen.h
125 --- fvwm/screen.h 2011-12-09 19:51:38.675189480 +0100
126 +++ fvwm/screen.h 2011-12-09 20:53:09.537508019 +0100
127 @@ -286,6 +286,7 @@
128 #endif
129 int title_height; /* explicitly specified title bar height */
130 int min_title_height;
131 + int button_width;
132 /* titlebar buttons */
133 TitleButton buttons[NUMBER_OF_TITLE_BUTTONS];
134 TitleButton titlebar;
135 diff -U3 -r fvwm/style.c fvwm/style.c
136 --- fvwm/style.c 2011-12-09 19:51:38.708521953 +0100
137 +++ fvwm/style.c 2011-12-09 20:53:09.534174771 +0100
138 @@ -4734,6 +4734,12 @@
139 ps->change_mask.has_title_format_string = 1;
142 + else if (StrEquals(token, "TopBorder"))
144 + S_SET_HAS_NO_TOP_BORDER(SCF(*ps), !on);
145 + S_SET_HAS_NO_TOP_BORDER(SCM(*ps), 1);
146 + S_SET_HAS_NO_TOP_BORDER(SCC(*ps), 1);
148 else if (StrEquals(token, "TopTitleRotated"))
150 S_SET_IS_TOP_TITLE_ROTATED(SCF(*ps), on);
151 @@ -5360,6 +5366,11 @@
153 flags->do_redecorate = True;
156 + if (S_HAS_NO_TOP_BORDER(SCC(*ret_style)))
158 + flags->do_redecorate = True;
161 /* has_mwm_border
162 * has_mwm_buttons */
163 diff -U3 -r fvwm/style.h fvwm/style.h
164 --- fvwm/style.h 2011-12-09 19:51:38.708521953 +0100
165 +++ fvwm/style.h 2011-12-09 20:53:09.534174771 +0100
166 @@ -402,6 +402,11 @@
167 ((c).s.has_slightly_rounded_corners)
168 #define S_SET_HAS_SLIGHTLY_ROUNDED_CORNERS(c,x) \
169 ((c).s.has_slightly_rounded_corners = !!(x))
170 +#define S_HAS_NO_TOP_BORDER(c) \
171 + ((c).s.has_no_top_border)
172 +#define S_SET_HAS_NO_TOP_BORDER(c,x) \
173 + ((c).s.has_no_top_border = !!(x))
175 #define S_DO_EWMH_MINI_ICON_OVERRIDE(c) \
176 ((c).s.do_ewmh_mini_icon_override)
177 #define S_SET_DO_EWMH_MINI_ICON_OVERRIDE(c,x) \
178 diff -U3 -r fvwm/window_flags.h fvwm/window_flags.h
179 --- fvwm/window_flags.h 2011-12-09 19:51:38.708521953 +0100
180 +++ fvwm/window_flags.h 2011-12-09 20:53:09.534174771 +0100
181 @@ -358,6 +358,12 @@
182 (fw)->flags.common.s.has_slightly_rounded_corners = !!(x)
183 #define SETM_HAS_SLIGHTLY_ROUNDED_CORNERS(fw,x) \
184 (fw)->flag_mask.common.s.has_slightly_rounded_corners = !!(x)
185 +#define HAS_NO_TOP_BORDER(fw) \
186 + ((fw)->flags.common.s.has_no_top_border)
187 +#define SET_HAS_NO_TOP_BORDER(fw,x) \
188 + (fw)->flags.common.s.has_no_top_border = !!(x)
189 +#define SETM_HAS_NO_TOP_BORDER(fw,x) \
190 + (fw)->flag_mask.common.s.has_no_top_border = !!(x)
192 /* access to the special flags of a window */
193 #define DO_REUSE_DESTROYED(fw) \