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
5 // nothing is done if this is not defined:
6 //#define AUTO_RAISE 0.5
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
12 +#define SMART_PLACEMENT 1
14 // set this to zero to remove the multiple-desktop code. This will
15 // make flwm about 20K smaller
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
21 +flwm (1.01-1) unstable; urgency=low
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.
31 + -- Bill Allombert <ballombe@debian.org> Fri, 30 Jun 2006 01:17:06 +0200
33 flwm (1.00-10) unstable; urgency=low
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
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
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
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
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
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
66 -patching file Frame.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
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
78 -patching file Frame.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
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
97 +#! /bin/sh /usr/share/dpatch/dpatch-run
98 +## 100_double_ampersand.dpatch by <ballombe@debian.org>
100 +## All lines beginning with `## DP:' are a description of the patch.
101 +## DP: fix handling of ampersand in titles in windows list.
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
109 + while (t < buf+254 && *l) {
110 + if (*l=='&') *t++ = *l;
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
120 -#! /bin/sh /usr/share/dpatch/dpatch-run
121 -## 100_fl_filename_name.dpatch by Tommi Virtanen <tv@debian.org>
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.
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
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(
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
144 -#! /bin/sh /usr/share/dpatch/dpatch-run
145 -## 101_visible_focus.dpatch by Bill Allombert <ballombe@debian.org>
147 -## All lines beginning with `## DP:' are a description of the patch.
148 -## DP: Restore fltk-1.0 focus behaviour
149 -## DP: (Applied upstream)
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
156 - XFree((void *)wins);
159 -+ Fl::visible_focus(0);
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
167 -#! /bin/sh /usr/share/dpatch/dpatch-run
168 -## 102_charstruct.dpatch by Tommi Virtanen <tv@debian.org>
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).
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;
184 - index = ichar-fontstruct->min_char_or_byte2;
187 -+ if (fontstruct->per_char) {
188 -+ charstruct = &fontstruct->per_char[index];
190 -+ charstruct = &fontstruct->min_bounds;
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;
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
216 -#! /bin/sh /usr/share/dpatch/dpatch-run
217 -## 103_man_typo.dpatch by Bill Allombert <ballombe@debian.org>
219 -## All lines beginning with `## DP:' are a description of the patch.
220 -## DP: Fix typo in man page.
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
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
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
239 -#! /bin/sh /usr/share/dpatch/dpatch-run
240 -## 104_g++-4.1-warning.dpatch by Bill Allombert <ballombe@debian.org>
242 -## All lines beginning with `## DP:' are a description of the patch.
243 -## DP: Fix 5 g++ -4.1 warnings
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 @@
251 - unsigned long n, extra;
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;
264 -+ return (void *)prop;
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
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);
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
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)'?'];
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
301 -#! /bin/sh /usr/share/dpatch/dpatch-run
302 -## 105_double_ampersand.dpatch by Bill Allombert <ballombe@debian.org>
304 -## All lines beginning with `## DP:' are a description of the patch.
305 -## DP: Handle & in window titles correctly in the windows list.
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
312 - #include <dirent.h>
313 - #include <sys/stat.h>
315 -+static char *double_ampersand(const char *s)
318 -+ for(i=0,l=0;s[i];i++)
321 -+ char *c = new (char [l+i+1]);
322 -+ for(i=0,l=0;s[i];i++)
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
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);
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
353 ## DP: Add Debian menu support.
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 @@
365 if (path[strlen(path)-1] != '/') strcat(path, "/");
366 strcat(path, ".wmx/");
368 if (st.st_mtime == wmx_time) return;
369 wmx_time = st.st_mtime;
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 @@
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
384 -#! /bin/sh /usr/share/dpatch/dpatch-run
385 -## 201_background_color.dpatch by Bill Allombert <ballombe@debian.org>
387 -## All lines beginning with `## DP:' are a description of the patch.
388 -## DP: Fix -fg and -bg options
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
395 - min_w_button.callback(button_cb_static);
397 - box(FL_NO_BOX); // relies on background color erasing interior
398 -+ labelcolor(FL_FOREGROUND_COLOR);
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);
410 - #if defined(SHOW_CLOCK)
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);
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
425 - if (y+h > SCREEN_H) y = SCREEN_H-h;
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);
434 - m.labelfont(MENU_FONT_SLOT);
435 - m.labelsize(MENU_FONT_SIZE);
436 -- m.labelcolor(FL_BLACK);
437 -+ m.labelcolor(FL_FOREGROUND_COLOR);
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
445 -#! /bin/sh /usr/share/dpatch/dpatch-run
446 -## 203_background_color.dpatch by <ballombe@debian.org>
448 -## All lines beginning with `## DP:' are a description of the patch.
449 -## DP: fix the -fg -bg, -bg2 options.
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);
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();
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();
484 -@@ -280,10 +287,10 @@
487 - m.labeltype(FL_NORMAL_LABEL);
488 -+ m.labelcolor(FL_FOREGROUND_COLOR);
490 - m.labelfont(MENU_FONT_SLOT);
491 - m.labelsize(MENU_FONT_SIZE);
492 -- m.labelcolor(FL_FOREGROUND_COLOR);
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;
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 @@
517 - menu[n].labeltype(TEXT_LABEL);
518 -+ menu[n].labelcolor(FL_FOREGROUND_COLOR);
521 - int nextlev = (i==num_wmx-1)?0:strspn(wmxlist[i+1], "/")-1;
522 - if (nextlev < level) {
523 -@@ -621,8 +633,11 @@
526 - // fix the menus items so they are indented to align with window names:
527 -- while (menu[n].label()) menu[n++].labeltype(TEXT_LABEL);
529 -+ while (menu[n].label())
531 -+ menu[n].labelcolor(FL_FOREGROUND_COLOR);
532 -+ menu[n++].labeltype(TEXT_LABEL);
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
541 +# Site Directory Pattern Version Script
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).
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.
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
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
570 while {[gets $f list]>=0} {
571 - if [llength $list]<3 continue
573 + catch {set n [llength $list]}
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
582 #include <FL/fl_draw.H>
586 static Atom wm_state = 0;
587 static Atom wm_change_state;
588 static Atom wm_protocols;
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) :
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")
602 +#if FL_MAJOR_VERSION > 1
603 + clear_double_buffer();
605 close_button.callback(button_cb_static);
606 iconize_button.callback(button_cb_static);
607 max_h_button.type(FL_TOGGLE_BUTTON);
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));
628 // move window so contents and border are visible:
629 x(force_x_onscreen(x(), w()));
630 y(force_y_onscreen(y(), h()));
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,
641 @@ -278,15 +272,140 @@
642 sendConfigureNotify(); // many apps expect this even if window size unchanged
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);
652 if (state_ == NORMAL) {
653 XMapWindow(fl_display, fl_xid(this));
654 if (!existing) activate_if_transient();
660 +// Helper functions for "smart" window placement.
661 +int overlap1(int p1, int l1, int p2, int l2) {
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);
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));
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) {
683 + for (Frame* f = first; f; f = f->next) {
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) {
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;
707 + int max_x = Root->x() + Root->w();
708 + int max_y = Root->y() + Root->h();
710 + Frame *f1 = Frame::first;
711 + for(int i=0;; i++) {
715 + tmp_x = max_x - _w;
723 + tmp_x = f1->x() + f1->w();
726 + Frame *f2 = Frame::first;
727 + for(int j=0;; j++) {
731 + tmp_y = max_y - _h;
739 + tmp_y = f2->y() + f2->h();
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) {
748 + min_overlap = tmp_o;
749 + if (min_overlap == 0) {
755 + if (min_overlap == 0) {
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));
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:
788 +#if FL_MAJOR_VERSION < 2
795 // remove any pointers to this:
796 Frame** cp; for (cp = &first; *cp; cp = &((*cp)->next))
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);
804 // see if it is forcing the iconize button back on. This makes
805 // transient_for act like group instead...
807 delete[] window_Colormaps;
810 - Window* cw = (Window*)getProperty(wm_colormap_windows, XA_WINDOW, &n);
811 + XWindow* cw = (XWindow*)getProperty(wm_colormap_windows, XA_WINDOW, &n);
813 colormapWinCount = n;
814 colormapWindows = cw;
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();
828 -#if defined(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);
836 -#if defined(SHOW_CLOCK)
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)
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);
853 -#if defined(SHOW_CLOCK)
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_);
871 XAddToSaveSet(fl_display, window_);
872 } else if (oldstate == NORMAL) {
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_);
880 return; // don't setStateProperty IconicState multiple times
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();
892 +#if 1 //def SHOW_CLOCK
893 int t = label_y + 3; // we have to clear the entire label area
896 @@ -1076,6 +1197,12 @@
898 // make sure fltk does not try to set the window size:
899 void Frame::resize(int, int, int, int) {}
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
907 ////////////////////////////////////////////////////////////////
909 @@ -1111,19 +1238,28 @@
911 ////////////////////////////////////////////////////////////////
913 +#if FL_MAJOR_VERSION>1
914 +# include <fltk/Box.h>
918 if (flag(NO_BORDER)) return;
919 if (!flag(THIN_BORDER)) Fl_Window::draw();
920 if (damage() != FL_DAMAGE_CHILD) {
923 fl_frame2(active() ? "AAAAJJWW" : "AAAAJJWWNNTT",0,0,w(),h());
925 fl_color(FL_GRAY_RAMP+('N'-'A'));
926 fl_xyline(2, h()-3, w()-3, 2);
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()));
934 fl_frame("AAAAWWJJTTNN",0,0,w(),h());
937 if (!flag(THIN_BORDER) && label_h > 3) {
939 @@ -1169,39 +1305,48 @@
942 void FrameButton::draw() {
943 +#if FL_MAJOR_VERSION>1
944 + const int x = value()?1:0;
946 + drawstyle(style(),flags()|fltk::OUTPUT);
947 + FL_UP_BOX->draw(Rectangle(w(),h()));
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);
953 fl_color(parent()->labelcolor());
954 switch (label()[0]) {
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);
964 - fl_rect(x()+(h()-7)/2,y()+3,2,h()-6);
965 + fl_rect(x+(h()-7)/2,y+3,2,h()-6);
969 - fl_rect(x()+2,y()+(h()-7)/2,w()-4,7);
970 + fl_rect(x+2,y+(h()-7)/2,w()-4,7);
973 - fl_rect(x()+(h()-7)/2,y()+2,7,h()-4);
974 + fl_rect(x+(h()-7)/2,y+2,7,h()-4);
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);
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);
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);
1001 @@ -1320,6 +1465,9 @@
1005 +#if FL_MAJOR_VERSION>1
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);
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);
1030 + if (Fl_Group::handle(e) && e != FL_ENTER && e != FL_MOVE) {
1031 if (e == FL_PUSH) set_cursor(-1);
1038 @@ -1381,42 +1537,33 @@
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:
1049 switch (fl_xevent->type) {
1052 + if (fl_xevent->xcrossing.detail == NotifyInferior) {
1053 + // cursor moved from frame to interior
1054 + cursor_inside = this;
1057 + // cursor moved to another window
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;
1068 // cursor is now pointing at frame:
1072 - // fall through to FL_MOVE:
1076 - if (fl_xevent->xcrossing.detail == NotifyInferior) {
1077 - // cursor moved from frame to interior
1078 - cursor_inside = this;
1085 - return 0; // other X event we don't understand
1089 if (Fl::belowmouse() != this || cursor_inside == this)
1092 @@ -1578,9 +1725,10 @@
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);
1105 case DestroyNotify: {
1106 @@ -1677,7 +1825,7 @@
1107 return ::getProperty(window_, a, type, np);
1110 -void* getProperty(Window w, Atom a, Atom type, int* np) {
1111 +void* getProperty(XWindow w, Atom a, Atom type, int* np) {
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;
1123 int Frame::getIntProperty(Atom a, Atom type, int deflt) const {
1124 return ::getIntProperty(window_, a, type, deflt);
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 @@
1136 -void setProperty(Window w, Atom a, Atom type, int v) {
1137 +void setProperty(XWindow w, Atom a, Atom type, int v) {
1139 XChangeProperty(fl_display, w, a, type, 32, PropModeReplace, (uchar*)&prop,1);
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
1145 #include <FL/Fl_Window.H>
1146 #include <FL/Fl_Button.H>
1148 +#if FL_MAJOR_VERSION<2
1149 +# define XWindow Window
1152 // The state is an enumeration of reasons why the window may be invisible.
1153 // Only if it is NORMAL is the window visible.
1156 class Frame : public Fl_Window {
1161 short state_; // X server state: iconic, withdrawn, normal
1162 short state_flags_; // above state flags
1164 int label_y, label_h; // location of label
1165 int label_w; // measured width of printed label
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
1171 Frame* revert_to; // probably the xterm this was run from
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
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();
1186 void sendMessage(Atom, Atom) const;
1187 void sendConfigureNotify() const;
1190 void set_size(int,int,int,int, int warp=0);
1191 void resize(int,int,int,int);
1193 void show_hide_buttons();
1195 int handle(int); // handle fltk events
1196 @@ -151,10 +156,10 @@
1197 static Frame* first;
1198 Frame* next; // stacking order, top to bottom
1200 - Frame(Window, XWindowAttributes* = 0);
1201 + Frame(XWindow, XWindowAttributes* = 0);
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;
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);
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 @@
1228 +#if FL_MAJOR_VERSION > 1
1229 +// Define missing function, this should get put in fltk2.0:
1231 +int test_shortcut(int shortcut) {
1232 + if (!shortcut) return 0;
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;
1242 + int key = shortcut & 0xffff;
1244 + // if shift is also correct, check for exactly equal keysyms:
1245 + if (!(mismatch&(FL_SHIFT)) && unsigned(key) == Fl::event_key()) return 1;
1247 + // try matching ascii, ignore shift:
1248 + if (key == event_text()[0]) return 1;
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;
1258 int Handle_Hotkey() {
1259 for (int i = 0; keybindings[i].key; i++) {
1260 if (Fl::test_shortcut(keybindings[i].key) ||
1262 extern Fl_Window* Root;
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
1274 +# data file for the FLTK User Interface Designer (FLUID)
1281 +Function {make_window()} {open
1283 + {fltk::Window} {} {
1285 + xywh {990 285 265 115} visible
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
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
1297 class Fl_Root : public Fl_Window {
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();
1307 if (!shown()) Fl_X::set_xid(this, RootWindow(fl_display, fl_screen));
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);
1326 - case KeyRelease: {
1327 +#if FL_MAJOR_VERSION<2
1328 + // this was needed for *some* earlier versions of fltk
1330 if (!Fl::grab()) return 0;
1331 - // see if they released the alt key:
1332 - unsigned long 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);
1343 + } else if (e == FL_KEYUP) {
1344 +#if FL_MAJOR_VERSION<2
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);
1354 + return Fl::grab()->handle(FL_KEYBOARD);
1357 - } else if (e == FL_SHORTCUT) {
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 @@
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;
1372 static int cursor = FL_CURSOR_ARROW;
1374 -static void color_setup(Fl_Color slot, const char* arg, ulong value) {
1377 - if (XParseColor(fl_display, fl_colormap, arg, &x))
1378 - value = ((x.red>>8)<<24)|((x.green>>8)<<16)|((x.blue));
1380 - Fl::set_color(slot, value);
1384 static void initialize() {
1386 Display* d = fl_display;
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));
1395 Frame* frame = new Frame(w);
1396 + frame->label("flwm test window");
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);
1409 Root->cursor((Fl_Cursor)cursor, CURSOR_FG_SLOT, CURSOR_BG_SLOT);
1411 + Fl::visible_focus(0);
1414 Fl::set_font(TITLE_FONT_SLOT, TITLE_FONT);
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);
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);
1426 // find all the windows and create a Frame for each:
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) {
1434 XFree((void *)wins);
1437 - Fl::visible_focus(0);
1440 ////////////////////////////////////////////////////////////////
1441 @@ -329,8 +347,10 @@
1443 } else if (!strcmp(s, "cbg")) {
1445 +#if FL_MAJOR_VERSION < 2
1446 } else if (*s == 'c') {
1449 } else if (*s == 'v') {
1450 int visid = atoi(v);
1452 @@ -351,6 +371,17 @@
1456 +#if FL_MAJOR_VERSION<2
1457 +static void color_setup(Fl_Color slot, const char* arg, ulong value) {
1460 + if (XParseColor(fl_display, fl_colormap, arg, &x))
1461 + value = ((x.red>>8)<<24)|((x.green>>8)<<16)|((x.blue));
1463 + Fl::set_color(slot, value);
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;
1474 +#if FL_MAJOR_VERSION>1
1475 + if (cfg) fl_cursor_fg = fltk::color(cfg);
1476 + if (cbg) fl_cursor_bg = fltk::color(cbg);
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();
1486 +#if FL_MAJOR_VERSION>1
1487 + // show() is not a virtual function in fltk2.0, this fools it:
1488 + fltk::load_theme();
1491 Root->show(argc,argv); // fools fltk into using -geometry to set the size
1492 XSetErrorHandler(xerror_handler);
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
1504 CXXFILES = main.C Frame.C Rotated.C Menu.C FrameWindow.C Desktop.C Hotkeys.C
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
1511 #include <sys/stat.h>
1513 -static char *double_ampersand(const char *s)
1516 - for(i=0,l=0;s[i];i++)
1519 - char *c = new (char [l+i+1]);
1520 - for(i=0,l=0;s[i];i++)
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
1536 extern Fl_Window* Root;
1538 +#if FL_MAJOR_VERSION < 2
1540 frame_label_draw(const Fl_Label* o, int X, int Y, int W, int H, Fl_Align align)
1542 @@ -108,11 +91,19 @@
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:
1552 + if (strchr(l,'&')) {
1554 + while (t < buf+254 && *l) {
1555 + if (*l=='&') *t++ = *l;
1561 fl_draw(l, X+MENU_ICON_W+3, Y, W-MENU_ICON_W-3, H, align);
1567 #define FRAME_LABEL FL_FREE_LABELTYPE
1568 #define TEXT_LABEL Fl_Labeltype(FL_FREE_LABELTYPE+1)
1570 +#endif // FL_MAJOR_VERSION < 2
1572 ////////////////////////////////////////////////////////////////
1577 #if ASK_FOR_NEW_DESKTOP_NAME
1579 -static Fl_Input* new_desktop_input;
1580 +static Fl_Input* new_desktop_input = 0;
1583 new_desktop_ok_cb(Fl_Widget* w, void*)
1586 exit_cb(Fl_Widget*, void*)
1588 + printf("exit_cb\n");
1589 Frame::save_protocol();
1594 logout_cb(Fl_Widget*, void*)
1596 - static FrameWindow* w;
1597 + static FrameWindow* w = 0;
1599 w = new FrameWindow(190,90);
1600 Fl_Box* l = new Fl_Box(0, 0, 190, 60, "Really log out?");
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);
1612 @@ -299,7 +293,11 @@
1616 +#if FL_MAJOR_VERSION > 2
1617 + m.flags = fltk::RAW_LABEL;
1621 m.labeltype(FL_NORMAL_LABEL);
1623 m.labelfont(MENU_FONT_SLOT);
1624 @@ -444,8 +442,10 @@
1625 static char beenhere;
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);
1633 Fl_Menu_Item* m = other_menu_items+num_other_items-2;
1635 @@ -532,8 +532,12 @@
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);
1643 + init(menu[n],c->label());
1645 menu[n].callback(frame_callback, c);
1646 if (is_active_frame(c)) preset = menu+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);
1656 + init(menu[n],c->label());
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 @@
1663 cmd += strspn(cmd, "/")-1;
1664 init(menu[n], cmd+pathlen[level]);
1665 +#if FL_MAJOR_VERSION < 2
1670 menu[n].labeltype(TEXT_LABEL);
1672 - int nextlev = (i==num_wmx-1)?0:strspn(wmxlist[i+1], "/")-1;
1674 + int nextlev = (i==num_wmx-1)?0:strspn(wmxlist[i+1], "/")-1;
1675 if (nextlev < level) {
1676 menu[n].callback(spawn_cb, cmd);
1678 @@ -638,15 +648,19 @@
1681 memcpy(menu+n, other_menu_items, sizeof(other_menu_items));
1682 +#if FL_MAJOR_VERSION < 2
1686 // fix the menus items so they are indented to align with window names:
1687 while (menu[n].label()) menu[n++].labeltype(TEXT_LABEL);
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);
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
1702 Patches applied in the Debian version of :
1704 -debian/patches/100_fl_filename_name.dpatch (Tommi Virtanen <tv@debian.org>):
1705 - Transition from fltk-1.0 to fltk-1.1.
1708 -debian/patches/101_visible_focus.dpatch (Bill Allombert <ballombe@debian.org>):
1709 - Restore fltk-1.0 focus behaviour
1710 - (Applied upstream)
1712 -debian/patches/102_charstruct.dpatch (Tommi Virtanen <tv@debian.org>):
1713 - Support fonts for which fontstruct->per_char is NULL.
1714 - (Applied upstream).
1716 -debian/patches/103_man_typo.dpatch (Bill Allombert <ballombe@debian.org>):
1717 - Fix typo in man page.
1719 -debian/patches/104_g++-4.1_warning.dpatch (Bill Allombert <ballombe@debian.org>):
1720 - Fix 5 g++ -4.1 warnings
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.
1727 debian/patches/200_Debian_menu.dpatch (Tommi Virtanen <tv@debian.org>):
1728 Add Debian menu support.
1730 -debian/patches/201_background_color.dpatch (Bill Allombert <ballombe@debian.org>):
1731 - Fix -fg and -bg options
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
1737 ----------------------------------------------------------------
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.
1743 To customize flwm (for instance to turn on click-to-type), edit the
1747 ----------------------------------------------------------------
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.
1760 -Recommended contents of ~/.xinitrc:
1761 +The .xinitrc or .xsession file should look like this:
1764 xsetroot -solid \#006060
1766 -# <xset, xmodmap, other configuration programs>
1767 +# xset, xmodmap, other configuration programs
1770 -# <xterm, other automatically-launched programs>
1771 +# xterm, other automatically-launched programs
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
1779 /* ********************************************************************** */
1782 +#if FL_MAJOR_VERSION < 2
1783 +# define XWindow Window
1785 #include <FL/fl_draw.H>
1786 #include "Rotated.H"
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;
1803 index = ichar-fontstruct->min_char_or_byte2;
1805 - if (fontstruct->per_char) {
1806 - charstruct = &fontstruct->per_char[index];
1808 + XCharStruct* charstruct;
1809 + if (fontstruct->per_char)
1810 + charstruct = fontstruct->per_char+index;
1812 charstruct = &fontstruct->min_bounds;
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;
1832 /* some space chars have zero body, but a bitmap can't have ... */
1833 if (!ascent && !descent)
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('?')];
1844 /* free pixmap and GC ... */
1845 XFreePixmap(dpy, canvas);
1846 @@ -358,23 +355,25 @@
1848 static XRotFontStruct* font;
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;
1858 - if (font && font->xfontstruct == fl_xfont && font->dir == dir) {
1861 - if (font) XRotUnloadFont(fl_display, font);
1862 - font = XRotLoadFont(fl_display, fl_xfont, dir);
1864 + if (font->xfontstruct == fl_xfont && font->dir == dir) return;
1865 + XRotUnloadFont(fl_display, font);
1867 + font = XRotLoadFont(fl_display, fl_xfont, dir);
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);
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
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));
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);
1899 if (align & FL_ALIGN_CLIP) fl_pop_clip();