updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / fvwm-patched / 10-ButtonWidth.patch
blob2fab8eac49ca963ad2f73113cbb495f9bad594a4
1 Index: fvwm/frame.c
2 ===================================================================
3 --- fvwm/frame.c (revision 10)
4 +++ fvwm/frame.c (revision 11)
5 @@ -1369,7 +1369,14 @@
6 tb_thick = fw->title_thickness;
7 nbuttons = fw->nr_left_buttons + fw->nr_right_buttons;
8 nbuttons_big = 0;
9 - b_length = tb_thick;
10 + if (fw->decor->button_width == 0)
11 + {
12 + b_length = tb_thick;
13 + }
14 + else
15 + {
16 + b_length = fw->decor->button_width;
17 + }
18 t_length = tb_length - nbuttons * b_length;
19 if (nbuttons > 0 && t_length < MIN_WINDOW_TITLE_LENGTH)
21 Index: fvwm/screen.h
22 ===================================================================
23 --- fvwm/screen.h (revision 10)
24 +++ fvwm/screen.h (revision 11)
25 @@ -286,6 +286,7 @@
26 #endif
27 int title_height; /* explicitly specified title bar height */
28 int min_title_height;
29 + int button_width;
30 /* titlebar buttons */
31 TitleButton buttons[NUMBER_OF_TITLE_BUTTONS];
32 TitleButton titlebar;
33 Index: fvwm/builtins.c
34 ===================================================================
35 --- fvwm/builtins.c (revision 10)
36 +++ fvwm/builtins.c (revision 11)
37 @@ -485,6 +485,21 @@
38 if (action)
39 action += next;
41 + else if (!do_add && StrEquals(parm,"buttonwidth"))
42 + {
43 + int width = 0;
44 + int next = 0;
46 + sscanf(action, "%d%n", &width, &next);
48 + if (decor->button_width != width)
49 + {
50 + decor->button_width = width;
51 + decor->flags.has_changed = 1;
52 + }
53 + if (action)
54 + action += next;
55 + }
56 else if (!do_add && StrEquals(parm,"MinHeight"))
58 int height = 0;