]> git.cameronkatri.com Git - apple_cmds.git/blob - patch_cmds/diffstat/testing/case26.pat
atrun: Install LaunchDaemon
[apple_cmds.git] / patch_cmds / diffstat / testing / case26.pat
1 diff -Nru /tmp/8FTwAYJlot/flwm-1.00/config.h /tmp/KfNDqvamm0/flwm-1.01/config.h
2 --- /tmp/8FTwAYJlot/flwm-1.00/config.h 1999-08-24 22:59:35.000000000 +0200
3 +++ /tmp/KfNDqvamm0/flwm-1.01/config.h 2002-03-24 02:02:33.000000000 +0100
4 @@ -25,6 +25,12 @@
5 // nothing is done if this is not defined:
6 //#define AUTO_RAISE 0.5
7
8 +// Perform "smart" autoplacement.
9 +// New windows are put at positions where they cover as few existing windows
10 +// as possible. A brute force algorithm is used, so it consumes quite a bit
11 +// of CPU time.
12 +#define SMART_PLACEMENT 1
13 +
14 // set this to zero to remove the multiple-desktop code. This will
15 // make flwm about 20K smaller
16 #define DESKTOPS 1
17 diff -Nru /tmp/8FTwAYJlot/flwm-1.00/debian/changelog /tmp/KfNDqvamm0/flwm-1.01/debian/changelog
18 --- /tmp/8FTwAYJlot/flwm-1.00/debian/changelog 2006-06-30 11:01:38.000000000 +0200
19 +++ /tmp/KfNDqvamm0/flwm-1.01/debian/changelog 2006-06-30 11:01:41.000000000 +0200
20 @@ -1,3 +1,15 @@
21 +flwm (1.01-1) unstable; urgency=low
22 +
23 + * New upstream release
24 + + This release catch the release of the Alt key again. Closes: #246089.
25 + + The following patches were applied upstream (Thanks Bill Spitzak).
26 + 100_fl_filename_name 101_visible_focus 102_charstruct 103_man_typo
27 + 104_g++-4.1_warning 105_double_ampersand 201_background_color
28 + + Add 100_double_ampersand to fix atypo in this release.
29 + * debian/watch: added.
30 +
31 + -- Bill Allombert <ballombe@debian.org> Fri, 30 Jun 2006 01:17:06 +0200
32 +
33 flwm (1.00-10) unstable; urgency=low
34
35 * Add patch 104_g++-4.1_warning that fix five warnings.
36 diff -Nru /tmp/8FTwAYJlot/flwm-1.00/debian/patched/100_double_ampersand.dpatch /tmp/KfNDqvamm0/flwm-1.01/debian/patched/100_double_ampersand.dpatch
37 --- /tmp/8FTwAYJlot/flwm-1.00/debian/patched/100_double_ampersand.dpatch 1970-01-01 01:00:00.000000000 +0100
38 +++ /tmp/KfNDqvamm0/flwm-1.01/debian/patched/100_double_ampersand.dpatch 2006-06-30 11:01:41.000000000 +0200
39 @@ -0,0 +1 @@
40 +patching file Menu.C
41 diff -Nru /tmp/8FTwAYJlot/flwm-1.00/debian/patched/100_fl_filename_name.dpatch /tmp/KfNDqvamm0/flwm-1.01/debian/patched/100_fl_filename_name.dpatch
42 --- /tmp/8FTwAYJlot/flwm-1.00/debian/patched/100_fl_filename_name.dpatch 2006-06-30 11:01:38.000000000 +0200
43 +++ /tmp/KfNDqvamm0/flwm-1.01/debian/patched/100_fl_filename_name.dpatch 1970-01-01 01:00:00.000000000 +0100
44 @@ -1,2 +0,0 @@
45 -patching file main.C
46 -Hunk #1 succeeded at 351 (offset -1 lines).
47 diff -Nru /tmp/8FTwAYJlot/flwm-1.00/debian/patched/101_visible_focus.dpatch /tmp/KfNDqvamm0/flwm-1.01/debian/patched/101_visible_focus.dpatch
48 --- /tmp/8FTwAYJlot/flwm-1.00/debian/patched/101_visible_focus.dpatch 2006-06-30 11:01:38.000000000 +0200
49 +++ /tmp/KfNDqvamm0/flwm-1.01/debian/patched/101_visible_focus.dpatch 1970-01-01 01:00:00.000000000 +0100
50 @@ -1 +0,0 @@
51 -patching file main.C
52 diff -Nru /tmp/8FTwAYJlot/flwm-1.00/debian/patched/102_charstruct.dpatch /tmp/KfNDqvamm0/flwm-1.01/debian/patched/102_charstruct.dpatch
53 --- /tmp/8FTwAYJlot/flwm-1.00/debian/patched/102_charstruct.dpatch 2006-06-30 11:01:38.000000000 +0200
54 +++ /tmp/KfNDqvamm0/flwm-1.01/debian/patched/102_charstruct.dpatch 1970-01-01 01:00:00.000000000 +0100
55 @@ -1 +0,0 @@
56 -patching file Rotated.C
57 diff -Nru /tmp/8FTwAYJlot/flwm-1.00/debian/patched/103_man_typo.dpatch /tmp/KfNDqvamm0/flwm-1.01/debian/patched/103_man_typo.dpatch
58 --- /tmp/8FTwAYJlot/flwm-1.00/debian/patched/103_man_typo.dpatch 2006-06-30 11:01:38.000000000 +0200
59 +++ /tmp/KfNDqvamm0/flwm-1.01/debian/patched/103_man_typo.dpatch 1970-01-01 01:00:00.000000000 +0100
60 @@ -1 +0,0 @@
61 -patching file flwm.1
62 diff -Nru /tmp/8FTwAYJlot/flwm-1.00/debian/patched/104_g++-4.1_warning.dpatch /tmp/KfNDqvamm0/flwm-1.01/debian/patched/104_g++-4.1_warning.dpatch
63 --- /tmp/8FTwAYJlot/flwm-1.00/debian/patched/104_g++-4.1_warning.dpatch 2006-06-30 11:01:38.000000000 +0200
64 +++ /tmp/KfNDqvamm0/flwm-1.01/debian/patched/104_g++-4.1_warning.dpatch 1970-01-01 01:00:00.000000000 +0100
65 @@ -1,3 +0,0 @@
66 -patching file Frame.C
67 -patching file Menu.C
68 -patching file Rotated.C
69 diff -Nru /tmp/8FTwAYJlot/flwm-1.00/debian/patched/105_double_ampersand.dpatch /tmp/KfNDqvamm0/flwm-1.01/debian/patched/105_double_ampersand.dpatch
70 --- /tmp/8FTwAYJlot/flwm-1.00/debian/patched/105_double_ampersand.dpatch 2006-06-30 11:01:38.000000000 +0200
71 +++ /tmp/KfNDqvamm0/flwm-1.01/debian/patched/105_double_ampersand.dpatch 1970-01-01 01:00:00.000000000 +0100
72 @@ -1 +0,0 @@
73 -patching file Menu.C
74 diff -Nru /tmp/8FTwAYJlot/flwm-1.00/debian/patched/201_background_color.dpatch /tmp/KfNDqvamm0/flwm-1.01/debian/patched/201_background_color.dpatch
75 --- /tmp/8FTwAYJlot/flwm-1.00/debian/patched/201_background_color.dpatch 2006-06-30 11:01:38.000000000 +0200
76 +++ /tmp/KfNDqvamm0/flwm-1.01/debian/patched/201_background_color.dpatch 1970-01-01 01:00:00.000000000 +0100
77 @@ -1,2 +0,0 @@
78 -patching file Frame.C
79 -patching file Menu.C
80 diff -Nru /tmp/8FTwAYJlot/flwm-1.00/debian/patches/00list /tmp/KfNDqvamm0/flwm-1.01/debian/patches/00list
81 --- /tmp/8FTwAYJlot/flwm-1.00/debian/patches/00list 2006-06-30 11:01:38.000000000 +0200
82 +++ /tmp/KfNDqvamm0/flwm-1.01/debian/patches/00list 2006-06-30 11:01:41.000000000 +0200
83 @@ -1,8 +1,2 @@
84 -100_fl_filename_name
85 -101_visible_focus
86 -102_charstruct
87 -103_man_typo
88 -104_g++-4.1_warning
89 -105_double_ampersand
90 +100_double_ampersand
91 200_Debian_menu
92 -201_background_color
93 diff -Nru /tmp/8FTwAYJlot/flwm-1.00/debian/patches/100_double_ampersand.dpatch /tmp/KfNDqvamm0/flwm-1.01/debian/patches/100_double_ampersand.dpatch
94 --- /tmp/8FTwAYJlot/flwm-1.00/debian/patches/100_double_ampersand.dpatch 1970-01-01 01:00:00.000000000 +0100
95 +++ /tmp/KfNDqvamm0/flwm-1.01/debian/patches/100_double_ampersand.dpatch 2006-06-30 11:01:41.000000000 +0200
96 @@ -0,0 +1,19 @@
97 +#! /bin/sh /usr/share/dpatch/dpatch-run
98 +## 100_double_ampersand.dpatch by <ballombe@debian.org>
99 +##
100 +## All lines beginning with `## DP:' are a description of the patch.
101 +## DP: fix handling of ampersand in titles in windows list.
102 +
103 +@DPATCH@
104 +diff -urNad flwm-1.01~/Menu.C flwm-1.01/Menu.C
105 +--- flwm-1.01~/Menu.C 2006-06-30 10:52:34.000000000 +0200
106 ++++ flwm-1.01/Menu.C 2006-06-30 10:54:31.000000000 +0200
107 +@@ -98,7 +98,7 @@
108 + char* t = buf;
109 + while (t < buf+254 && *l) {
110 + if (*l=='&') *t++ = *l;
111 +- *t++ = *l;
112 ++ *t++ = *l++;
113 + }
114 + *t = 0;
115 + l = buf;
116 diff -Nru /tmp/8FTwAYJlot/flwm-1.00/debian/patches/100_fl_filename_name.dpatch /tmp/KfNDqvamm0/flwm-1.01/debian/patches/100_fl_filename_name.dpatch
117 --- /tmp/8FTwAYJlot/flwm-1.00/debian/patches/100_fl_filename_name.dpatch 2006-06-30 11:01:38.000000000 +0200
118 +++ /tmp/KfNDqvamm0/flwm-1.01/debian/patches/100_fl_filename_name.dpatch 1970-01-01 01:00:00.000000000 +0100
119 @@ -1,20 +0,0 @@
120 -#! /bin/sh /usr/share/dpatch/dpatch-run
121 -## 100_fl_filename_name.dpatch by Tommi Virtanen <tv@debian.org>
122 -##
123 -## All lines beginning with `## DP:' are a description of the patch.
124 -## DP: Transition from fltk-1.0 to fltk-1.1.
125 -## DP: Applied upstream.
126 -
127 -@DPATCH@
128 -diff -urNad flwm-1.00~/main.C flwm-1.00/main.C
129 ---- flwm-1.00~/main.C 2006-02-23 21:41:10.000000000 +0100
130 -+++ flwm-1.00/main.C 2006-02-23 21:41:39.000000000 +0100
131 -@@ -352,7 +352,7 @@
132 - }
133 -
134 - int main(int argc, char** argv) {
135 -- program_name = filename_name(argv[0]);
136 -+ program_name = fl_filename_name(argv[0]);
137 - int i; if (Fl::args(argc, argv, i, arg) < argc) Fl::error(
138 - "options are:\n"
139 - " -d[isplay] host:#.#\tX display & screen to use\n"
140 diff -Nru /tmp/8FTwAYJlot/flwm-1.00/debian/patches/101_visible_focus.dpatch /tmp/KfNDqvamm0/flwm-1.01/debian/patches/101_visible_focus.dpatch
141 --- /tmp/8FTwAYJlot/flwm-1.00/debian/patches/101_visible_focus.dpatch 2006-06-30 11:01:38.000000000 +0200
142 +++ /tmp/KfNDqvamm0/flwm-1.01/debian/patches/101_visible_focus.dpatch 1970-01-01 01:00:00.000000000 +0100
143 @@ -1,19 +0,0 @@
144 -#! /bin/sh /usr/share/dpatch/dpatch-run
145 -## 101_visible_focus.dpatch by Bill Allombert <ballombe@debian.org>
146 -##
147 -## All lines beginning with `## DP:' are a description of the patch.
148 -## DP: Restore fltk-1.0 focus behaviour
149 -## DP: (Applied upstream)
150 -
151 -@DPATCH@
152 -diff -urNad flwm-1.00~/main.C flwm-1.00/main.C
153 ---- flwm-1.00~/main.C 2006-02-23 21:41:57.000000000 +0100
154 -+++ flwm-1.00/main.C 2006-02-23 21:42:21.000000000 +0100
155 -@@ -298,6 +298,7 @@
156 - XFree((void *)wins);
157 -
158 - #endif
159 -+ Fl::visible_focus(0);
160 - }
161 -
162 - ////////////////////////////////////////////////////////////////
163 diff -Nru /tmp/8FTwAYJlot/flwm-1.00/debian/patches/102_charstruct.dpatch /tmp/KfNDqvamm0/flwm-1.01/debian/patches/102_charstruct.dpatch
164 --- /tmp/8FTwAYJlot/flwm-1.00/debian/patches/102_charstruct.dpatch 2006-06-30 11:01:38.000000000 +0200
165 +++ /tmp/KfNDqvamm0/flwm-1.01/debian/patches/102_charstruct.dpatch 1970-01-01 01:00:00.000000000 +0100
166 @@ -1,45 +0,0 @@
167 -#! /bin/sh /usr/share/dpatch/dpatch-run
168 -## 102_charstruct.dpatch by Tommi Virtanen <tv@debian.org>
169 -##
170 -## All lines beginning with `## DP:' are a description of the patch.
171 -## DP: Support fonts for which fontstruct->per_char is NULL.
172 -## DP: (Applied upstream).
173 -
174 -@DPATCH@
175 -diff -urNad flwm-1.00~/Rotated.C flwm-1.00/Rotated.C
176 ---- flwm-1.00~/Rotated.C 2006-02-23 21:42:31.000000000 +0100
177 -+++ flwm-1.00/Rotated.C 2006-02-23 21:43:03.000000000 +0100
178 -@@ -116,20 +116,27 @@
179 - /* font needs rotation ... */
180 - /* loop through each character ... */
181 - for (ichar = min_char; ichar <= max_char; ichar++) {
182 -+ XCharStruct *charstruct;
183 -
184 - index = ichar-fontstruct->min_char_or_byte2;
185 --
186 -+
187 -+ if (fontstruct->per_char) {
188 -+ charstruct = &fontstruct->per_char[index];
189 -+ } else {
190 -+ charstruct = &fontstruct->min_bounds;
191 -+ }
192 -+
193 - /* per char dimensions ... */
194 - ascent = rotfont->per_char[ichar].ascent =
195 -- fontstruct->per_char[index].ascent;
196 -+ charstruct->ascent;
197 - descent = rotfont->per_char[ichar].descent =
198 -- fontstruct->per_char[index].descent;
199 -+ charstruct->descent;
200 - lbearing = rotfont->per_char[ichar].lbearing =
201 -- fontstruct->per_char[index].lbearing;
202 -+ charstruct->lbearing;
203 - rbearing = rotfont->per_char[ichar].rbearing =
204 -- fontstruct->per_char[index].rbearing;
205 -+ charstruct->rbearing;
206 - rotfont->per_char[ichar].width =
207 -- fontstruct->per_char[index].width;
208 -+ charstruct->width;
209 -
210 - /* some space chars have zero body, but a bitmap can't have ... */
211 - if (!ascent && !descent)
212 diff -Nru /tmp/8FTwAYJlot/flwm-1.00/debian/patches/103_man_typo.dpatch /tmp/KfNDqvamm0/flwm-1.01/debian/patches/103_man_typo.dpatch
213 --- /tmp/8FTwAYJlot/flwm-1.00/debian/patches/103_man_typo.dpatch 2006-06-30 11:01:38.000000000 +0200
214 +++ /tmp/KfNDqvamm0/flwm-1.01/debian/patches/103_man_typo.dpatch 1970-01-01 01:00:00.000000000 +0100
215 @@ -1,19 +0,0 @@
216 -#! /bin/sh /usr/share/dpatch/dpatch-run
217 -## 103_man_typo.dpatch by Bill Allombert <ballombe@debian.org>
218 -##
219 -## All lines beginning with `## DP:' are a description of the patch.
220 -## DP: Fix typo in man page.
221 -
222 -@DPATCH@
223 -diff -urNad flwm-1.00~/flwm.1 flwm-1.00/flwm.1
224 ---- flwm-1.00~/flwm.1 2006-02-23 21:54:54.000000000 +0100
225 -+++ flwm-1.00/flwm.1 2006-02-23 21:55:39.000000000 +0100
226 -@@ -78,7 +78,7 @@
227 -
228 - .SH MENU ITEMS
229 -
230 --Flwm can launch programs from it's menu. This is controlled by files
231 -+Flwm can launch programs from its menu. This is controlled by files
232 - in the directory
233 - .B ~/.wmx
234 - (this was chosen to be compatible with wmx and wm2).
235 diff -Nru /tmp/8FTwAYJlot/flwm-1.00/debian/patches/104_g++-4.1_warning.dpatch /tmp/KfNDqvamm0/flwm-1.01/debian/patches/104_g++-4.1_warning.dpatch
236 --- /tmp/8FTwAYJlot/flwm-1.00/debian/patches/104_g++-4.1_warning.dpatch 2006-06-30 11:01:38.000000000 +0200
237 +++ /tmp/KfNDqvamm0/flwm-1.01/debian/patches/104_g++-4.1_warning.dpatch 1970-01-01 01:00:00.000000000 +0100
238 @@ -1,58 +0,0 @@
239 -#! /bin/sh /usr/share/dpatch/dpatch-run
240 -## 104_g++-4.1-warning.dpatch by Bill Allombert <ballombe@debian.org>
241 -##
242 -## All lines beginning with `## DP:' are a description of the patch.
243 -## DP: Fix 5 g++ -4.1 warnings
244 -
245 -@DPATCH@
246 -diff -urNad flwm-1.00~/Frame.C flwm-1.00/Frame.C
247 ---- flwm-1.00~/Frame.C 2006-06-10 13:41:04.000000000 +0200
248 -+++ flwm-1.00/Frame.C 2006-06-10 13:41:08.000000000 +0200
249 -@@ -1681,15 +1681,15 @@
250 - int format;
251 - unsigned long n, extra;
252 - int status;
253 -- void* prop;
254 -+ uchar* prop;
255 - status = XGetWindowProperty(fl_display, w,
256 - a, 0L, 256L, False, type, &realType,
257 -- &format, &n, &extra, (uchar**)&prop);
258 -+ &format, &n, &extra, &prop);
259 - if (status != Success) return 0;
260 - if (!prop) return 0;
261 - if (!n) {XFree(prop); return 0;}
262 - if (np) *np = (int)n;
263 -- return prop;
264 -+ return (void *)prop;
265 - }
266 -
267 - int Frame::getIntProperty(Atom a, Atom type, int deflt) const {
268 -diff -urNad flwm-1.00~/Menu.C flwm-1.00/Menu.C
269 ---- flwm-1.00~/Menu.C 2006-06-10 13:41:04.000000000 +0200
270 -+++ flwm-1.00/Menu.C 2006-06-10 13:41:08.000000000 +0200
271 -@@ -246,8 +246,8 @@
272 - if (fork() == 0) {
273 - if (fork() == 0) {
274 - close(ConnectionNumber(fl_display));
275 -- if (name == xtermname) execlp(name, name, "-ut", 0);
276 -- else execl(name, name, 0);
277 -+ if (name == xtermname) execlp(name, name, "-ut", NULL);
278 -+ else execl(name, name, NULL);
279 - fprintf(stderr, "flwm: can't run %s, %s\n", name, strerror(errno));
280 - XBell(fl_display, 70);
281 - exit(1);
282 -diff -urNad flwm-1.00~/Rotated.C flwm-1.00/Rotated.C
283 ---- flwm-1.00~/Rotated.C 2006-06-10 13:41:07.000000000 +0200
284 -+++ flwm-1.00/Rotated.C 2006-06-10 13:41:41.000000000 +0200
285 -@@ -242,9 +242,9 @@
286 - }
287 -
288 - for (ichar = 0; ichar < min_char; ichar++)
289 -- rotfont->per_char[ichar] = rotfont->per_char['?'];
290 -+ rotfont->per_char[ichar] = rotfont->per_char[(int)'?'];
291 - for (ichar = max_char+1; ichar < 256; ichar++)
292 -- rotfont->per_char[ichar] = rotfont->per_char['?'];
293 -+ rotfont->per_char[ichar] = rotfont->per_char[(int)'?'];
294 -
295 - /* free pixmap and GC ... */
296 - XFreePixmap(dpy, canvas);
297 diff -Nru /tmp/8FTwAYJlot/flwm-1.00/debian/patches/105_double_ampersand.dpatch /tmp/KfNDqvamm0/flwm-1.01/debian/patches/105_double_ampersand.dpatch
298 --- /tmp/8FTwAYJlot/flwm-1.00/debian/patches/105_double_ampersand.dpatch 2006-06-30 11:01:38.000000000 +0200
299 +++ /tmp/KfNDqvamm0/flwm-1.01/debian/patches/105_double_ampersand.dpatch 1970-01-01 01:00:00.000000000 +0100
300 @@ -1,48 +0,0 @@
301 -#! /bin/sh /usr/share/dpatch/dpatch-run
302 -## 105_double_ampersand.dpatch by Bill Allombert <ballombe@debian.org>
303 -##
304 -## All lines beginning with `## DP:' are a description of the patch.
305 -## DP: Handle & in window titles correctly in the windows list.
306 -
307 -@DPATCH@
308 -diff -urNad flwm-1.00~/Menu.C flwm-1.00/Menu.C
309 ---- flwm-1.00~/Menu.C 2006-03-24 00:02:57.000000000 +0100
310 -+++ flwm-1.00/Menu.C 2006-03-24 00:03:18.000000000 +0100
311 -@@ -20,6 +20,24 @@
312 - #include <dirent.h>
313 - #include <sys/stat.h>
314 -
315 -+static char *double_ampersand(const char *s)
316 -+{
317 -+ long i,l;
318 -+ for(i=0,l=0;s[i];i++)
319 -+ if (s[i]=='&')
320 -+ l++;
321 -+ char *c = new (char [l+i+1]);
322 -+ for(i=0,l=0;s[i];i++)
323 -+ {
324 -+ c[l++]=s[i];
325 -+ if (s[i]=='&')
326 -+ c[l++]=s[i];
327 -+ }
328 -+ c[l]=0;
329 -+ return c;
330 -+}
331 -+
332 -+
333 - // it is possible for the window to be deleted or withdrawn while
334 - // the menu is up. This will detect that case (with reasonable
335 - // reliability):
336 -@@ -90,8 +108,11 @@
337 - }
338 - fl_font(o->font, o->size);
339 - fl_color((Fl_Color)o->color);
340 -- const char* l = f->label(); if (!l) l = "unnamed";
341 -+ const char* l = f->label();
342 -+ if (!l) l = "unnamed";
343 -+ else l = double_ampersand(f->label());
344 - fl_draw(l, X+MENU_ICON_W+3, Y, W-MENU_ICON_W-3, H, align);
345 -+ delete l;
346 - }
347 -
348 - static void
349 diff -Nru /tmp/8FTwAYJlot/flwm-1.00/debian/patches/200_Debian_menu.dpatch /tmp/KfNDqvamm0/flwm-1.01/debian/patches/200_Debian_menu.dpatch
350 --- /tmp/8FTwAYJlot/flwm-1.00/debian/patches/200_Debian_menu.dpatch 2006-06-30 11:01:38.000000000 +0200
351 +++ /tmp/KfNDqvamm0/flwm-1.01/debian/patches/200_Debian_menu.dpatch 2006-06-30 11:01:41.000000000 +0200
352 @@ -5,10 +5,10 @@
353 ## DP: Add Debian menu support.
354
355 @DPATCH@
356 -diff -urNad flwm-1.00~/Menu.C flwm-1.00/Menu.C
357 ---- flwm-1.00~/Menu.C 2006-06-10 22:22:59.000000000 +0200
358 -+++ flwm-1.00/Menu.C 2006-06-10 22:23:00.000000000 +0200
359 -@@ -395,7 +395,11 @@
360 +diff -urNad flwm-1.01~/Menu.C flwm-1.01/Menu.C
361 +--- flwm-1.01~/Menu.C 2006-06-30 09:02:01.000000000 +0200
362 ++++ flwm-1.01/Menu.C 2006-06-30 09:02:05.000000000 +0200
363 +@@ -393,7 +393,11 @@
364 strcpy(path, home);
365 if (path[strlen(path)-1] != '/') strcat(path, "/");
366 strcat(path, ".wmx/");
367 @@ -21,9 +21,9 @@
368 if (st.st_mtime == wmx_time) return;
369 wmx_time = st.st_mtime;
370 num_wmx = 0;
371 -diff -urNad flwm-1.00~/flwm.1 flwm-1.00/flwm.1
372 ---- flwm-1.00~/flwm.1 2006-06-10 22:22:59.000000000 +0200
373 -+++ flwm-1.00/flwm.1 2006-06-10 22:23:00.000000000 +0200
374 +diff -urNad flwm-1.01~/flwm.1 flwm-1.01/flwm.1
375 +--- flwm-1.01~/flwm.1 2006-06-30 09:02:01.000000000 +0200
376 ++++ flwm-1.01/flwm.1 2006-06-30 09:02:05.000000000 +0200
377 @@ -102,10 +102,13 @@
378 chmod +x !*
379 .fi
380 diff -Nru /tmp/8FTwAYJlot/flwm-1.00/debian/patches/201_background_color.dpatch /tmp/KfNDqvamm0/flwm-1.01/debian/patches/201_background_color.dpatch
381 --- /tmp/8FTwAYJlot/flwm-1.00/debian/patches/201_background_color.dpatch 2006-06-30 11:01:38.000000000 +0200
382 +++ /tmp/KfNDqvamm0/flwm-1.01/debian/patches/201_background_color.dpatch 1970-01-01 01:00:00.000000000 +0100
383 @@ -1,57 +0,0 @@
384 -#! /bin/sh /usr/share/dpatch/dpatch-run
385 -## 201_background_color.dpatch by Bill Allombert <ballombe@debian.org>
386 -##
387 -## All lines beginning with `## DP:' are a description of the patch.
388 -## DP: Fix -fg and -bg options
389 -
390 -@DPATCH@
391 -diff -urNad flwm-1.00~/Frame.C flwm-1.00/Frame.C
392 ---- flwm-1.00~/Frame.C 2006-06-10 22:24:58.000000000 +0200
393 -+++ flwm-1.00/Frame.C 2006-06-10 22:25:00.000000000 +0200
394 -@@ -88,6 +88,7 @@
395 - min_w_button.callback(button_cb_static);
396 - end();
397 - box(FL_NO_BOX); // relies on background color erasing interior
398 -+ labelcolor(FL_FOREGROUND_COLOR);
399 - next = first;
400 - first = this;
401 -
402 -@@ -674,7 +675,7 @@
403 - XSetWindowAttributes a;
404 - a.background_pixel = fl_xpixel(FL_SELECTION_COLOR);
405 - XChangeWindowAttributes(fl_display, fl_xid(this), CWBackPixel, &a);
406 -- labelcolor(contrast(FL_BLACK, FL_SELECTION_COLOR));
407 -+ labelcolor(contrast(FL_FOREGROUND_COLOR, FL_SELECTION_COLOR));
408 - XClearArea(fl_display, fl_xid(this), 2, 2, w()-4, h()-4, 1);
409 - #else
410 - #if defined(SHOW_CLOCK)
411 -@@ -694,7 +695,7 @@
412 - XSetWindowAttributes a;
413 - a.background_pixel = fl_xpixel(FL_GRAY);
414 - XChangeWindowAttributes(fl_display, fl_xid(this), CWBackPixel, &a);
415 -- labelcolor(FL_BLACK);
416 -+ labelcolor(FL_FOREGROUND_COLOR);
417 - XClearArea(fl_display, fl_xid(this), 2, 2, w()-4, h()-4, 1);
418 - #else
419 - #if defined(SHOW_CLOCK)
420 -diff -urNad flwm-1.00~/Menu.C flwm-1.00/Menu.C
421 ---- flwm-1.00~/Menu.C 2006-06-10 22:24:59.000000000 +0200
422 -+++ flwm-1.00/Menu.C 2006-06-10 22:25:00.000000000 +0200
423 -@@ -99,7 +99,7 @@
424 - if (h < 3) h = 3;
425 - if (y+h > SCREEN_H) y = SCREEN_H-h;
426 - if (y < 0) y = 0;
427 -- fl_color(FL_BLACK);
428 -+ fl_color(FL_FOREGROUND_COLOR);
429 - if (c->state() == ICONIC)
430 - fl_rect(X+x+SCREEN_DX, Y+y+SCREEN_DX, w, h);
431 - else
432 -@@ -304,7 +304,7 @@
433 - m.shortcut(0);
434 - m.labelfont(MENU_FONT_SLOT);
435 - m.labelsize(MENU_FONT_SIZE);
436 -- m.labelcolor(FL_BLACK);
437 -+ m.labelcolor(FL_FOREGROUND_COLOR);
438 - }
439 -
440 - #if WMX_MENU_ITEMS
441 diff -Nru /tmp/8FTwAYJlot/flwm-1.00/debian/patches/202_background_color_2.dpatch /tmp/KfNDqvamm0/flwm-1.01/debian/patches/202_background_color_2.dpatch
442 --- /tmp/8FTwAYJlot/flwm-1.00/debian/patches/202_background_color_2.dpatch 2006-06-30 11:01:38.000000000 +0200
443 +++ /tmp/KfNDqvamm0/flwm-1.01/debian/patches/202_background_color_2.dpatch 1970-01-01 01:00:00.000000000 +0100
444 @@ -1,92 +0,0 @@
445 -#! /bin/sh /usr/share/dpatch/dpatch-run
446 -## 203_background_color.dpatch by <ballombe@debian.org>
447 -##
448 -## All lines beginning with `## DP:' are a description of the patch.
449 -## DP: fix the -fg -bg, -bg2 options.
450 -
451 -@DPATCH@
452 -diff -urNad flwm-1.00~/Menu.C flwm-1.00/Menu.C
453 ---- flwm-1.00~/Menu.C 2006-02-23 21:32:53.000000000 +0100
454 -+++ flwm-1.00/Menu.C 2006-02-23 21:36:32.000000000 +0100
455 -@@ -172,10 +172,14 @@
456 - new_desktop_input = new Fl_Input(10,30,170,25,"New desktop name:");
457 - new_desktop_input->align(FL_ALIGN_TOP_LEFT);
458 - new_desktop_input->labelfont(FL_BOLD);
459 -+ new_desktop_input->labelcolor(FL_FOREGROUND_COLOR);
460 -+
461 - Fl_Return_Button* b = new Fl_Return_Button(100,60,80,20,"OK");
462 - b->callback(new_desktop_ok_cb);
463 -+ b->labelcolor(FL_FOREGROUND_COLOR);
464 - Fl_Button* b2 = new Fl_Button(10,60,80,20,"Cancel");
465 - b2->callback(cancel_cb);
466 -+ b2->labelcolor(FL_FOREGROUND_COLOR);
467 - w->set_non_modal();
468 - w->end();
469 - }
470 -@@ -217,10 +221,13 @@
471 - w = new FrameWindow(190,90);
472 - Fl_Box* l = new Fl_Box(0, 0, 190, 60, "Really log out?");
473 - l->labelfont(FL_BOLD);
474 -+ l->labelcolor(FL_FOREGROUND_COLOR);
475 - Fl_Return_Button* b = new Fl_Return_Button(100,60,80,20,"OK");
476 - b->callback(exit_cb);
477 -+ b->labelcolor(FL_FOREGROUND_COLOR);
478 - Fl_Button* b2 = new Fl_Button(10,60,80,20,"Cancel");
479 - b2->callback(cancel_cb);
480 -+ b2->labelcolor(FL_FOREGROUND_COLOR);
481 - w->set_non_modal();
482 - w->end();
483 - }
484 -@@ -280,10 +287,10 @@
485 - m.label(data);
486 - m.flags = 0;
487 - m.labeltype(FL_NORMAL_LABEL);
488 -+ m.labelcolor(FL_FOREGROUND_COLOR);
489 - m.shortcut(0);
490 - m.labelfont(MENU_FONT_SLOT);
491 - m.labelsize(MENU_FONT_SIZE);
492 -- m.labelcolor(FL_FOREGROUND_COLOR);
493 - }
494 -
495 - #if WMX_MENU_ITEMS
496 -@@ -513,6 +520,7 @@
497 - if (c->state() == UNMAPPED || c->transient_for()) continue;
498 - init(menu[n],(char*)c);
499 - menu[n].labeltype(FRAME_LABEL);
500 -+ menu[n].labelcolor(FL_FOREGROUND_COLOR);
501 - menu[n].callback(frame_callback, c);
502 - if (is_active_frame(c)) preset = menu+n;
503 - n++;
504 -@@ -542,6 +550,7 @@
505 - if (c->desktop() == d || !c->desktop() && d == Desktop::current()) {
506 - init(menu[n],(char*)c);
507 - menu[n].labeltype(FRAME_LABEL);
508 -+ menu[n].labelcolor(FL_FOREGROUND_COLOR);
509 - menu[n].callback(d == Desktop::current() ?
510 - frame_callback : move_frame_callback, c);
511 - if (d == Desktop::current() && is_active_frame(c)) preset = menu+n;
512 -@@ -589,7 +598,10 @@
513 - if (one_desktop)
514 - #endif
515 - if (!level)
516 -+ {
517 - menu[n].labeltype(TEXT_LABEL);
518 -+ menu[n].labelcolor(FL_FOREGROUND_COLOR);
519 -+ }
520 -
521 - int nextlev = (i==num_wmx-1)?0:strspn(wmxlist[i+1], "/")-1;
522 - if (nextlev < level) {
523 -@@ -621,8 +633,11 @@
524 - if (one_desktop)
525 - #endif
526 - // fix the menus items so they are indented to align with window names:
527 -- while (menu[n].label()) menu[n++].labeltype(TEXT_LABEL);
528 --
529 -+ while (menu[n].label())
530 -+ {
531 -+ menu[n].labelcolor(FL_FOREGROUND_COLOR);
532 -+ menu[n++].labeltype(TEXT_LABEL);
533 -+ }
534 - const Fl_Menu_Item* picked =
535 - menu->popup(Fl::event_x(), Fl::event_y(), 0, preset);
536 - if (picked && picked->callback()) picked->do_callback(0);
537 diff -Nru /tmp/8FTwAYJlot/flwm-1.00/debian/watch /tmp/KfNDqvamm0/flwm-1.01/debian/watch
538 --- /tmp/8FTwAYJlot/flwm-1.00/debian/watch 1970-01-01 01:00:00.000000000 +0100
539 +++ /tmp/KfNDqvamm0/flwm-1.01/debian/watch 2006-06-30 11:01:41.000000000 +0200
540 @@ -0,0 +1,3 @@
541 +# Site Directory Pattern Version Script
542 +version=2
543 +http://flwm.sourceforge.net/flwm-(.*)\.tgz debian uupdate
544 diff -Nru /tmp/8FTwAYJlot/flwm-1.00/flwm.1 /tmp/KfNDqvamm0/flwm-1.01/flwm.1
545 --- /tmp/8FTwAYJlot/flwm-1.00/flwm.1 2006-06-30 11:01:38.000000000 +0200
546 +++ /tmp/KfNDqvamm0/flwm-1.01/flwm.1 2006-06-30 11:01:41.000000000 +0200
547 @@ -184,14 +184,14 @@
548 the keyboard, use left arrow to go to the desktop names, move up and
549 down to the other desktop).
550
551 -If a desktop is empty you can delete it. It's sub menu will show
552 +If a desktop is empty you can delete it. Its sub menu will show
553 .B delete this desktop.
554 Pick that and the desktop is gone.
555
556 .B Sticky
557 is a special "desktop": windows on it appear on all desktops. To make
558 a window "sticky" switch to the Sticky desktop and pick the window off
559 -it's current desktop (thus "moving" it to the Sticky desktop). To
560 +its current desktop (thus "moving" it to the Sticky desktop). To
561 "unstick" a window go to another desktop and pick the window off the
562 sticky desktop menu.
563
564 diff -Nru /tmp/8FTwAYJlot/flwm-1.00/flwm_wmconfig /tmp/KfNDqvamm0/flwm-1.01/flwm_wmconfig
565 --- /tmp/8FTwAYJlot/flwm-1.00/flwm_wmconfig 1999-04-26 21:09:10.000000000 +0200
566 +++ /tmp/KfNDqvamm0/flwm-1.01/flwm_wmconfig 2000-09-19 18:38:37.000000000 +0200
567 @@ -16,7 +16,9 @@
568 set name ""
569 set exec ""
570 while {[gets $f list]>=0} {
571 - if [llength $list]<3 continue
572 + set n 0
573 + catch {set n [llength $list]}
574 + if $n<3 continue
575 set tag [lindex $list 1]
576 set value [lrange $list 2 1000]
577 if [llength $value]==1 {set value [lindex $value 0]}
578 diff -Nru /tmp/8FTwAYJlot/flwm-1.00/Frame.C /tmp/KfNDqvamm0/flwm-1.01/Frame.C
579 --- /tmp/8FTwAYJlot/flwm-1.00/Frame.C 2006-06-30 11:01:38.000000000 +0200
580 +++ /tmp/KfNDqvamm0/flwm-1.01/Frame.C 2006-06-29 08:08:35.000000000 +0200
581 @@ -8,6 +8,7 @@
582 #include <FL/fl_draw.H>
583 #include "Rotated.H"
584
585 +
586 static Atom wm_state = 0;
587 static Atom wm_change_state;
588 static Atom wm_protocols;
589 @@ -63,7 +64,7 @@
590 // passed for an already-existing window when the window manager is
591 // starting up. If so we don't want to alter the state, size, or
592 // position. If null than this is a MapRequest of a new window.
593 -Frame::Frame(Window window, XWindowAttributes* existing) :
594 +Frame::Frame(XWindow window, XWindowAttributes* existing) :
595 Fl_Window(0,0),
596 window_(window),
597 state_flags_(0),
598 @@ -78,6 +79,9 @@
599 max_w_button(BUTTON_LEFT,BUTTON_TOP+BUTTON_H,BUTTON_W,BUTTON_H,"w"),
600 min_w_button(BUTTON_LEFT,BUTTON_TOP+2*BUTTON_H,BUTTON_W,BUTTON_H,"W")
601 {
602 +#if FL_MAJOR_VERSION > 1
603 + clear_double_buffer();
604 +#endif
605 close_button.callback(button_cb_static);
606 iconize_button.callback(button_cb_static);
607 max_h_button.type(FL_TOGGLE_BUTTON);
608 @@ -224,20 +228,9 @@
609 show_hide_buttons();
610
611 if (autoplace && !existing && !(transient_for() && (x() || y()))) {
612 - // autoplacement (stupid version for now)
613 - x(Root->x()+(Root->w()-w())/2);
614 - y(Root->y()+(Root->h()-h())/2);
615 - // move it until it does not hide any existing windows:
616 - const int delta = TITLE_WIDTH+LEFT;
617 - for (Frame* f = next; f; f = f->next) {
618 - if (f->x()+delta > x() && f->y()+delta > y() &&
619 - f->x()+f->w()-delta < x()+w() && f->y()+f->h()-delta < y()+h()) {
620 - x(max(x(),f->x()+delta));
621 - y(max(y(),f->y()+delta));
622 - f = this;
623 - }
624 - }
625 + place_window();
626 }
627 +
628 // move window so contents and border are visible:
629 x(force_x_onscreen(x(), w()));
630 y(force_y_onscreen(y(), h()));
631 @@ -261,7 +254,8 @@
632 sattr.bit_gravity = NorthWestGravity;
633 sattr.override_redirect = 1;
634 sattr.background_pixel = fl_xpixel(FL_GRAY);
635 - Fl_X::set_xid(this, XCreateWindow(fl_display, fl_xid(Root),
636 + Fl_X::set_xid(this, XCreateWindow(fl_display,
637 + RootWindow(fl_display,fl_screen),
638 x(), y(), w(), h(), 0,
639 fl_visual->depth,
640 InputOutput,
641 @@ -278,15 +272,140 @@
642 sendConfigureNotify(); // many apps expect this even if window size unchanged
643
644 #if CLICK_RAISES || CLICK_TO_TYPE
645 - XGrabButton(fl_display, AnyButton, AnyModifier, window, False,
646 - ButtonPressMask, GrabModeSync, GrabModeAsync, None, None);
647 + if (!dont_set_event_mask)
648 + XGrabButton(fl_display, AnyButton, AnyModifier, window, False,
649 + ButtonPressMask, GrabModeSync, GrabModeAsync, None, None);
650 #endif
651
652 if (state_ == NORMAL) {
653 XMapWindow(fl_display, fl_xid(this));
654 if (!existing) activate_if_transient();
655 }
656 + set_visible();
657 +}
658 +
659 +#if SMART_PLACEMENT
660 +// Helper functions for "smart" window placement.
661 +int overlap1(int p1, int l1, int p2, int l2) {
662 + int ret = 0;
663 + if(p1 <= p2 && p2 <= p1 + l1) {
664 + ret = min(p1 + l1 - p2, l2);
665 + } else if (p2 <= p1 && p1 <= p2 + l2) {
666 + ret = min(p2 + l2 - p1, l1);
667 + }
668 + return ret;
669 +}
670 +
671 +int overlap(int x1, int y1, int w1, int h1, int x2, int y2, int w2, int h2) {
672 + return (overlap1(x1, w1, x2, w2) * overlap1(y1, h1, y2, h2));
673 +}
674 +
675 +// Compute the overlap with existing windows.
676 +// For normal windows the overlapping area is taken into account plus a
677 +// constant value for every overlapping window.
678 +// The active window counts twice.
679 +// For iconic windows half the overlapping area is taken into account.
680 +int getOverlap(int x, int y, int w, int h, Frame *first, Frame *self) {
681 + int ret = 0;
682 + short state;
683 + for (Frame* f = first; f; f = f->next) {
684 + if (f != self) {
685 + state = f->state();
686 + if (state == NORMAL || state == ICONIC) {
687 + int o = overlap(x, y, w, h, f->x(), f->y(), f->w(), f->h());
688 + if (state == NORMAL) {
689 + ret = ret + o + (o>0?40000:0) + (o * f->active());
690 + } else if (state == ICONIC) {
691 + ret = ret + o/2;
692 + }
693 + }
694 + }
695 + }
696 + return ret;
697 +}
698 +
699 +// autoplacement (brute force version for now)
700 +void Frame::place_window() {
701 + int min_overlap = -1;
702 + int tmp_x, tmp_y, tmp_o;
703 + int best_x = 0;
704 + int best_y = 0;
705 + int _w = w();
706 + int _h = h();
707 + int max_x = Root->x() + Root->w();
708 + int max_y = Root->y() + Root->h();
709 +
710 + Frame *f1 = Frame::first;
711 + for(int i=0;; i++) {
712 + if (i==0) {
713 + tmp_x = 0;
714 + } else if (i==1) {
715 + tmp_x = max_x - _w;
716 + } else {
717 + if (f1 == this) {
718 + f1 = f1->next;
719 + }
720 + if (!f1) {
721 + break;
722 + }
723 + tmp_x = f1->x() + f1->w();
724 + f1 = f1->next;
725 + }
726 + Frame *f2 = Frame::first;
727 + for(int j=0;; j++) {
728 + if (j==0) {
729 + tmp_y = 0;
730 + } else if (j==1) {
731 + tmp_y = max_y - _h;
732 + } else {
733 + if (f2 == this) {
734 + f2 = f2->next;
735 + }
736 + if (!f2) {
737 + break;
738 + }
739 + tmp_y = f2->y() + f2->h();
740 + f2 = f2->next;
741 + }
742 +
743 + if ((tmp_x + _w <= max_x) && (tmp_y + _h <= max_y)) {
744 + tmp_o = getOverlap(tmp_x, tmp_y, _w, _h, Frame::first, this);
745 + if(tmp_o < min_overlap || min_overlap < 0) {
746 + best_x = tmp_x;
747 + best_y = tmp_y;
748 + min_overlap = tmp_o;
749 + if (min_overlap == 0) {
750 + break;
751 + }
752 + }
753 + }
754 + }
755 + if (min_overlap == 0) {
756 + break;
757 + }
758 + }
759 + x(best_x);
760 + y(best_y);
761 +}
762 +
763 +#else
764 +
765 +// autoplacement (stupid version for now)
766 +void Frame::place_window() {
767 + x(Root->x()+(Root->w()-w())/2);
768 + y(Root->y()+(Root->h()-h())/2);
769 + // move it until it does not hide any existing windows:
770 + const int delta = TITLE_WIDTH+LEFT;
771 + for (Frame* f = next; f; f = f->next) {
772 + if (f->x()+delta > x() && f->y()+delta > y() &&
773 + f->x()+f->w()-delta < x()+w() && f->y()+f->h()-delta < y()+h()) {
774 + x(max(x(),f->x()+delta));
775 + y(max(y(),f->y()+delta));
776 + f = this;
777 + }
778 + }
779 }
780 +#endif
781
782 // modify the passed X & W to a legal horizontal window position
783 int Frame::force_x_onscreen(int X, int W) {
784 @@ -334,10 +453,12 @@
785 // a legal state value to this location:
786 state_ = UNMAPPED;
787
788 +#if FL_MAJOR_VERSION < 2
789 // fix fltk bug:
790 fl_xfocus = 0;
791 fl_xmousewin = 0;
792 Fl::focus_ = 0;
793 +#endif
794
795 // remove any pointers to this:
796 Frame** cp; for (cp = &first; *cp; cp = &((*cp)->next))
797 @@ -555,7 +676,7 @@
798 // see if they set "input hint" to non-zero:
799 // prop[3] should be nonzero but the only example of this I have
800 // found is Netscape 3.0 and it sets it to zero...
801 - if (!shown() && (prop[0]&4) /*&& prop[3]*/) set_flag(MODAL);
802 + if (!shown() && (prop[0]&4) /*&& prop[3]*/) set_flag(::MODAL);
803
804 // see if it is forcing the iconize button back on. This makes
805 // transient_for act like group instead...
806 @@ -579,7 +700,7 @@
807 delete[] window_Colormaps;
808 }
809 int n;
810 - Window* cw = (Window*)getProperty(wm_colormap_windows, XA_WINDOW, &n);
811 + XWindow* cw = (XWindow*)getProperty(wm_colormap_windows, XA_WINDOW, &n);
812 if (cw) {
813 colormapWinCount = n;
814 colormapWindows = cw;
815 @@ -645,7 +766,7 @@
816 int Frame::activate(int warp) {
817 // see if a modal & newer window is up:
818 for (Frame* c = first; c && c != this; c = c->next)
819 - if (c->flag(MODAL) && c->transient_for() == this)
820 + if (c->flag(::MODAL) && c->transient_for() == this)
821 if (c->activate(warp)) return 1;
822 // ignore invisible windows:
823 if (state() != NORMAL || w() <= dwidth) return 0;
824 @@ -671,14 +792,14 @@
825 if (active_ != this) {
826 if (active_) active_->deactivate();
827 active_ = this;
828 -#if defined(ACTIVE_COLOR)
829 +#ifdef ACTIVE_COLOR
830 XSetWindowAttributes a;
831 a.background_pixel = fl_xpixel(FL_SELECTION_COLOR);
832 XChangeWindowAttributes(fl_display, fl_xid(this), CWBackPixel, &a);
833 labelcolor(contrast(FL_FOREGROUND_COLOR, FL_SELECTION_COLOR));
834 XClearArea(fl_display, fl_xid(this), 2, 2, w()-4, h()-4, 1);
835 #else
836 -#if defined(SHOW_CLOCK)
837 +#ifdef SHOW_CLOCK
838 redraw();
839 #endif
840 #endif
841 @@ -691,14 +812,14 @@
842 // this private function should only be called by constructor and if
843 // the window is active():
844 void Frame::deactivate() {
845 -#if defined(ACTIVE_COLOR)
846 +#ifdef ACTIVE_COLOR
847 XSetWindowAttributes a;
848 a.background_pixel = fl_xpixel(FL_GRAY);
849 XChangeWindowAttributes(fl_display, fl_xid(this), CWBackPixel, &a);
850 labelcolor(FL_FOREGROUND_COLOR);
851 XClearArea(fl_display, fl_xid(this), 2, 2, w()-4, h()-4, 1);
852 #else
853 -#if defined(SHOW_CLOCK)
854 +#ifdef SHOW_CLOCK
855 redraw();
856 #endif
857 #endif
858 @@ -738,9 +859,9 @@
859 switch (newstate) {
860 case UNMAPPED:
861 throw_focus();
862 - set_state_flag(IGNORE_UNMAP);
863 XUnmapWindow(fl_display, fl_xid(this));
864 - XUnmapWindow(fl_display, window_);
865 + //set_state_flag(IGNORE_UNMAP);
866 + //XUnmapWindow(fl_display, window_);
867 XRemoveFromSaveSet(fl_display, window_);
868 break;
869 case NORMAL:
870 @@ -754,9 +875,9 @@
871 XAddToSaveSet(fl_display, window_);
872 } else if (oldstate == NORMAL) {
873 throw_focus();
874 - set_state_flag(IGNORE_UNMAP);
875 XUnmapWindow(fl_display, fl_xid(this));
876 - XUnmapWindow(fl_display, window_);
877 + //set_state_flag(IGNORE_UNMAP);
878 + //XUnmapWindow(fl_display, window_);
879 } else {
880 return; // don't setStateProperty IconicState multiple times
881 }
882 @@ -906,10 +1027,10 @@
883 int minh = (nh < h()) ? nh : h();
884 XClearArea(fl_display, fl_xid(this), 0, minh-BOTTOM, w(), BOTTOM, 1);
885 // see if label or close box moved, erase the minimum area:
886 - int old_label_y = label_y;
887 - int old_label_h = label_h;
888 +// int old_label_y = label_y;
889 +// int old_label_h = label_h;
890 h(nh); show_hide_buttons();
891 -#ifdef SHOW_CLOCK
892 +#if 1 //def SHOW_CLOCK
893 int t = label_y + 3; // we have to clear the entire label area
894 #else
895 int t = nh;
896 @@ -1076,6 +1197,12 @@
897
898 // make sure fltk does not try to set the window size:
899 void Frame::resize(int, int, int, int) {}
900 +// For fltk2.0:
901 +void Frame::layout() {
902 +#if FL_MAJOR_VERSION>1
903 + layout_damage(0); // actually this line is not needed in newest cvs fltk2.0
904 +#endif
905 +}
906
907 ////////////////////////////////////////////////////////////////
908
909 @@ -1111,19 +1238,28 @@
910
911 ////////////////////////////////////////////////////////////////
912 // Drawing code:
913 +#if FL_MAJOR_VERSION>1
914 +# include <fltk/Box.h>
915 +#endif
916
917 void Frame::draw() {
918 if (flag(NO_BORDER)) return;
919 if (!flag(THIN_BORDER)) Fl_Window::draw();
920 if (damage() != FL_DAMAGE_CHILD) {
921 -#if ACTIVE_COLOR
922 +#ifdef ACTIVE_COLOR
923 fl_frame2(active() ? "AAAAJJWW" : "AAAAJJWWNNTT",0,0,w(),h());
924 if (active()) {
925 fl_color(FL_GRAY_RAMP+('N'-'A'));
926 fl_xyline(2, h()-3, w()-3, 2);
927 }
928 #else
929 +# if FL_MAJOR_VERSION>1
930 + static fltk::FrameBox framebox(0,"AAAAJJWWNNTT");
931 + drawstyle(style(),fltk::INVISIBLE); // INVISIBLE = draw edge only
932 + framebox.draw(Rectangle(w(),h()));
933 +# else
934 fl_frame("AAAAWWJJTTNN",0,0,w(),h());
935 +# endif
936 #endif
937 if (!flag(THIN_BORDER) && label_h > 3) {
938 #ifdef SHOW_CLOCK
939 @@ -1169,39 +1305,48 @@
940 #endif
941
942 void FrameButton::draw() {
943 +#if FL_MAJOR_VERSION>1
944 + const int x = value()?1:0;
945 + const int y = x;
946 + drawstyle(style(),flags()|fltk::OUTPUT);
947 + FL_UP_BOX->draw(Rectangle(w(),h()));
948 +#else
949 + const int x = this->x();
950 + const int y = this->y();
951 Fl_Widget::draw_box(value() ? FL_DOWN_FRAME : FL_UP_FRAME, FL_GRAY);
952 +#endif
953 fl_color(parent()->labelcolor());
954 switch (label()[0]) {
955 case 'W':
956 #if MINIMIZE_ARROW
957 - fl_line (x()+2,y()+(h())/2,x()+w()-4,y()+h()/2);
958 - fl_line (x()+2,y()+(h())/2,x()+2+4,y()+h()/2+4);
959 - fl_line (x()+2,y()+(h())/2,x()+2+4,y()+h()/2-4);
960 + fl_line (x+2,y+(h())/2,x+w()-4,y+h()/2);
961 + fl_line (x+2,y+(h())/2,x+2+4,y+h()/2+4);
962 + fl_line (x+2,y+(h())/2,x+2+4,y+h()/2-4);
963 #else
964 - fl_rect(x()+(h()-7)/2,y()+3,2,h()-6);
965 + fl_rect(x+(h()-7)/2,y+3,2,h()-6);
966 #endif
967 return;
968 case 'w':
969 - fl_rect(x()+2,y()+(h()-7)/2,w()-4,7);
970 + fl_rect(x+2,y+(h()-7)/2,w()-4,7);
971 return;
972 case 'h':
973 - fl_rect(x()+(h()-7)/2,y()+2,7,h()-4);
974 + fl_rect(x+(h()-7)/2,y+2,7,h()-4);
975 return;
976 case 'X':
977 #if CLOSE_X
978 - fl_line(x()+2,y()+3,x()+w()-5,y()+h()-4);
979 - fl_line(x()+3,y()+3,x()+w()-4,y()+h()-4);
980 - fl_line(x()+2,y()+h()-4,x()+w()-5,y()+3);
981 - fl_line(x()+3,y()+h()-4,x()+w()-4,y()+3);
982 + fl_line(x+2,y+3,x+w()-5,y+h()-4);
983 + fl_line(x+3,y+3,x+w()-4,y+h()-4);
984 + fl_line(x+2,y+h()-4,x+w()-5,y+3);
985 + fl_line(x+3,y+h()-4,x+w()-4,y+3);
986 #endif
987 #if CLOSE_HITTITE_LIGHTNING
988 - fl_arc(x()+3,y()+3,w()-6,h()-6,0,360);
989 - fl_line(x()+7,y()+3, x()+7,y()+11);
990 + fl_arc(x+3,y+3,w()-6,h()-6,0,360);
991 + fl_line(x+7,y+3, x+7,y+11);
992 #endif
993 return;
994 case 'i':
995 #if ICONIZE_BOX
996 - fl_rect(x()+w()/2-1,y()+h()/2-1,3,3);
997 + fl_rect(x+w()/2-1,y+h()/2-1,3,3);
998 #endif
999 return;
1000 }
1001 @@ -1320,6 +1465,9 @@
1002 c = FL_CURSOR_NESW;
1003 break;
1004 }
1005 +#if FL_MAJOR_VERSION>1
1006 + cursor(c);
1007 +#else
1008 static Frame* previous_frame;
1009 static Fl_Cursor previous_cursor;
1010 if (this != previous_frame || c != previous_cursor) {
1011 @@ -1327,6 +1475,7 @@
1012 previous_cursor = c;
1013 cursor(c, CURSOR_FG_SLOT, CURSOR_BG_SLOT);
1014 }
1015 +#endif
1016 }
1017
1018 #ifdef AUTO_RAISE
1019 @@ -1348,10 +1497,17 @@
1020 int Frame::handle(int e) {
1021 static int what, dx, dy, ix, iy, iw, ih;
1022 // see if child widget handles event:
1023 - if (Fl_Window::handle(e) && e != FL_ENTER && e != FL_MOVE) {
1024 +#if FL_MAJOR_VERSION > 1
1025 + if (fltk::Group::handle(e) && e != FL_ENTER && e != FL_MOVE) {
1026 + if (e == FL_PUSH) set_cursor(-1);
1027 + return 1;
1028 + }
1029 +#else
1030 + if (Fl_Group::handle(e) && e != FL_ENTER && e != FL_MOVE) {
1031 if (e == FL_PUSH) set_cursor(-1);
1032 return 1;
1033 }
1034 +#endif
1035 switch (e) {
1036
1037 case FL_SHOW:
1038 @@ -1381,42 +1537,33 @@
1039 #endif
1040 goto GET_CROSSINGS;
1041
1042 - case 0:
1043 + case FL_MOVE:
1044 GET_CROSSINGS:
1045 // set cursor_inside to true when the mouse is inside a window
1046 // set it false when mouse is on a frame or outside a window.
1047 // fltk mangles the X enter/leave events, we need the original ones:
1048
1049 switch (fl_xevent->type) {
1050 - case EnterNotify:
1051 + case LeaveNotify:
1052 + if (fl_xevent->xcrossing.detail == NotifyInferior) {
1053 + // cursor moved from frame to interior
1054 + cursor_inside = this;
1055 + break;
1056 + } else {
1057 + // cursor moved to another window
1058 + return 1;
1059 + }
1060
1061 + case EnterNotify:
1062 // see if cursor skipped over frame and directly to interior:
1063 if (fl_xevent->xcrossing.detail == NotifyVirtual ||
1064 fl_xevent->xcrossing.detail == NotifyNonlinearVirtual)
1065 cursor_inside = this;
1066 -
1067 else {
1068 // cursor is now pointing at frame:
1069 cursor_inside = 0;
1070 }
1071 -
1072 - // fall through to FL_MOVE:
1073 - break;
1074 -
1075 - case LeaveNotify:
1076 - if (fl_xevent->xcrossing.detail == NotifyInferior) {
1077 - // cursor moved from frame to interior
1078 - cursor_inside = this;
1079 - set_cursor(-1);
1080 - return 1;
1081 - }
1082 - return 1;
1083 -
1084 - default:
1085 - return 0; // other X event we don't understand
1086 }
1087 -
1088 - case FL_MOVE:
1089 if (Fl::belowmouse() != this || cursor_inside == this)
1090 set_cursor(-1);
1091 else
1092 @@ -1578,9 +1725,10 @@
1093
1094 case UnmapNotify: {
1095 const XUnmapEvent* e = &(ei->xunmap);
1096 - if (e->from_configure);
1097 - else if (state_flags_&IGNORE_UNMAP) clear_state_flag(IGNORE_UNMAP);
1098 - else state(UNMAPPED);
1099 + if (e->window == window_ && !e->from_configure) {
1100 + if (state_flags_&IGNORE_UNMAP) clear_state_flag(IGNORE_UNMAP);
1101 + else state(UNMAPPED);
1102 + }
1103 return 1;}
1104
1105 case DestroyNotify: {
1106 @@ -1677,7 +1825,7 @@
1107 return ::getProperty(window_, a, type, np);
1108 }
1109
1110 -void* getProperty(Window w, Atom a, Atom type, int* np) {
1111 +void* getProperty(XWindow w, Atom a, Atom type, int* np) {
1112 Atom realType;
1113 int format;
1114 unsigned long n, extra;
1115 @@ -1690,14 +1838,14 @@
1116 if (!prop) return 0;
1117 if (!n) {XFree(prop); return 0;}
1118 if (np) *np = (int)n;
1119 - return (void *)prop;
1120 + return (void*)prop;
1121 }
1122
1123 int Frame::getIntProperty(Atom a, Atom type, int deflt) const {
1124 return ::getIntProperty(window_, a, type, deflt);
1125 }
1126
1127 -int getIntProperty(Window w, Atom a, Atom type, int deflt) {
1128 +int getIntProperty(XWindow w, Atom a, Atom type, int deflt) {
1129 void* prop = getProperty(w, a, type);
1130 if (!prop) return deflt;
1131 int r = int(*(long*)prop);
1132 @@ -1705,7 +1853,7 @@
1133 return r;
1134 }
1135
1136 -void setProperty(Window w, Atom a, Atom type, int v) {
1137 +void setProperty(XWindow w, Atom a, Atom type, int v) {
1138 long prop = v;
1139 XChangeProperty(fl_display, w, a, type, 32, PropModeReplace, (uchar*)&prop,1);
1140 }
1141 diff -Nru /tmp/8FTwAYJlot/flwm-1.00/Frame.H /tmp/KfNDqvamm0/flwm-1.01/Frame.H
1142 --- /tmp/8FTwAYJlot/flwm-1.00/Frame.H 1999-08-24 22:59:35.000000000 +0200
1143 +++ /tmp/KfNDqvamm0/flwm-1.01/Frame.H 2003-12-16 16:15:40.000000000 +0100
1144 @@ -9,6 +9,9 @@
1145 #include <FL/Fl_Window.H>
1146 #include <FL/Fl_Button.H>
1147 #include <FL/x.H>
1148 +#if FL_MAJOR_VERSION<2
1149 +# define XWindow Window
1150 +#endif
1151
1152 // The state is an enumeration of reasons why the window may be invisible.
1153 // Only if it is NORMAL is the window visible.
1154 @@ -58,7 +61,7 @@
1155
1156 class Frame : public Fl_Window {
1157
1158 - Window window_;
1159 + XWindow window_;
1160
1161 short state_; // X server state: iconic, withdrawn, normal
1162 short state_flags_; // above state flags
1163 @@ -79,14 +82,14 @@
1164 int label_y, label_h; // location of label
1165 int label_w; // measured width of printed label
1166
1167 - Window transient_for_xid; // value from X
1168 + XWindow transient_for_xid; // value from X
1169 Frame* transient_for_; // the frame for that xid, if found
1170
1171 Frame* revert_to; // probably the xterm this was run from
1172
1173 Colormap colormap; // this window's colormap
1174 int colormapWinCount; // list of other windows to install colormaps for
1175 - Window *colormapWindows;
1176 + XWindow *colormapWindows;
1177 Colormap *window_Colormaps; // their colormaps
1178
1179 Desktop* desktop_;
1180 @@ -101,6 +104,7 @@
1181 int maximize_height();
1182 int force_x_onscreen(int X, int W);
1183 int force_y_onscreen(int Y, int H);
1184 + void place_window();
1185
1186 void sendMessage(Atom, Atom) const;
1187 void sendConfigureNotify() const;
1188 @@ -122,6 +126,7 @@
1189
1190 void set_size(int,int,int,int, int warp=0);
1191 void resize(int,int,int,int);
1192 + void layout();
1193 void show_hide_buttons();
1194
1195 int handle(int); // handle fltk events
1196 @@ -151,10 +156,10 @@
1197 static Frame* first;
1198 Frame* next; // stacking order, top to bottom
1199
1200 - Frame(Window, XWindowAttributes* = 0);
1201 + Frame(XWindow, XWindowAttributes* = 0);
1202 ~Frame();
1203
1204 - Window window() const {return window_;}
1205 + XWindow window() const {return window_;}
1206 Frame* transient_for() const {return transient_for_;}
1207 int is_transient_for(const Frame*) const;
1208
1209 @@ -185,8 +190,8 @@
1210 };
1211
1212 // handy wrappers for those ugly X routines:
1213 -void* getProperty(Window, Atom, Atom = AnyPropertyType, int* length = 0);
1214 -int getIntProperty(Window, Atom, Atom = AnyPropertyType, int deflt = 0);
1215 -void setProperty(Window, Atom, Atom, int);
1216 +void* getProperty(XWindow, Atom, Atom = AnyPropertyType, int* length = 0);
1217 +int getIntProperty(XWindow, Atom, Atom = AnyPropertyType, int deflt = 0);
1218 +void setProperty(XWindow, Atom, Atom, int);
1219
1220 #endif
1221 diff -Nru /tmp/8FTwAYJlot/flwm-1.00/Hotkeys.C /tmp/KfNDqvamm0/flwm-1.01/Hotkeys.C
1222 --- /tmp/8FTwAYJlot/flwm-1.00/Hotkeys.C 2000-09-22 18:53:05.000000000 +0200
1223 +++ /tmp/KfNDqvamm0/flwm-1.01/Hotkeys.C 2006-06-29 09:18:08.000000000 +0200
1224 @@ -149,6 +149,36 @@
1225 #endif
1226 {0}};
1227
1228 +#if FL_MAJOR_VERSION > 1
1229 +// Define missing function, this should get put in fltk2.0:
1230 +namespace fltk {
1231 +int test_shortcut(int shortcut) {
1232 + if (!shortcut) return 0;
1233 +
1234 + int shift = Fl::event_state();
1235 + // see if any required shift flags are off:
1236 + if ((shortcut&shift) != (shortcut&0x7fff0000)) return 0;
1237 + // record shift flags that are wrong:
1238 + int mismatch = (shortcut^shift)&0x7fff0000;
1239 + // these three must always be correct:
1240 + if (mismatch&(FL_META|FL_ALT|FL_CTRL)) return 0;
1241 +
1242 + int key = shortcut & 0xffff;
1243 +
1244 + // if shift is also correct, check for exactly equal keysyms:
1245 + if (!(mismatch&(FL_SHIFT)) && unsigned(key) == Fl::event_key()) return 1;
1246 +
1247 + // try matching ascii, ignore shift:
1248 + if (key == event_text()[0]) return 1;
1249 +
1250 + // kludge so that Ctrl+'_' works (as opposed to Ctrl+'^_'):
1251 + if ((shift&FL_CTRL) && key >= 0x3f && key <= 0x5F
1252 + && event_text()[0]==(key^0x40)) return 1;
1253 + return 0;
1254 +}
1255 +}
1256 +#endif
1257 +
1258 int Handle_Hotkey() {
1259 for (int i = 0; keybindings[i].key; i++) {
1260 if (Fl::test_shortcut(keybindings[i].key) ||
1261 @@ -165,7 +195,7 @@
1262 extern Fl_Window* Root;
1263
1264 void Grab_Hotkeys() {
1265 - Window root = fl_xid(Root);
1266 + XWindow root = fl_xid(Root);
1267 for (int i = 0; keybindings[i].key; i++) {
1268 int k = keybindings[i].key;
1269 int keycode = XKeysymToKeycode(fl_display, k & 0xFFFF);
1270 diff -Nru /tmp/8FTwAYJlot/flwm-1.00/logo.fl /tmp/KfNDqvamm0/flwm-1.01/logo.fl
1271 --- /tmp/8FTwAYJlot/flwm-1.00/logo.fl 1970-01-01 01:00:00.000000000 +0100
1272 +++ /tmp/KfNDqvamm0/flwm-1.01/logo.fl 2006-04-13 18:06:59.000000000 +0200
1273 @@ -0,0 +1,19 @@
1274 +# data file for the FLTK User Interface Designer (FLUID)
1275 +version 2.0100
1276 +header_name {.h}
1277 +code_name {.cxx}
1278 +gridx 5
1279 +gridy 5
1280 +snap 3
1281 +Function {make_window()} {open
1282 +} {
1283 + {fltk::Window} {} {
1284 + label flwm open
1285 + xywh {990 285 265 115} visible
1286 + } {
1287 + {fltk::Group} {} {
1288 + label {The Fast Light Window Manager} open selected
1289 + xywh {0 0 265 115} align 128 box PLASTIC_UP_BOX labelfont 1 labeltype ENGRAVED_LABEL color 0x7d9dae00 textcolor 0x979b9700 labelcolor 0x393a3900 labelsize 27
1290 + } {}
1291 + }
1292 +}
1293 diff -Nru /tmp/8FTwAYJlot/flwm-1.00/main.C /tmp/KfNDqvamm0/flwm-1.01/main.C
1294 --- /tmp/8FTwAYJlot/flwm-1.00/main.C 2006-06-30 11:01:38.000000000 +0200
1295 +++ /tmp/KfNDqvamm0/flwm-1.01/main.C 2006-06-29 09:17:24.000000000 +0200
1296 @@ -43,10 +43,15 @@
1297 class Fl_Root : public Fl_Window {
1298 int handle(int);
1299 public:
1300 - Fl_Root() : Fl_Window(0,0,Fl::w(),Fl::h()) {}
1301 + Fl_Root() : Fl_Window(0,0,Fl::w(),Fl::h()) {
1302 +#if FL_MAJOR_VERSION > 1
1303 + clear_double_buffer();
1304 +#endif
1305 + }
1306 void show() {
1307 if (!shown()) Fl_X::set_xid(this, RootWindow(fl_display, fl_screen));
1308 }
1309 + void flush() {}
1310 };
1311 Fl_Window *Root;
1312
1313 @@ -69,7 +74,7 @@
1314 // fltk calls this for any events it does not understand:
1315 static int flwm_event_handler(int e) {
1316 if (!e) { // XEvent that fltk did not understand.
1317 - Window window = fl_xevent->xany.window;
1318 + XWindow window = fl_xevent->xany.window;
1319 // unfortunately most of the redirect events put the interesting
1320 // window id in a different place:
1321 switch (fl_xevent->type) {
1322 @@ -107,18 +112,31 @@
1323 const XMapRequestEvent* e = &(fl_xevent->xmaprequest);
1324 (void)new Frame(e->window);
1325 return 1;}
1326 - case KeyRelease: {
1327 +#if FL_MAJOR_VERSION<2
1328 + // this was needed for *some* earlier versions of fltk
1329 + case KeyRelease:
1330 if (!Fl::grab()) return 0;
1331 - // see if they released the alt key:
1332 - unsigned long keysym =
1333 + Fl::e_keysym =
1334 XKeycodeToKeysym(fl_display, fl_xevent->xkey.keycode, 0);
1335 - if (keysym == FL_Alt_L || keysym == FL_Alt_R) {
1336 - Fl::e_keysym = FL_Enter;
1337 - return Fl::grab()->handle(FL_KEYBOARD);
1338 - }
1339 - return 0;}
1340 + goto KEYUP;
1341 +#endif
1342 + }
1343 + } else if (e == FL_KEYUP) {
1344 +#if FL_MAJOR_VERSION<2
1345 + KEYUP:
1346 +#endif
1347 + if (!Fl::grab()) return 0;
1348 + // when alt key released, pretend they hit enter & pick menu item
1349 + if (Fl::event_key()==FL_Alt_L || Fl::event_key()==FL_Alt_R) {
1350 + Fl::e_keysym = FL_Enter;
1351 +#if FL_MAJOR_VERSION>1
1352 + return Fl::modal()->handle(FL_KEYBOARD);
1353 +#else
1354 + return Fl::grab()->handle(FL_KEYBOARD);
1355 +#endif
1356 }
1357 - } else if (e == FL_SHORTCUT) {
1358 + return 0;
1359 + } else if (e == FL_SHORTCUT || e == FL_KEYBOARD) {
1360 #if FL_MAJOR_VERSION == 1 && FL_MINOR_VERSION == 0 && FL_PATCH_VERSION < 3
1361 // make the tab keys work in the menus in older fltk's:
1362 // (they do not cycle around however, so a new fltk is a good idea)
1363 @@ -189,28 +207,26 @@
1364 #endif
1365
1366 static const char* cfg, *cbg;
1367 +#if FL_MAJOR_VERSION>1
1368 +static fltk::Cursor* cursor = FL_CURSOR_ARROW;
1369 +extern FL_API fltk::Color fl_cursor_fg;
1370 +extern FL_API fltk::Color fl_cursor_bg;
1371 +#else
1372 static int cursor = FL_CURSOR_ARROW;
1373 -
1374 -static void color_setup(Fl_Color slot, const char* arg, ulong value) {
1375 - if (arg) {
1376 - XColor x;
1377 - if (XParseColor(fl_display, fl_colormap, arg, &x))
1378 - value = ((x.red>>8)<<24)|((x.green>>8)<<16)|((x.blue));
1379 - }
1380 - Fl::set_color(slot, value);
1381 -}
1382 +#endif
1383
1384 static void initialize() {
1385
1386 Display* d = fl_display;
1387
1388 #ifdef TEST
1389 - Window w = XCreateSimpleWindow(d, root,
1390 + XWindow w = XCreateSimpleWindow(d, RootWindow(d, fl_screen),
1391 100, 100, 200, 300, 10,
1392 BlackPixel(fl_display, 0),
1393 // WhitePixel(fl_display, 0));
1394 0x1234);
1395 Frame* frame = new Frame(w);
1396 + frame->label("flwm test window");
1397 XSelectInput(d, w,
1398 ExposureMask | StructureNotifyMask |
1399 KeyPressMask | KeyReleaseMask | FocusChangeMask |
1400 @@ -230,9 +246,12 @@
1401 ButtonPressMask | ButtonReleaseMask |
1402 EnterWindowMask | LeaveWindowMask |
1403 KeyPressMask | KeyReleaseMask | KeymapStateMask);
1404 - color_setup(CURSOR_FG_SLOT, cfg, CURSOR_FG_COLOR<<8);
1405 - color_setup(CURSOR_BG_SLOT, cbg, CURSOR_BG_COLOR<<8);
1406 +#if FL_MAJOR_VERSION>1
1407 + Root->cursor(cursor);
1408 +#else
1409 Root->cursor((Fl_Cursor)cursor, CURSOR_FG_SLOT, CURSOR_BG_SLOT);
1410 +#endif
1411 + Fl::visible_focus(0);
1412
1413 #ifdef TITLE_FONT
1414 Fl::set_font(TITLE_FONT_SLOT, TITLE_FONT);
1415 @@ -247,7 +266,7 @@
1416 // Gnome crap:
1417 // First create a window that can be watched to see if wm dies:
1418 Atom a = XInternAtom(d, "_WIN_SUPPORTING_WM_CHECK", False);
1419 - Window win = XCreateSimpleWindow(d, fl_xid(Root), -200, -200, 5, 5, 0, 0, 0);
1420 + XWindow win = XCreateSimpleWindow(d, fl_xid(Root), -200, -200, 5, 5, 0, 0, 0);
1421 CARD32 val = win;
1422 XChangeProperty(d, fl_xid(Root), a, XA_CARDINAL, 32, PropModeReplace, (uchar*)&val, 1);
1423 XChangeProperty(d, win, a, XA_CARDINAL, 32, PropModeReplace, (uchar*)&val, 1);
1424 @@ -287,7 +306,7 @@
1425
1426 // find all the windows and create a Frame for each:
1427 unsigned int n;
1428 - Window w1, w2, *wins;
1429 + XWindow w1, w2, *wins;
1430 XWindowAttributes attr;
1431 XQueryTree(d, fl_xid(Root), &w1, &w2, &wins, &n);
1432 for (i = 0; i < n; ++i) {
1433 @@ -298,7 +317,6 @@
1434 XFree((void *)wins);
1435
1436 #endif
1437 - Fl::visible_focus(0);
1438 }
1439
1440 ////////////////////////////////////////////////////////////////
1441 @@ -329,8 +347,10 @@
1442 cfg = v;
1443 } else if (!strcmp(s, "cbg")) {
1444 cbg = v;
1445 +#if FL_MAJOR_VERSION < 2
1446 } else if (*s == 'c') {
1447 cursor = atoi(v);
1448 +#endif
1449 } else if (*s == 'v') {
1450 int visid = atoi(v);
1451 fl_open_display();
1452 @@ -351,6 +371,17 @@
1453 return 2;
1454 }
1455
1456 +#if FL_MAJOR_VERSION<2
1457 +static void color_setup(Fl_Color slot, const char* arg, ulong value) {
1458 + if (arg) {
1459 + XColor x;
1460 + if (XParseColor(fl_display, fl_colormap, arg, &x))
1461 + value = ((x.red>>8)<<24)|((x.green>>8)<<16)|((x.blue));
1462 + }
1463 + Fl::set_color(slot, value);
1464 +}
1465 +#endif
1466 +
1467 int main(int argc, char** argv) {
1468 program_name = fl_filename_name(argv[0]);
1469 int i; if (Fl::args(argc, argv, i, arg) < argc) Fl::error(
1470 @@ -370,8 +401,22 @@
1471 #ifndef FL_NORMAL_SIZE // detect new versions of fltk where this is a variable
1472 FL_NORMAL_SIZE = 12;
1473 #endif
1474 +#if FL_MAJOR_VERSION>1
1475 + if (cfg) fl_cursor_fg = fltk::color(cfg);
1476 + if (cbg) fl_cursor_bg = fltk::color(cbg);
1477 +#else
1478 + fl_open_display();
1479 + color_setup(CURSOR_FG_SLOT, cfg, CURSOR_FG_COLOR<<8);
1480 + color_setup(CURSOR_BG_SLOT, cbg, CURSOR_BG_COLOR<<8);
1481 Fl::set_color(FL_SELECTION_COLOR,0,0,128);
1482 - Root = new Fl_Root();
1483 +#endif
1484 + Fl_Root root;
1485 + Root = &root;
1486 +#if FL_MAJOR_VERSION>1
1487 + // show() is not a virtual function in fltk2.0, this fools it:
1488 + fltk::load_theme();
1489 + root.show();
1490 +#endif
1491 Root->show(argc,argv); // fools fltk into using -geometry to set the size
1492 XSetErrorHandler(xerror_handler);
1493 initialize();
1494 diff -Nru /tmp/8FTwAYJlot/flwm-1.00/Makefile /tmp/KfNDqvamm0/flwm-1.01/Makefile
1495 --- /tmp/8FTwAYJlot/flwm-1.00/Makefile 2000-09-22 18:53:04.000000000 +0200
1496 +++ /tmp/KfNDqvamm0/flwm-1.01/Makefile 2006-06-30 00:11:16.000000000 +0200
1497 @@ -1,7 +1,7 @@
1498 SHELL=/bin/sh
1499
1500 PROGRAM = flwm
1501 -VERSION = 1.00
1502 +VERSION = 1.01
1503
1504 CXXFILES = main.C Frame.C Rotated.C Menu.C FrameWindow.C Desktop.C Hotkeys.C
1505
1506 diff -Nru /tmp/8FTwAYJlot/flwm-1.00/Menu.C /tmp/KfNDqvamm0/flwm-1.01/Menu.C
1507 --- /tmp/8FTwAYJlot/flwm-1.00/Menu.C 2006-06-30 11:01:38.000000000 +0200
1508 +++ /tmp/KfNDqvamm0/flwm-1.01/Menu.C 2006-06-30 11:01:41.000000000 +0200
1509 @@ -20,24 +20,6 @@
1510 #include <dirent.h>
1511 #include <sys/stat.h>
1512
1513 -static char *double_ampersand(const char *s)
1514 -{
1515 - long i,l;
1516 - for(i=0,l=0;s[i];i++)
1517 - if (s[i]=='&')
1518 - l++;
1519 - char *c = new (char [l+i+1]);
1520 - for(i=0,l=0;s[i];i++)
1521 - {
1522 - c[l++]=s[i];
1523 - if (s[i]=='&')
1524 - c[l++]=s[i];
1525 - }
1526 - c[l]=0;
1527 - return c;
1528 -}
1529 -
1530 -
1531 // it is possible for the window to be deleted or withdrawn while
1532 // the menu is up. This will detect that case (with reasonable
1533 // reliability):
1534 @@ -79,6 +61,7 @@
1535
1536 extern Fl_Window* Root;
1537
1538 +#if FL_MAJOR_VERSION < 2
1539 static void
1540 frame_label_draw(const Fl_Label* o, int X, int Y, int W, int H, Fl_Align align)
1541 {
1542 @@ -108,11 +91,19 @@
1543 }
1544 fl_font(o->font, o->size);
1545 fl_color((Fl_Color)o->color);
1546 - const char* l = f->label();
1547 - if (!l) l = "unnamed";
1548 - else l = double_ampersand(f->label());
1549 + const char* l = f->label(); if (!l) l = "unnamed";
1550 + // double any ampersands to turn off the underscores:
1551 + char buf[256];
1552 + if (strchr(l,'&')) {
1553 + char* t = buf;
1554 + while (t < buf+254 && *l) {
1555 + if (*l=='&') *t++ = *l;
1556 + *t++ = *l++;
1557 + }
1558 + *t = 0;
1559 + l = buf;
1560 + }
1561 fl_draw(l, X+MENU_ICON_W+3, Y, W-MENU_ICON_W-3, H, align);
1562 - delete l;
1563 }
1564
1565 static void
1566 @@ -152,6 +143,8 @@
1567 #define FRAME_LABEL FL_FREE_LABELTYPE
1568 #define TEXT_LABEL Fl_Labeltype(FL_FREE_LABELTYPE+1)
1569
1570 +#endif // FL_MAJOR_VERSION < 2
1571 +
1572 ////////////////////////////////////////////////////////////////
1573
1574 static void
1575 @@ -176,7 +169,7 @@
1576
1577 #if ASK_FOR_NEW_DESKTOP_NAME
1578
1579 -static Fl_Input* new_desktop_input;
1580 +static Fl_Input* new_desktop_input = 0;
1581
1582 static void
1583 new_desktop_ok_cb(Fl_Widget* w, void*)
1584 @@ -226,6 +219,7 @@
1585 static void
1586 exit_cb(Fl_Widget*, void*)
1587 {
1588 + printf("exit_cb\n");
1589 Frame::save_protocol();
1590 exit(0);
1591 }
1592 @@ -233,7 +227,7 @@
1593 static void
1594 logout_cb(Fl_Widget*, void*)
1595 {
1596 - static FrameWindow* w;
1597 + static FrameWindow* w = 0;
1598 if (!w) {
1599 w = new FrameWindow(190,90);
1600 Fl_Box* l = new Fl_Box(0, 0, 190, 60, "Really log out?");
1601 @@ -267,8 +261,8 @@
1602 if (fork() == 0) {
1603 if (fork() == 0) {
1604 close(ConnectionNumber(fl_display));
1605 - if (name == xtermname) execlp(name, name, "-ut", NULL);
1606 - else execl(name, name, NULL);
1607 + if (name == xtermname) execlp(name, name, "-ut", (void*)0);
1608 + else execl(name, name, (void*)0);
1609 fprintf(stderr, "flwm: can't run %s, %s\n", name, strerror(errno));
1610 XBell(fl_display, 70);
1611 exit(1);
1612 @@ -299,7 +293,11 @@
1613 m.style = 0;
1614 #endif
1615 m.label(data);
1616 +#if FL_MAJOR_VERSION > 2
1617 + m.flags = fltk::RAW_LABEL;
1618 +#else
1619 m.flags = 0;
1620 +#endif
1621 m.labeltype(FL_NORMAL_LABEL);
1622 m.shortcut(0);
1623 m.labelfont(MENU_FONT_SLOT);
1624 @@ -444,8 +442,10 @@
1625 static char beenhere;
1626 if (!beenhere) {
1627 beenhere = 1;
1628 +#if FL_MAJOR_VERSION < 2
1629 Fl::set_labeltype(FRAME_LABEL, frame_label_draw, frame_label_measure);
1630 Fl::set_labeltype(TEXT_LABEL, label_draw, label_measure);
1631 +#endif
1632 if (exit_flag) {
1633 Fl_Menu_Item* m = other_menu_items+num_other_items-2;
1634 m->label("Exit");
1635 @@ -532,8 +532,12 @@
1636 #endif
1637 for (c = Frame::first; c; c = c->next) {
1638 if (c->state() == UNMAPPED || c->transient_for()) continue;
1639 +#if FL_MAJOR_VERSION < 2
1640 init(menu[n],(char*)c);
1641 menu[n].labeltype(FRAME_LABEL);
1642 +#else
1643 + init(menu[n],c->label());
1644 +#endif
1645 menu[n].callback(frame_callback, c);
1646 if (is_active_frame(c)) preset = menu+n;
1647 n++;
1648 @@ -562,7 +566,12 @@
1649 if (c->state() == UNMAPPED || c->transient_for()) continue;
1650 if (c->desktop() == d || !c->desktop() && d == Desktop::current()) {
1651 init(menu[n],(char*)c);
1652 +#if FL_MAJOR_VERSION < 2
1653 + init(menu[n],(char*)c);
1654 menu[n].labeltype(FRAME_LABEL);
1655 +#else
1656 + init(menu[n],c->label());
1657 +#endif
1658 menu[n].callback(d == Desktop::current() ?
1659 frame_callback : move_frame_callback, c);
1660 if (d == Desktop::current() && is_active_frame(c)) preset = menu+n;
1661 @@ -606,13 +615,14 @@
1662 cmd = wmxlist[i];
1663 cmd += strspn(cmd, "/")-1;
1664 init(menu[n], cmd+pathlen[level]);
1665 +#if FL_MAJOR_VERSION < 2
1666 #if DESKTOPS
1667 if (one_desktop)
1668 #endif
1669 if (!level)
1670 menu[n].labeltype(TEXT_LABEL);
1671 -
1672 - int nextlev = (i==num_wmx-1)?0:strspn(wmxlist[i+1], "/")-1;
1673 +#endif
1674 + int nextlev = (i==num_wmx-1)?0:strspn(wmxlist[i+1], "/")-1;
1675 if (nextlev < level) {
1676 menu[n].callback(spawn_cb, cmd);
1677 // Close 'em off
1678 @@ -638,15 +648,19 @@
1679 #endif
1680 #endif
1681 memcpy(menu+n, other_menu_items, sizeof(other_menu_items));
1682 +#if FL_MAJOR_VERSION < 2
1683 #if DESKTOPS
1684 if (one_desktop)
1685 #endif
1686 // fix the menus items so they are indented to align with window names:
1687 while (menu[n].label()) menu[n++].labeltype(TEXT_LABEL);
1688 +#endif
1689
1690 const Fl_Menu_Item* picked =
1691 menu->popup(Fl::event_x(), Fl::event_y(), 0, preset);
1692 +#if FL_MAJOR_VERSION < 2
1693 if (picked && picked->callback()) picked->do_callback(0);
1694 +#endif
1695 }
1696
1697 void ShowMenu() {ShowTabMenu(0);}
1698 diff -Nru /tmp/8FTwAYJlot/flwm-1.00/patch-stamp /tmp/KfNDqvamm0/flwm-1.01/patch-stamp
1699 --- /tmp/8FTwAYJlot/flwm-1.00/patch-stamp 2006-06-30 11:01:38.000000000 +0200
1700 +++ /tmp/KfNDqvamm0/flwm-1.01/patch-stamp 2006-06-30 11:01:41.000000000 +0200
1701 @@ -1,29 +1,8 @@
1702 Patches applied in the Debian version of :
1703
1704 -debian/patches/100_fl_filename_name.dpatch (Tommi Virtanen <tv@debian.org>):
1705 - Transition from fltk-1.0 to fltk-1.1.
1706 - Applied upstream.
1707 -
1708 -debian/patches/101_visible_focus.dpatch (Bill Allombert <ballombe@debian.org>):
1709 - Restore fltk-1.0 focus behaviour
1710 - (Applied upstream)
1711 -
1712 -debian/patches/102_charstruct.dpatch (Tommi Virtanen <tv@debian.org>):
1713 - Support fonts for which fontstruct->per_char is NULL.
1714 - (Applied upstream).
1715 -
1716 -debian/patches/103_man_typo.dpatch (Bill Allombert <ballombe@debian.org>):
1717 - Fix typo in man page.
1718 -
1719 -debian/patches/104_g++-4.1_warning.dpatch (Bill Allombert <ballombe@debian.org>):
1720 - Fix 5 g++ -4.1 warnings
1721 -
1722 -debian/patches/105_double_ampersand.dpatch (Bill Allombert <ballombe@debian.org>):
1723 - Handle & in window titles correctly in the windows list.
1724 +debian/patches/100_double_ampersand.dpatch (<ballombe@debian.org>):
1725 + fix handling of ampersand in titles in windows list.
1726
1727 debian/patches/200_Debian_menu.dpatch (Tommi Virtanen <tv@debian.org>):
1728 Add Debian menu support.
1729
1730 -debian/patches/201_background_color.dpatch (Bill Allombert <ballombe@debian.org>):
1731 - Fix -fg and -bg options
1732 -
1733 diff -Nru /tmp/8FTwAYJlot/flwm-1.00/README /tmp/KfNDqvamm0/flwm-1.01/README
1734 --- /tmp/8FTwAYJlot/flwm-1.00/README 1999-08-24 22:59:35.000000000 +0200
1735 +++ /tmp/KfNDqvamm0/flwm-1.01/README 2001-04-13 17:40:54.000000000 +0200
1736 @@ -5,7 +5,7 @@
1737 ----------------------------------------------------------------
1738
1739 You need fltk. If you do not have it yet, download it from
1740 -http://fltk.easysw.com, and compile and install it.
1741 +http://www.fltk.org, and compile and install it.
1742
1743 To customize flwm (for instance to turn on click-to-type), edit the
1744 config.h file.
1745 @@ -22,21 +22,21 @@
1746 How to run flwm:
1747 ----------------------------------------------------------------
1748
1749 -Flwm should be run by X when it logs you in. This is done by putting
1750 -a call to flwm into the file ~/.xinitrc. With any luck you already
1751 -have this file. If not try copying /usr/X11/lib/X11/xinit/xinitrc.
1752 -Edit the file and try to remove any call to another window manager
1753 -(these are usually near the end).
1754 +To run flwm as your login script, you need to create or replace
1755 +~/.xinitrc or ~/.xsession (or both). Newer Linux systems with a login
1756 +panel use .xsession, older systems where X was started after login
1757 +use .xinitrc. You may also have to pick "default" from the "type of
1758 +session" popup in your login window.
1759
1760 -Recommended contents of ~/.xinitrc:
1761 +The .xinitrc or .xsession file should look like this:
1762
1763 #!/bin/sh
1764 xsetroot -solid \#006060
1765 xrdb .Xresources
1766 -# <xset, xmodmap, other configuration programs>
1767 +# xset, xmodmap, other configuration programs
1768 flwm &
1769 WindowManager=$!
1770 -# <xterm, other automatically-launched programs>
1771 +# xterm, other automatically-launched programs
1772 wait $WindowManager
1773
1774 ALLOWING THE WINDOW MANAGER TO EXIT W/O LOGOUT:
1775 diff -Nru /tmp/8FTwAYJlot/flwm-1.00/Rotated.C /tmp/KfNDqvamm0/flwm-1.01/Rotated.C
1776 --- /tmp/8FTwAYJlot/flwm-1.00/Rotated.C 2006-06-30 11:01:38.000000000 +0200
1777 +++ /tmp/KfNDqvamm0/flwm-1.01/Rotated.C 2005-09-19 06:29:11.000000000 +0200
1778 @@ -27,6 +27,9 @@
1779 /* ********************************************************************** */
1780
1781 #include <FL/x.H>
1782 +#if FL_MAJOR_VERSION < 2
1783 +# define XWindow Window
1784 +#endif
1785 #include <FL/fl_draw.H>
1786 #include "Rotated.H"
1787 #include <stdlib.h>
1788 @@ -67,7 +70,7 @@
1789 char val;
1790 XImage *I1, *I2;
1791 Pixmap canvas;
1792 - Window root;
1793 + XWindow root;
1794 int screen;
1795 GC font_gc;
1796 char text[3];/*, errstr[300];*/
1797 @@ -116,27 +119,21 @@
1798 /* font needs rotation ... */
1799 /* loop through each character ... */
1800 for (ichar = min_char; ichar <= max_char; ichar++) {
1801 - XCharStruct *charstruct;
1802
1803 index = ichar-fontstruct->min_char_or_byte2;
1804
1805 - if (fontstruct->per_char) {
1806 - charstruct = &fontstruct->per_char[index];
1807 - } else {
1808 + XCharStruct* charstruct;
1809 + if (fontstruct->per_char)
1810 + charstruct = fontstruct->per_char+index;
1811 + else
1812 charstruct = &fontstruct->min_bounds;
1813 - }
1814
1815 /* per char dimensions ... */
1816 - ascent = rotfont->per_char[ichar].ascent =
1817 - charstruct->ascent;
1818 - descent = rotfont->per_char[ichar].descent =
1819 - charstruct->descent;
1820 - lbearing = rotfont->per_char[ichar].lbearing =
1821 - charstruct->lbearing;
1822 - rbearing = rotfont->per_char[ichar].rbearing =
1823 - charstruct->rbearing;
1824 - rotfont->per_char[ichar].width =
1825 - charstruct->width;
1826 + ascent = rotfont->per_char[ichar].ascent = charstruct->ascent;
1827 + descent = rotfont->per_char[ichar].descent = charstruct->descent;
1828 + lbearing = rotfont->per_char[ichar].lbearing = charstruct->lbearing;
1829 + rbearing = rotfont->per_char[ichar].rbearing = charstruct->rbearing;
1830 + rotfont->per_char[ichar].width = charstruct->width;
1831
1832 /* some space chars have zero body, but a bitmap can't have ... */
1833 if (!ascent && !descent)
1834 @@ -242,9 +239,9 @@
1835 }
1836
1837 for (ichar = 0; ichar < min_char; ichar++)
1838 - rotfont->per_char[ichar] = rotfont->per_char[(int)'?'];
1839 + rotfont->per_char[ichar] = rotfont->per_char[int('?')];
1840 for (ichar = max_char+1; ichar < 256; ichar++)
1841 - rotfont->per_char[ichar] = rotfont->per_char[(int)'?'];
1842 + rotfont->per_char[ichar] = rotfont->per_char[int('?')];
1843
1844 /* free pixmap and GC ... */
1845 XFreePixmap(dpy, canvas);
1846 @@ -358,23 +355,25 @@
1847
1848 static XRotFontStruct* font;
1849
1850 -void draw_rotated(const char* text, int n, int x, int y, int angle) {
1851 - if (!text || !*text) return;
1852 +static void setrotfont(int angle) {
1853 /* make angle positive ... */
1854 if (angle < 0) do angle += 360; while (angle < 0);
1855 /* get nearest vertical or horizontal direction ... */
1856 int dir = ((angle+45)/90)%4;
1857 -
1858 - if (font && font->xfontstruct == fl_xfont && font->dir == dir) {
1859 - ;
1860 - } else {
1861 - if (font) XRotUnloadFont(fl_display, font);
1862 - font = XRotLoadFont(fl_display, fl_xfont, dir);
1863 + if (font) {
1864 + if (font->xfontstruct == fl_xfont && font->dir == dir) return;
1865 + XRotUnloadFont(fl_display, font);
1866 }
1867 + font = XRotLoadFont(fl_display, fl_xfont, dir);
1868 +}
1869 +
1870 +void draw_rotated(const char* text, int n, int x, int y, int angle) {
1871 + if (!text || !*text) return;
1872 + setrotfont(angle);
1873 XRotDrawString(fl_display, font, fl_window, fl_gc, x, y, text, n);
1874 }
1875
1876 -#ifndef FLWM
1877 +#if !defined(FLWM) || FL_MAJOR_VERSION>=2
1878 void draw_rotated(const char* text, int x, int y, int angle) {
1879 if (!text || !*text) return;
1880 draw_rotated(text, strlen(text), x, y, angle);
1881 @@ -391,12 +390,20 @@
1882 if (!str || !*str) return;
1883 if (w && h && !fl_not_clipped(x, y, w, h)) return;
1884 if (align & FL_ALIGN_CLIP) fl_clip(x, y, w, h);
1885 +#if FL_MAJOR_VERSION>1
1886 + setrotfont(90);
1887 + int a = font->xfontstruct->ascent;
1888 + int d = font->xfontstruct->descent;
1889 + XRotDrawString(fl_display, font, fl_window, fl_gc,
1890 + x+(w+a-d+1)/2, y+h, str, strlen(str));
1891 +#else
1892 int a1 = align&(-16);
1893 if (align & FL_ALIGN_LEFT) a1 |= FL_ALIGN_TOP;
1894 if (align & FL_ALIGN_RIGHT) a1 |= FL_ALIGN_BOTTOM;
1895 if (align & FL_ALIGN_TOP) a1 |= FL_ALIGN_RIGHT;
1896 if (align & FL_ALIGN_BOTTOM) a1 |= FL_ALIGN_LEFT;
1897 fl_draw(str, -(y+h), x, h, w, (Fl_Align)a1, draw_rot90);
1898 +#endif
1899 if (align & FL_ALIGN_CLIP) fl_pop_clip();
1900 }
1901