Gentoo Archives: gentoo-commits

From: "Fabian Groffen (grobian)" <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo commit in src/patchsets/windowmaker/0.92.0: WindowMaker-0.91.0-alt-adialog.patch WindowMaker-0.91.0-alt-clipnotext.patch windowmaker-0.92.0-app-icon-fix.patch windowmaker-0.92.0-composite-non-24bit-depth.patch windowmaker-0.92.0-darwin-setlocale.patch windowmaker-0.92.0-dialog-history.patch windowmaker-0.92.0-doubleclick-maximise.patch windowmaker-0.92.0-empty-command-fatal-error.patch windowmaker-0.92.0-findfile-overflow.patch windowmaker-0.92.0-gettext.patch windowmaker-0.92.0-gif-before-ungif.patch windowmaker-0.92.0-interix3.patch windowmaker-0.92.0-math_h.patch windowmaker-0.92.0-maximise-borderless-too-small.patch windowmaker-0.92.0-mouse-window-focus.patch windowmaker-0.92.0-nls.patch windowmaker-0.92.0-no-clip-title.patch windowmaker-0.92.0-no-pop-empty-array.patch windowmaker-0.92.0-pointer-integer-warn-fix.patch windowmaker-0.92.0-single-click-dockapp-start.patch windowmaker-0.92.0-workspace-change-crash.patch windowmaker-0.92.0-xcha ngeproperty-64bit s-fix.patch windowmaker-0.92.0-xinerama-switchpanel-corruption.patch wlist-0.9x.patch
Date: Wed, 01 Dec 2010 17:47:10
Message-Id: 20101201174652.467AB20054@flycatcher.gentoo.org
1 grobian 10/12/01 17:46:52
2
3 Added: windowmaker-0.92.0-app-icon-fix.patch
4 windowmaker-0.92.0-composite-non-24bit-depth.patch
5 windowmaker-0.92.0-darwin-setlocale.patch
6 windowmaker-0.92.0-dialog-history.patch
7 windowmaker-0.92.0-doubleclick-maximise.patch
8 windowmaker-0.92.0-empty-command-fatal-error.patch
9 windowmaker-0.92.0-findfile-overflow.patch
10 windowmaker-0.92.0-gettext.patch
11 windowmaker-0.92.0-gif-before-ungif.patch
12 windowmaker-0.92.0-interix3.patch
13 windowmaker-0.92.0-math_h.patch
14 windowmaker-0.92.0-maximise-borderless-too-small.patch
15 windowmaker-0.92.0-mouse-window-focus.patch
16 windowmaker-0.92.0-nls.patch
17 windowmaker-0.92.0-no-clip-title.patch
18 windowmaker-0.92.0-no-pop-empty-array.patch
19 windowmaker-0.92.0-pointer-integer-warn-fix.patch
20 windowmaker-0.92.0-single-click-dockapp-start.patch
21 windowmaker-0.92.0-workspace-change-crash.patch
22 windowmaker-0.92.0-xchangeproperty-64bits-fix.patch
23 windowmaker-0.92.0-xinerama-switchpanel-corruption.patch
24 wlist-0.9x.patch
25 Removed: WindowMaker-0.91.0-alt-adialog.patch
26 WindowMaker-0.91.0-alt-clipnotext.patch
27 Log:
28 windowmaker-0.92.0-patchset-2
29
30 Revision Changes Path
31 1.1 src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-app-icon-fix.patch
32
33 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-app-icon-fix.patch?rev=1.1&view=markup
34 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-app-icon-fix.patch?rev=1.1&content-type=text/plain
35
36 Index: windowmaker-0.92.0-app-icon-fix.patch
37 ===================================================================
38
39 # HG changeset patch
40 # User Vladimir Nadvornik <nadvornik@××××.cz>
41 # Date 1250812164 -7200
42 # Node ID 016cb2f2fbd035dae812f914fbff17e916fec86a
43 # Parent c24c1b6787cac93c80689d4fff21fd6930388a20
44 Fix findBestIcon()
45
46 This patch fixes the issue described here:
47
48 https://bugzilla.novell.com/show_bug.cgi?id=371974
49
50 Transplanted from git://repo.or.cz/wmaker-crm.git
51 commit e113ec10c9add6e3001c583a2c87b4a33cfb255b
52
53 --- a/src/wmspec.c Tue Aug 14 15:32:00 2007 +0400
54 +++ b/src/wmspec.c Fri Aug 21 01:49:24 2009 +0200
55 @@ -402,7 +402,7 @@
56 * results in better overall aesthetics -Dan */
57 wanted = wPreferences.icon_size * wPreferences.icon_size;
58
59 - for (icon=NULL, distance=LONG_MAX, i=0L; i<items-1; ) {
60 + for (icon=NULL, distance=wanted, i=0L; i<items-1; ) {
61 size = data[i] * data[i+1];
62 if (size==0)
63 break;
64
65
66
67
68 1.1 src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-composite-non-24bit-depth.patch
69
70 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-composite-non-24bit-depth.patch?rev=1.1&view=markup
71 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-composite-non-24bit-depth.patch?rev=1.1&content-type=text/plain
72
73 Index: windowmaker-0.92.0-composite-non-24bit-depth.patch
74 ===================================================================
75
76 # HG changeset patch
77 # User John H. Robinson, IV <jaqque@××××.org>
78 # Date 1225082572 25200
79 # Node ID ce1b81cb49375becb2268da560cb586f9aaf7bb6
80 # Parent e07d85ba8a2719cdd2e50715405bac2cc7e69f6c
81 Workaround for Composite problems when default depth is not 24.
82
83 This is really a workaround patch, the proper fix would be to have
84 WindowMaker know about Composite, and take advantage of its features.
85
86 Author: Paulo Cesar Pereira de Andrade <pcpa@××××××××××××.br>
87
88 --- a/src/main.c Thu Apr 27 12:16:58 2006 -0700
89 +++ b/src/main.c Sun Oct 26 21:42:52 2008 -0700
90 @@ -828,6 +828,16 @@
91 exit(1);
92 }
93
94 + if (wVisualID < 0)
95 + /*
96 + * If unspecified, use default visual instead of waiting
97 + * for wrlib/context.c:bestContext() that may end up choosing
98 + * the "fake" 24 bits added by the Composite extension.
99 + * This is required to avoid all sort of corruptions when
100 + * composite is enabled, and at a depth other than 24.
101 + */
102 + wVisualID = (int)DefaultVisual(dpy, DefaultScreen(dpy))->visualid;
103 +
104 /* check if the user specified a complete display name (with screen).
105 * If so, only manage the specified screen */
106 if (DisplayName)
107
108
109
110
111 1.1 src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-darwin-setlocale.patch
112
113 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-darwin-setlocale.patch?rev=1.1&view=markup
114 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-darwin-setlocale.patch?rev=1.1&content-type=text/plain
115
116 Index: windowmaker-0.92.0-darwin-setlocale.patch
117 ===================================================================
118 --- configure.ac
119 +++ configure.ac
120 @@ -336,6 +336,8 @@
121 case $host_os in
122 freebsd*)
123 AC_CHECK_LIB(xpg4, setlocale, [LIBS="$LIBS -lxpg4"]);;
124 + darwin*)
125 + AC_CHECK_LIB([X11], setlocale, [LIBS="$LIBS -lX11"]);;
126 *)
127 ;;
128 esac
129
130
131
132 1.1 src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-dialog-history.patch
133
134 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-dialog-history.patch?rev=1.1&view=markup
135 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-dialog-history.patch?rev=1.1&content-type=text/plain
136
137 Index: windowmaker-0.92.0-dialog-history.patch
138 ===================================================================
139
140 # HG changeset patch
141 # User John H. Robinson, IV <jaqque@××××.org>
142 # Date 1229205460 28800
143 # Node ID 85840502e696838a1a4caf845c1687a81f29e73c
144 # Parent ded22ccbb04f0893e7d33055066674c9a3116bd8
145 Added WMGetTextFieldCursorPosition
146
147 This patch adds a function WMGetTextFieldCursorPosition to the WINGs library.
148 This function is used by the 'adialog' patch.
149
150 Submitted by: Gilbert Ashley <amigo@×××××××.org>
151 Author: unknown
152 Origin: ALT/Sisyphus Linux, Alexey Voinov <voins@××××××××.ru>
153
154 --- a/WINGs/WINGs/WINGs.h Sat Dec 13 13:53:46 2008 -0800
155 +++ b/WINGs/WINGs/WINGs.h Sat Dec 13 13:57:40 2008 -0800
156 @@ -1125,6 +1125,8 @@
157
158 void WMSetTextFieldCursorPosition(WMTextField *tPtr, unsigned int position);
159
160 +unsigned WMGetTextFieldCursorPosition(WMTextField *tPtr);
161 +
162 void WMSetTextFieldNextTextField(WMTextField *tPtr, WMTextField *next);
163
164 void WMSetTextFieldPrevTextField(WMTextField *tPtr, WMTextField *prev);
165 --- a/WINGs/wtextfield.c Sat Dec 13 13:53:46 2008 -0800
166 +++ b/WINGs/wtextfield.c Sat Dec 13 13:57:40 2008 -0800
167 @@ -659,6 +659,14 @@
168 paintTextField(tPtr);
169 }
170 }
171 +}
172 +
173 +unsigned
174 +WMGetTextFieldCursorPosition(WMTextField *tPtr)
175 +{
176 + CHECK_CLASS(tPtr, WC_TextField);
177 +
178 + return tPtr->cursorPosition;
179 }
180
181
182
183
184 # HG changeset patch
185 # User John H. Robinson, IV <jaqque@××××.org>
186 # Date 1229206241 28800
187 # Node ID 714532b354dd0e89ae06060d64916ac592ba7e99
188 # Parent 85840502e696838a1a4caf845c1687a81f29e73c
189 Adds history to some dialog boxes
190
191 This patch adds history to some dialog boxes. To use it replace %a with %A in
192 menu file (like in "Run..." menu item).You can specify third parameter to %A to
193 use different histories for differen dialogs. All history files is kept in
194 ~/GNUstep/.AppInfo/WindowMaker/. Number of history lines controlled by
195 DialogHistoryLines parameter (one for all dialogs). Default is to keep 500
196 lines. Also commands and directories completion added. Press Tab to complete
197 something.
198
199 Author: unknown
200 Origin: ALT/Sisyphus Linux, Alexey Voinov <voins@××××××××.ru>
201 Submitted by: Gilbert Ashley
202
203 I've added the fragments to patch the default menu files, so that this feature
204 is enabled by default.
205
206 --- a/WindowMaker/menu Sat Dec 13 13:57:40 2008 -0800
207 +++ b/WindowMaker/menu Sat Dec 13 14:10:41 2008 -0800
208 @@ -116,7 +116,7 @@
209 "Process List" EXEC xterm -e top
210 "Manual Browser" EXEC xman
211 "Info" END
212 - "Run..." SHEXEC %a(Run,Type command to run:)
213 + "Run..." SHEXEC %A(Run,Type command to run:)
214 "XTerm" EXEC xterm -sb
215 "Mozilla Firefox" EXEC firefox
216 "Workspaces" WORKSPACE_MENU
217 --- a/WindowMaker/menu.bg Sat Dec 13 13:57:40 2008 -0800
218 +++ b/WindowMaker/menu.bg Sat Dec 13 14:10:41 2008 -0800
219 @@ -1,222 +1,222 @@
220 -/*
221 - * Дефиниция на главното меню за WindowMaker
222 - *
223 - * Синтаксисът е:
224 - *
225 - * <Заглавие> [SHORTCUT <комбинация>] <команда> <параметри>
226 - *
227 - * <Заглавие> е какъв да е низ, който ще се използва като название на
228 - * съответния елемент от менюто. Ако включва интервали, трябва да се
229 - * огради с ".
230 - *
231 - * SHORTCUT определя клавишна комбинация ("бърз клавиш") за този
232 - * елемент на менюто. <комбинация> има същия синтаксис, както клавишните
233 - * комбинации във файла $HOME/GNUstep/Defaults/WindowMaker,
234 - * напр. RootMenuKey или MiniaturizeKey.
235 - *
236 - * Не може да се посочва клавишна комбинация за MENU и OPEN_MENU.
237 - *
238 - * <Command> може да бъде:
239 - * MENU - започва дефиниция на (под)меню
240 - * END - завършва дефиницията на (под)меню
241 - * OPEN_MENU - чете менюто от файл, програмен канал или
242 - * файловете от директория, евентуално предшествани
243 - * от команда.
244 - * WORKSPACE_MENU - добавя подменю за работните места. Може да се
245 - * използва само едно такова подменю.
246 - * EXEC <program> - изпълнява външна програма
247 - * SHEXEC <command> - изпълнява команда на командната обвивка
248 - * (напр. gimp > /dev/null)
249 - * EXIT - излиза от администратора на прозорците
250 - * RESTART [<администратор>] - рестартира WindowMaker или
251 - * страртира друг администратор на
252 - * прозорците
253 - * REFRESH - опреснява (прерисува) работната площ
254 - * ARRANGE_ICONS - преподрежда иконките на работното място.
255 - * SHUTDOWN - убива всички клиенти (и приключва X-сесията)
256 - * SHOW_ALL - показва всички скрити прозорци на работното място
257 - * HIDE_OTHERS - скрива всички прозорци на работното място, освен
258 - * имащия фокус (или последния получавал фокус)
259 - * SAVE_SESSION - запазва текущото състояние на работната площ, в
260 - * това число всички стартирани приложения,
261 - * местата на прозорците им, на дока,
262 - * кламера. Това състояние ще бъде възстановено
263 - * при всяко стартиране на WindowMaker, докато
264 - * наново не се използва SAVE_SESSION или
265 - * CLEAR_SESSION. Ако SaveSessionOnExit = Yes в
266 - * конфигурационната база-данни на Window Maker,
267 - * то при всяко излизане от WindowMaker
268 - * състоянието на сесията автоматично ще бъде
269 - * запазено.
270 - * CLEAR_SESSION - изтрива данните за по-рано запазена
271 - * сесия. Това няма никакъв ефект, ако
272 - * SaveSessionOnExit = Yes.
273 - * INFO - показва панела "Инфо".
274 - *
275 - * Синтаксис на OPEN_MENU:
276 - * 1. Меню от файл:
277 - * // отваря файл-меню, който трябва да съдържа меню и го вмъква
278 - * // на текущото място.
279 - * OPEN_MENU файл-меню
280 - * 2. Меню от програмен канал:
281 - * // пуска командата и очаква тя да генерира меню на стандартния
282 - * // си изход.
283 - * OPEN_MENU | команда
284 - * 3. Меню от директория:
285 - * // Отваря едната или повече директории и прави сортирано
286 - * // азбучно меню за всички изпълними файлове и поддиректории в
287 - * // тях.
288 - * OPEN_MENU директория1 [директория2 ...]
289 - * 4. Меню от директория с команда
290 - * // Отваря едната или повече директории и прави сортирано
291 - * // азбучно меню за всички поддиректории и четими файлове, като
292 - * // всеки от файловете ще бъде обработван с командата.
293 - * OPEN_MENU [опции] директория1 [директория2 ...] WITH команда -опции
294 - * Опции:
295 - * -noext Пропуска всичко, което е след
296 - * последната точка в името на файла.
297 - *
298 - * <параметри> е програмата, която трябва да се изпълни.
299 - *
300 - * ** Опции за командния ред с EXEC:
301 - * %s - замества се с избраното в момента
302 - * %a(title[,prompt]) - отваря диалогова клетка с заглавие "title" и
303 - * незадължителна подкана prompt, след което се
304 - * замества с въведеното.
305 - * %w - замества се с XID (номера) на прозореца с фокус.
306 - * %W - замества се с номера на текущото работно място.
307 - *
308 - * Преди специалните символи (като % и ") може да поставяте \ за да
309 - * загубят специалното си значение:
310 - * пример: xterm -T "\"Hello World\""
311 - *
312 - * Допустими са и стандартните комбинации като \n
313 - *
314 - * Всяка команда MENU трябва да има съответна команда END.
315 - *
316 - * Пример:
317 - *
318 - * "Проба" MENU
319 - * "XTerm" EXEC xterm
320 - * // прави подменю със съдържимото от /usr/openwin/bin
321 - * "XView приложения" OPEN_MENU "/usr/openwin/bin"
322 - * // някои X11-приложения от различни директории
323 - * "X11 приложения" OPEN_MENU /usr/X11/bin $HOME/bin/X11
324 - * // за картинки на фона
325 - * "Фон" OPEN_MENU -noext $HOME/images /usr/share/images WITH wmsetbg -u -t
326 - * // Вмъква style.menu тук.
327 - * "Style" OPEN_MENU style.menu
328 - * "Проба" END
329 - */
330 -
331 -#include "wmmacros"
332 -
333 -"Applications" MENU
334 - "Инфо" MENU
335 - "Информационен панел..." INFO_PANEL
336 - "Лицензионен панел..." LEGAL_PANEL
337 - "Системна конзола" EXEC xconsole
338 - "Натоварване на системата" SHEXEC xosview || xload
339 - "Списък процеси" EXEC xterm -e top
340 - "Ръководства" EXEC xman
341 - "Инфо" END
342 - "Стартирай..." SHEXEC %a(Run,Въведете команда, която да се стартира:)
343 - "XTerm" EXEC xterm -sb
344 - "Rxvt" EXEC rxvt -bg black -fg white -fn fixed
345 - "Работни места" WORKSPACE_MENU
346 - "Приложения" MENU
347 - "Графични" MENU
348 - "Gimp" SHEXEC gimp >/dev/null
349 - "XV" EXEC xv
350 - "XPaint" EXEC xpaint
351 - "XFig" EXEC xfig
352 - "Графични" END
353 - "X File Manager" EXEC xfm
354 - "OffiX Files" EXEC files
355 - "LyX" EXEC lyx
356 - "Netscape" EXEC netscape
357 - "Ghostview" EXEC ghostview %a(GhostView,Enter file to view)
358 - "Acrobat" EXEC /usr/local/Acrobat3/bin/acroread %a(Acrobar,Enter PDF to view)
359 - "TkDesk" EXEC tkdesk
360 - "Приложения" END
361 - "Редактори" MENU
362 - "XFte" EXEC xfte
363 - "XEmacs" SHEXEC xemacs || emacs
364 - "XJed" EXEC xjed
365 - "NEdit" EXEC nedit
366 - "Xedit" EXEC xedit
367 - "VI" EXEC xterm -e vi
368 - "Редактори" END
369 - "Разни" MENU
370 - "Xmcd" SHEXEC xmcd 2> /dev/null
371 - "Xplaycd" EXEC xplaycd
372 - "Xmixer" EXEC xmixer
373 - "Разни" END
374 - "Инструменти" MENU
375 - "Калкукатор" EXEC xcalc
376 - "Свойства на прозореца" SHEXEC xprop | xmessage -center -title 'xprop' -file -
377 - "Избор на шрифт" EXEC xfontsel
378 - "Емулатор на терминал" EXEC xminicom
379 - "Лупа" EXEC xmag
380 - "Цветова палитра" EXEC xcmap
381 - "XKill" EXEC xkill
382 - "Clipboard" EXEC xclipboard
383 - "Инструменти" END
384 -
385 - "Избор" MENU
386 - "Copy" SHEXEC echo '%s' | wxcopy
387 - "Mail To" EXEC xterm -name mail -T "Pine" -e pine %s
388 - "Navigate" EXEC netscape %s
389 - "Search in Manual" SHEXEC MANUAL_SEARCH(%s)
390 - "Избор" END
391 -
392 - "Работно място" MENU
393 - "Скрий другите" HIDE_OTHERS
394 - "Покажи всички" SHOW_ALL
395 - "Подреди иконките" ARRANGE_ICONS
396 - "Опресни" REFRESH
397 - "Заключи" EXEC xlock -allowroot -usefirst
398 - "Запази сесията" SAVE_SESSION
399 - "Изчисти запазената сесия" CLEAR_SESSION
400 - "Работни места" END
401 -
402 - "Изглед" MENU
403 - "Теми" OPEN_MENU -noext THEMES_DIR $HOME/GNUstep/Library/WindowMaker/Themes WITH setstyle
404 - "Стилове" OPEN_MENU -noext STYLES_DIR $HOME/GNUstep/Library/WindowMaker/Styles WITH setstyle
405 - "Колекции иконки" OPEN_MENU -noext ICON_SETS_DIR $HOME/GNUstep/Library/WindowMaker/IconSets WITH seticons
406 - "Фон" MENU
407 - "Плътен" MENU
408 - "Черен" WS_BACK '(solid, black)'
409 - "Син" WS_BACK '(solid, "#505075")'
410 - "Тъмно виолетово" WS_BACK '(solid, "#243e6c")'
411 - "Силно синьо" WS_BACK '(solid, "#180090")'
412 - "Мораво" WS_BACK '(solid, "#554466")'
413 - "Пшеничен" WS_BACK '(solid, "wheat4")'
414 - "Тъмно сив" WS_BACK '(solid, "#333340")'
415 - "Винен" WS_BACK '(solid, "#400020")'
416 - "Плътен" END
417 - "Градиент" MENU
418 - "Слънце" WS_BACK '(mvgradient, deepskyblue4, black, deepskyblue4, tomato4)'
419 - "Небе" WS_BACK '(vgradient, blue4, white)'
420 - "Сини сенки" WS_BACK '(vgradient, "#7080a5", "#101020")'
421 - "Виолетови сенки" WS_BACK '(vgradient, "#746ebc", "#242e4c")'
422 - "Морави сенки" WS_BACK '(vgradient, "#654c66", "#151426")'
423 - "Пшенични сенки" WS_BACK '(vgradient, "#a09060", "#302010")'
424 - "Сиви сенки" WS_BACK '(vgradient, "#636380", "#131318")'
425 - "Винени сенки" WS_BACK '(vgradient, "#600040", "#180010")'
426 - "Градиент" END
427 - "Images" OPEN_MENU -noext BACKGROUNDS_DIR $HOME/GNUstep/Library/WindowMaker/Backgrounds WITH wmsetbg -u -t
428 - "Фон" END
429 - "Запази темата" SHEXEC getstyle -t $HOME/GNUstep/Library/WindowMaker/Themes/"%a(Theme name,Enter file name:)"
430 - "Запази колекцията иконки" SHEXEC geticonset $HOME/GNUstep/Library/WindowMaker/IconSets/"%a(IconSet name,Enter file name:)"
431 - "Пособие за настройки" EXEC /usr/local/GNUstep/Applications/WPrefs.app/WPrefs
432 - "Изглед" END
433 -
434 - "Изход" MENU
435 - "Рестартиране" RESTART
436 - "Стартирай BlackBox" RESTART blackbox
437 - "Стартирай kwm" RESTART kwm
438 - "Стартирай IceWM" RESTART icewm
439 - "Изход..." EXIT
440 - "Изход" END
441 -"Приложения" END
442 \ No newline at end of file
443 +/*
444 + * Дефиниция на главното меню за WindowMaker
445 + *
446 + * Синтаксисът е:
447 + *
448 + * <Заглавие> [SHORTCUT <комбинация>] <команда> <параметри>
449 + *
450 + * <Заглавие> е какъв да е низ, който ще се използва като название на
451 + * съответния елемент от менюто. Ако включва интервали, трябва да се
452 + * огради с ".
453 + *
454 + * SHORTCUT определя клавишна комбинация ("бърз клавиш") за този
455 + * елемент на менюто. <комбинация> има същия синтаксис, както клавишните
456 + * комбинации във файла $HOME/GNUstep/Defaults/WindowMaker,
457 + * напр. RootMenuKey или MiniaturizeKey.
458 + *
459 + * Не може да се посочва клавишна комбинация за MENU и OPEN_MENU.
460 + *
461 + * <Command> може да бъде:
462 + * MENU - започва дефиниция на (под)меню
463 + * END - завършва дефиницията на (под)меню
464 + * OPEN_MENU - чете менюто от файл, програмен канал или
465 + * файловете от директория, евентуално предшествани
466 + * от команда.
467 + * WORKSPACE_MENU - добавя подменю за работните места. Може да се
468 + * използва само едно такова подменю.
469 + * EXEC <program> - изпълнява външна програма
470 + * SHEXEC <command> - изпълнява команда на командната обвивка
471 + * (напр. gimp > /dev/null)
472 + * EXIT - излиза от администратора на прозорците
473 + * RESTART [<администратор>] - рестартира WindowMaker или
474 + * страртира друг администратор на
475 + * прозорците
476 + * REFRESH - опреснява (прерисува) работната площ
477 + * ARRANGE_ICONS - преподрежда иконките на работното място.
478 + * SHUTDOWN - убива всички клиенти (и приключва X-сесията)
479 + * SHOW_ALL - показва всички скрити прозорци на работното място
480 + * HIDE_OTHERS - скрива всички прозорци на работното място, освен
481 + * имащия фокус (или последния получавал фокус)
482 + * SAVE_SESSION - запазва текущото състояние на работната площ, в
483 + * това число всички стартирани приложения,
484 + * местата на прозорците им, на дока,
485 + * кламера. Това състояние ще бъде възстановено
486 + * при всяко стартиране на WindowMaker, докато
487 + * наново не се използва SAVE_SESSION или
488 + * CLEAR_SESSION. Ако SaveSessionOnExit = Yes в
489 + * конфигурационната база-данни на Window Maker,
490 + * то при всяко излизане от WindowMaker
491 + * състоянието на сесията автоматично ще бъде
492 + * запазено.
493 + * CLEAR_SESSION - изтрива данните за по-рано запазена
494 + * сесия. Това няма никакъв ефект, ако
495 + * SaveSessionOnExit = Yes.
496 + * INFO - показва панела "Инфо".
497 + *
498 + * Синтаксис на OPEN_MENU:
499 + * 1. Меню от файл:
500 + * // отваря файл-меню, който трябва да съдържа меню и го вмъква
501 + * // на текущото място.
502 + * OPEN_MENU файл-меню
503 + * 2. Меню от програмен канал:
504 + * // пуска командата и очаква тя да генерира меню на стандартния
505 + * // си изход.
506 + * OPEN_MENU | команда
507 + * 3. Меню от директория:
508 + * // Отваря едната или повече директории и прави сортирано
509 + * // азбучно меню за всички изпълними файлове и поддиректории в
510 + * // тях.
511 + * OPEN_MENU директория1 [директория2 ...]
512 + * 4. Меню от директория с команда
513 + * // Отваря едната или повече директории и прави сортирано
514 + * // азбучно меню за всички поддиректории и четими файлове, като
515 + * // всеки от файловете ще бъде обработван с командата.
516 + * OPEN_MENU [опции] директория1 [директория2 ...] WITH команда -опции
517 + * Опции:
518 + * -noext Пропуска всичко, което е след
519 + * последната точка в името на файла.
520 + *
521 + * <параметри> е програмата, която трябва да се изпълни.
522 + *
523 + * ** Опции за командния ред с EXEC:
524 + * %s - замества се с избраното в момента
525 + * %a(title[,prompt]) - отваря диалогова клетка с заглавие "title" и
526 + * незадължителна подкана prompt, след което се
527 + * замества с въведеното.
528 + * %w - замества се с XID (номера) на прозореца с фокус.
529 + * %W - замества се с номера на текущото работно място.
530 + *
531 + * Преди специалните символи (като % и ") може да поставяте \ за да
532 + * загубят специалното си значение:
533 + * пример: xterm -T "\"Hello World\""
534 + *
535 + * Допустими са и стандартните комбинации като \n
536 + *
537 + * Всяка команда MENU трябва да има съответна команда END.
538 + *
539 + * Пример:
540 + *
541 + * "Проба" MENU
542 + * "XTerm" EXEC xterm
543 + * // прави подменю със съдържимото от /usr/openwin/bin
544 + * "XView приложения" OPEN_MENU "/usr/openwin/bin"
545 + * // някои X11-приложения от различни директории
546 + * "X11 приложения" OPEN_MENU /usr/X11/bin $HOME/bin/X11
547 + * // за картинки на фона
548 + * "Фон" OPEN_MENU -noext $HOME/images /usr/share/images WITH wmsetbg -u -t
549 + * // Вмъква style.menu тук.
550 + * "Style" OPEN_MENU style.menu
551 + * "Проба" END
552 + */
553 +
554 +#include "wmmacros"
555 +
556 +"Applications" MENU
557 + "Инфо" MENU
558 + "Информационен панел..." INFO_PANEL
559 + "Лицензионен панел..." LEGAL_PANEL
560 + "Системна конзола" EXEC xconsole
561 + "Натоварване на системата" SHEXEC xosview || xload
562 + "Списък процеси" EXEC xterm -e top
563 + "Ръководства" EXEC xman
564 + "Инфо" END
565 + "Стартирай..." SHEXEC %A(Run,Въведете команда, която да се стартира:)
566 + "XTerm" EXEC xterm -sb
567 + "Rxvt" EXEC rxvt -bg black -fg white -fn fixed
568 + "Работни места" WORKSPACE_MENU
569 + "Приложения" MENU
570 + "Графични" MENU
571 + "Gimp" SHEXEC gimp >/dev/null
572 + "XV" EXEC xv
573 + "XPaint" EXEC xpaint
574 + "XFig" EXEC xfig
575 + "Графични" END
576 + "X File Manager" EXEC xfm
577 + "OffiX Files" EXEC files
578 + "LyX" EXEC lyx
579 + "Netscape" EXEC netscape
580 + "Ghostview" EXEC ghostview %a(GhostView,Enter file to view)
581 + "Acrobat" EXEC /usr/local/Acrobat3/bin/acroread %a(Acrobar,Enter PDF to view)
582 + "TkDesk" EXEC tkdesk
583 + "Приложения" END
584 + "Редактори" MENU
585 + "XFte" EXEC xfte
586 + "XEmacs" SHEXEC xemacs || emacs
587 + "XJed" EXEC xjed
588 + "NEdit" EXEC nedit
589 + "Xedit" EXEC xedit
590 + "VI" EXEC xterm -e vi
591 + "Редактори" END
592 + "Разни" MENU
593 + "Xmcd" SHEXEC xmcd 2> /dev/null
594 + "Xplaycd" EXEC xplaycd
595 + "Xmixer" EXEC xmixer
596 + "Разни" END
597 + "Инструменти" MENU
598 + "Калкукатор" EXEC xcalc
599 + "Свойства на прозореца" SHEXEC xprop | xmessage -center -title 'xprop' -file -
600 + "Избор на шрифт" EXEC xfontsel
601 + "Емулатор на терминал" EXEC xminicom
602 + "Лупа" EXEC xmag
603 + "Цветова палитра" EXEC xcmap
604 + "XKill" EXEC xkill
605 + "Clipboard" EXEC xclipboard
606 + "Инструменти" END
607 +
608 + "Избор" MENU
609 + "Copy" SHEXEC echo '%s' | wxcopy
610 + "Mail To" EXEC xterm -name mail -T "Pine" -e pine %s
611 + "Navigate" EXEC netscape %s
612 + "Search in Manual" SHEXEC MANUAL_SEARCH(%s)
613 + "Избор" END
614 +
615 + "Работно място" MENU
616 + "Скрий другите" HIDE_OTHERS
617 + "Покажи всички" SHOW_ALL
618 + "Подреди иконките" ARRANGE_ICONS
619 + "Опресни" REFRESH
620 + "Заключи" EXEC xlock -allowroot -usefirst
621 + "Запази сесията" SAVE_SESSION
622 + "Изчисти запазената сесия" CLEAR_SESSION
623 + "Работни места" END
624 +
625 + "Изглед" MENU
626 + "Теми" OPEN_MENU -noext THEMES_DIR $HOME/GNUstep/Library/WindowMaker/Themes WITH setstyle
627 + "Стилове" OPEN_MENU -noext STYLES_DIR $HOME/GNUstep/Library/WindowMaker/Styles WITH setstyle
628 + "Колекции иконки" OPEN_MENU -noext ICON_SETS_DIR $HOME/GNUstep/Library/WindowMaker/IconSets WITH seticons
629 + "Фон" MENU
630 + "Плътен" MENU
631 + "Черен" WS_BACK '(solid, black)'
632 + "Син" WS_BACK '(solid, "#505075")'
633 + "Тъмно виолетово" WS_BACK '(solid, "#243e6c")'
634 + "Силно синьо" WS_BACK '(solid, "#180090")'
635 + "Мораво" WS_BACK '(solid, "#554466")'
636 + "Пшеничен" WS_BACK '(solid, "wheat4")'
637 + "Тъмно сив" WS_BACK '(solid, "#333340")'
638 + "Винен" WS_BACK '(solid, "#400020")'
639 + "Плътен" END
640 + "Градиент" MENU
641 + "Слънце" WS_BACK '(mvgradient, deepskyblue4, black, deepskyblue4, tomato4)'
642 + "Небе" WS_BACK '(vgradient, blue4, white)'
643 + "Сини сенки" WS_BACK '(vgradient, "#7080a5", "#101020")'
644 + "Виолетови сенки" WS_BACK '(vgradient, "#746ebc", "#242e4c")'
645 + "Морави сенки" WS_BACK '(vgradient, "#654c66", "#151426")'
646 + "Пшенични сенки" WS_BACK '(vgradient, "#a09060", "#302010")'
647 + "Сиви сенки" WS_BACK '(vgradient, "#636380", "#131318")'
648 + "Винени сенки" WS_BACK '(vgradient, "#600040", "#180010")'
649 + "Градиент" END
650 + "Images" OPEN_MENU -noext BACKGROUNDS_DIR $HOME/GNUstep/Library/WindowMaker/Backgrounds WITH wmsetbg -u -t
651 + "Фон" END
652 + "Запази темата" SHEXEC getstyle -t $HOME/GNUstep/Library/WindowMaker/Themes/"%a(Theme name,Enter file name:)"
653 + "Запази колекцията иконки" SHEXEC geticonset $HOME/GNUstep/Library/WindowMaker/IconSets/"%a(IconSet name,Enter file name:)"
654 + "Пособие за настройки" EXEC /usr/local/GNUstep/Applications/WPrefs.app/WPrefs
655 + "Изглед" END
656 +
657 + "Изход" MENU
658 + "Рестартиране" RESTART
659 + "Стартирай BlackBox" RESTART blackbox
660 + "Стартирай kwm" RESTART kwm
661 + "Стартирай IceWM" RESTART icewm
662 + "Изход..." EXIT
663 + "Изход" END
664 +"Приложения" END
665 --- a/WindowMaker/plmenu Sat Dec 13 13:57:40 2008 -0800
666 +++ b/WindowMaker/plmenu Sat Dec 13 14:10:41 2008 -0800
667 @@ -1,106 +1,106 @@
668 -("Applications",
669 - ("Info",
670 - ("Info Panel", INFO_PANEL),
671 - ("Legal", LEGAL_PANEL),
672 - ("System Console", EXEC, "xconsole"),
673 - ("System Load", SHEXEC, "xosview || xload"),
674 - ("Process List", EXEC, "xterm -e top"),
675 - ("Manual Browser", EXEC, "xman")
676 - ),
677 - ("Run...", SHEXEC, "%a(Run,Type command to run:)"),
678 - ("XTerm", EXEC, "xterm -sb"),
679 - ("Mozilla Firefox", EXEC, "firefox"),
680 - ("Workspaces", WORKSPACE_MENU),
681 - ("Applications",
682 - ("Gimp", SHEXEC, "gimp >/dev/null"),
683 - ("Ghostview", EXEC, "ghostview %a(Enter file to view)"),
684 - ("Xpdf", EXEC, "xpdf %a(Enter PDF to view)"),
685 - ("Abiword", EXEC, "abiword"),
686 - ("Dia", EXEC, "dia"),
687 - ("OpenOffice.org",
688 - ("OpenOffice.org", EXEC, "ooffice"),
689 - ("Writer", EXEC, "oowriter"),
690 - ("Spreadsheet", EXEC, "oocalc"),
691 - ("Draw", EXEC, "oodraw"),
692 - ("Impress", EXEC, "ooimpress")
693 - ),
694 - ("Editors",
695 - ("XEmacs", EXEC, "xemacs"),
696 - ("Emacs", EXEC, "emacs"),
697 - ("XJed", EXEC, "xjed"),
698 - ("VI", EXEC, "xterm -e vi"),
699 - ("GVIM", EXEC, "gvim"),
700 - ("NEdit", EXEC, "nedit"),
701 - ("Xedit", EXEC, "xedit")
702 - ),
703 - ("Multimedia",
704 - ("XMMS",
705 - ("XMMS", EXEC, "xmms"),
706 - ("XMMS play/pause", EXEC, "xmms -t"),
707 - ("XMMS stop", EXEC, "xmms -s")
708 - ),
709 - ("Xine video player", EXEC, "xine"),
710 - ("MPlayer", EXEC, "mplayer")
711 - )
712 - ),
713 - ("Utils",
714 - ("Calculator", EXEC, "xcalc"),
715 - ("Window Properties", SHEXEC, "xprop | xmessage -center -title 'xprop' -file -"),
716 - ("Font Chooser", EXEC, "xfontsel"),
717 - ("Magnify", EXEC, "wmagnify"),
718 - ("Colormap", EXEC, "xcmap"),
719 - ("Kill X Application", EXEC, "xkill")
720 - ),
721 - ("Selection",
722 - ("Copy", SHEXEC, "echo '%s' | wxcopy"),
723 - ("Mail To", EXEC, "xterm -name mail -T Pine -e pine %s"),
724 - ("Navigate", EXEC, "mozilla %s"),
725 - ("Search in Manual", EXEC, "MANUAL_SEARCH(%s)")
726 - ),
727 - ("Commands",
728 - ("Hide Others", HIDE_OTHERS),
729 - ("Show All", SHOW_ALL),
730 - ("Arrange Icons", ARRANGE_ICONS),
731 - ("Refresh", REFRESH),
732 - ("Lock", EXEC, "xlock -allowroot -usefirst")
733 - ),
734 - ("Appearance",
735 - ("Themes", OPEN_MENU, "-noext #wmdatadir#/Themes $HOME/GNUstep/Library/WindowMaker/Themes WITH setstyle"),
736 - ("Styles", OPEN_MENU, "-noext #wmdatadir#/Styles $HOME/GNUstep/Library/WindowMaker/Styles WITH setstyle"),
737 - ("Icon Sets", OPEN_MENU, "-noext #wmdatadir#/IconSets $HOME/GNUstep/Library/WindowMaker/IconSets WITH seticons"),
738 - ("Background",
739 - ("Solid",
740 - ("Black", EXEC, "wdwrite WindowMaker WorkspaceBack '(solid, black)'"),
741 - ("Blue", EXEC, "wdwrite WindowMaker WorkspaceBack '(solid, \"#505075\")'"),
742 - ("Indigo", EXEC, "wdwrite WindowMaker WorkspaceBack '(solid, \"#243e6c\")'"),
743 - ("Bluemarine", EXEC, "wdwrite WindowMaker WorkspaceBack '(solid, \"#224477\")'"),
744 - ("Purple", EXEC, "wdwrite WindowMaker WorkspaceBack '(solid, \"#554466\")'"),
745 - ("Wheat", EXEC, "wdwrite WindowMaker WorkspaceBack '(solid, wheat4)'"),
746 - ("Dark Gray", EXEC, "wdwrite WindowMaker WorkspaceBack '(solid, \"#333340\")'"),
747 - ("Wine", EXEC, "wdwrite WindowMaker WorkspaceBack '(solid, \"#400020\")'")
748 - ),
749 - ("Gradient",
750 - ("Sunset", EXEC, "wdwrite WindowMaker WorkspaceBack '(mvgradient, deepskyblue4, black, deepskyblue4, tomato4)'"),
751 - ("Sky", EXEC, "wdwrite WindowMaker WorkspaceBack '(vgradient, blue4, white)'"),
752 - ("Blue Shades", EXEC, "wdwrite WindowMaker WorkspaceBack '(vgradient, \"#7080a5\", \"#101020\")'"),
753 - ("Indigo Shades", EXEC, "wdwrite WindowMaker WorkspaceBack '(vgradient, \"#746ebc\", \"#242e4c\")'"),
754 - ("Purple Shades", EXEC, "wdwrite WindowMaker WorkspaceBack '(vgradient, \"#654c66\", \"#151426\")'"),
755 - ("Wheat Shades", EXEC, "wdwrite WindowMaker WorkspaceBack '(vgradient, \"#a09060\", \"#302010\")'"),
756 - ("Grey Shades", EXEC, "wdwrite WindowMaker WorkspaceBack '(vgradient, \"#636380\", \"#131318\")'"),
757 - ("Wine Shades", EXEC, "wdwrite WindowMaker WorkspaceBack '(vgradient, \"#600040\", \"#180010\")'")
758 - ),
759 - ("Images", OPEN_MENU, "-noext #wmdatadir#/Backgrounds $HOME/GNUstep/Library/WindowMaker/Backgrounds WITH wmsetbg -u -t")
760 - ),
761 - ("Save Theme", SHEXEC, "getstyle -t $HOME/GNUstep/Library/WindowMaker/Themes/\"%a(Theme name)\""),
762 - ("Save IconSet", SHEXEC, "geticonset $HOME/GNUstep/Library/WindowMaker/IconSets/\"%a(IconSet name)\""),
763 - ("Preferences Utility", EXEC, "/usr/local/GNUstep/Applications/WPrefs.app/WPrefs")
764 - ),
765 - ("Session",
766 - ("Save Session", SAVE_SESSION),
767 - ("Clear Session", CLEAR_SESSION),
768 - ("Restart Window Maker", RESTART),
769 - ("Start BlackBox", RESTART, blackbox),
770 - ("Start IceWM", RESTART, icewm),
771 - ("Exit", EXIT)
772 - )
773 -)
774 +("Applications",
775 + ("Info",
776 + ("Info Panel", INFO_PANEL),
777 + ("Legal", LEGAL_PANEL),
778 + ("System Console", EXEC, "xconsole"),
779 + ("System Load", SHEXEC, "xosview || xload"),
780 + ("Process List", EXEC, "xterm -e top"),
781 + ("Manual Browser", EXEC, "xman")
782 + ),
783 + ("Run...", SHEXEC, "%A(Run,Type command to run:)"),
784 + ("XTerm", EXEC, "xterm -sb"),
785 + ("Mozilla Firefox", EXEC, "firefox"),
786 + ("Workspaces", WORKSPACE_MENU),
787 + ("Applications",
788 + ("Gimp", SHEXEC, "gimp >/dev/null"),
789 + ("Ghostview", EXEC, "ghostview %a(Enter file to view)"),
790 + ("Xpdf", EXEC, "xpdf %a(Enter PDF to view)"),
791 + ("Abiword", EXEC, "abiword"),
792 + ("Dia", EXEC, "dia"),
793 + ("OpenOffice.org",
794 + ("OpenOffice.org", EXEC, "ooffice"),
795 + ("Writer", EXEC, "oowriter"),
796 + ("Spreadsheet", EXEC, "oocalc"),
797 + ("Draw", EXEC, "oodraw"),
798 + ("Impress", EXEC, "ooimpress")
799 + ),
800 + ("Editors",
801 + ("XEmacs", EXEC, "xemacs"),
802 + ("Emacs", EXEC, "emacs"),
803 + ("XJed", EXEC, "xjed"),
804 + ("VI", EXEC, "xterm -e vi"),
805 + ("GVIM", EXEC, "gvim"),
806 + ("NEdit", EXEC, "nedit"),
807 + ("Xedit", EXEC, "xedit")
808 + ),
809 + ("Multimedia",
810 + ("XMMS",
811 + ("XMMS", EXEC, "xmms"),
812 + ("XMMS play/pause", EXEC, "xmms -t"),
813 + ("XMMS stop", EXEC, "xmms -s")
814 + ),
815 + ("Xine video player", EXEC, "xine"),
816 + ("MPlayer", EXEC, "mplayer")
817 + )
818 + ),
819 + ("Utils",
820 + ("Calculator", EXEC, "xcalc"),
821 + ("Window Properties", SHEXEC, "xprop | xmessage -center -title 'xprop' -file -"),
822 + ("Font Chooser", EXEC, "xfontsel"),
823 + ("Magnify", EXEC, "wmagnify"),
824 + ("Colormap", EXEC, "xcmap"),
825 + ("Kill X Application", EXEC, "xkill")
826 + ),
827 + ("Selection",
828 + ("Copy", SHEXEC, "echo '%s' | wxcopy"),
829 + ("Mail To", EXEC, "xterm -name mail -T Pine -e pine %s"),
830 + ("Navigate", EXEC, "mozilla %s"),
831 + ("Search in Manual", EXEC, "MANUAL_SEARCH(%s)")
832 + ),
833 + ("Commands",
834 + ("Hide Others", HIDE_OTHERS),
835 + ("Show All", SHOW_ALL),
836 + ("Arrange Icons", ARRANGE_ICONS),
837 + ("Refresh", REFRESH),
838 + ("Lock", EXEC, "xlock -allowroot -usefirst")
839 + ),
840 + ("Appearance",
841 + ("Themes", OPEN_MENU, "-noext #wmdatadir#/Themes $HOME/GNUstep/Library/WindowMaker/Themes WITH setstyle"),
842 + ("Styles", OPEN_MENU, "-noext #wmdatadir#/Styles $HOME/GNUstep/Library/WindowMaker/Styles WITH setstyle"),
843 + ("Icon Sets", OPEN_MENU, "-noext #wmdatadir#/IconSets $HOME/GNUstep/Library/WindowMaker/IconSets WITH seticons"),
844 + ("Background",
845 + ("Solid",
846 + ("Black", EXEC, "wdwrite WindowMaker WorkspaceBack '(solid, black)'"),
847 + ("Blue", EXEC, "wdwrite WindowMaker WorkspaceBack '(solid, \"#505075\")'"),
848 + ("Indigo", EXEC, "wdwrite WindowMaker WorkspaceBack '(solid, \"#243e6c\")'"),
849 + ("Bluemarine", EXEC, "wdwrite WindowMaker WorkspaceBack '(solid, \"#224477\")'"),
850 + ("Purple", EXEC, "wdwrite WindowMaker WorkspaceBack '(solid, \"#554466\")'"),
851 + ("Wheat", EXEC, "wdwrite WindowMaker WorkspaceBack '(solid, wheat4)'"),
852 + ("Dark Gray", EXEC, "wdwrite WindowMaker WorkspaceBack '(solid, \"#333340\")'"),
853 + ("Wine", EXEC, "wdwrite WindowMaker WorkspaceBack '(solid, \"#400020\")'")
854 + ),
855 + ("Gradient",
856 + ("Sunset", EXEC, "wdwrite WindowMaker WorkspaceBack '(mvgradient, deepskyblue4, black, deepskyblue4, tomato4)'"),
857 + ("Sky", EXEC, "wdwrite WindowMaker WorkspaceBack '(vgradient, blue4, white)'"),
858 + ("Blue Shades", EXEC, "wdwrite WindowMaker WorkspaceBack '(vgradient, \"#7080a5\", \"#101020\")'"),
859 + ("Indigo Shades", EXEC, "wdwrite WindowMaker WorkspaceBack '(vgradient, \"#746ebc\", \"#242e4c\")'"),
860 + ("Purple Shades", EXEC, "wdwrite WindowMaker WorkspaceBack '(vgradient, \"#654c66\", \"#151426\")'"),
861 + ("Wheat Shades", EXEC, "wdwrite WindowMaker WorkspaceBack '(vgradient, \"#a09060\", \"#302010\")'"),
862 + ("Grey Shades", EXEC, "wdwrite WindowMaker WorkspaceBack '(vgradient, \"#636380\", \"#131318\")'"),
863 + ("Wine Shades", EXEC, "wdwrite WindowMaker WorkspaceBack '(vgradient, \"#600040\", \"#180010\")'")
864 + ),
865 + ("Images", OPEN_MENU, "-noext #wmdatadir#/Backgrounds $HOME/GNUstep/Library/WindowMaker/Backgrounds WITH wmsetbg -u -t")
866 + ),
867 + ("Save Theme", SHEXEC, "getstyle -t $HOME/GNUstep/Library/WindowMaker/Themes/\"%a(Theme name)\""),
868 + ("Save IconSet", SHEXEC, "geticonset $HOME/GNUstep/Library/WindowMaker/IconSets/\"%a(IconSet name)\""),
869 + ("Preferences Utility", EXEC, "/usr/local/GNUstep/Applications/WPrefs.app/WPrefs")
870 + ),
871 + ("Session",
872 + ("Save Session", SAVE_SESSION),
873 + ("Clear Session", CLEAR_SESSION),
874 + ("Restart Window Maker", RESTART),
875 + ("Start BlackBox", RESTART, blackbox),
876 + ("Start IceWM", RESTART, icewm),
877 + ("Exit", EXIT)
878 + )
879 +)
880 --- a/WindowMaker/plmenu.bg Sat Dec 13 13:57:40 2008 -0800
881 +++ b/WindowMaker/plmenu.bg Sat Dec 13 14:10:41 2008 -0800
882 @@ -1,106 +1,106 @@
883 -("Приложения",
884 - ("Инфо",
885 - ("Информационен панел...", INFO_PANEL),
886 - ("Лицензионен панел...", LEGAL_PANEL),
887 - ("Системна конзола", EXEC, "xconsole"),
888 - ("Натоварване на системата", SHEXEC, "xosview || xload"),
889 - ("Списък на процесите", EXEC, "xterm -e top"),
890 - ("Ръководства", EXEC, "xman")
891 - ),
892 - ("Стартирай...", SHEXEC, "%a(Run,Въведете команда, която да се стартира:)"),
893 - ("XTerm", EXEC, "xterm -sb"),
894 - ("Rxvt", EXEC, "rxvt -bg black -fg white -fn fixed"),
895 - ("Работни места", WORKSPACE_MENU),
896 - ("Приложения",
897 - ("Графични",
898 - ("Gimp", SHEXEC, "gimp >/dev/null"),
899 - ("XV", EXEC, "xv"),
900 - ("XPaint", EXEC, "xpaint"),
901 - ("XFig", EXEC, "xfig")
902 - ),
903 - ("X File Manager", EXEC, "xfm"),
904 - ("OffiX Files", EXEC, "files"),
905 - ("LyX", EXEC, "lyx"),
906 - ("Netscape", EXEC, "netscape"),
907 - ("Ghostview", EXEC, "ghostview %a(Enter file to view)"),
908 - ("Acrobat", EXEC, "/usr/local/Acrobat3/bin/acroread %a(Enter PDF to view)"),
909 - ("TkDesk", EXEC, "tkdesk")
910 - ),
911 - ("Редактори",
912 - ("XFte", EXEC, "xfte"),
913 - ("XEmacs", SHEXEC, "xemacs || emacs"),
914 - ("XJed", EXEC, "xjed"),
915 - ("NEdit", EXEC, "nedit"),
916 - ("Xedit", EXEC, "xedit"),
917 - ("VI", EXEC, "xterm -e vi")
918 - ),
919 - ("Разни",
920 - ("Xmcd", SHEXEC, "xmcd 2> /dev/null"),
921 - ("Xplaycd", EXEC, "xplaycd"),
922 - ("Xmixer", EXEC, "xmixer")
923 - ),
924 - ("Инструменти",
925 - ("Калкулатор", EXEC, "xcalc"),
926 - ("Свойства на прозореца", SHEXEC, "xprop | xmessage -center -title 'xprop' -file -"),
927 - ("Избор на шрифт", EXEC, "xfontsel"),
928 - ("Емулатор на терминал", EXEC, "xminicom"),
929 - ("Лупа", EXEC, "xmag"),
930 - ("Цветна палитра", EXEC, "xcmap"),
931 - ("XKill", EXEC, "xkill"),
932 - ("ASClock", EXEC, "asclock -shape"),
933 - ("Clipboard", EXEC, "xclipboard")
934 - ),
935 - ("Избор",
936 - ("Copy", SHEXEC, "echo '%s' | wxcopy"),
937 - ("Mail To", EXEC, "xterm -name mail -T Pine -e pine %s"),
938 - ("Navigate", EXEC, "netscape %s"),
939 - ("Search in Manual", EXEC, "MANUAL_SEARCH(%s)")
940 - ),
941 - ("Работно място",
942 - ("Скрий другите", HIDE_OTHERS),
943 - ("Покажи всички", SHOW_ALL),
944 - ("Подреди иконките", ARRANGE_ICONS),
945 - ("Опресни", REFRESH),
946 - ("Заключи", EXEC, "xlock -allowroot -usefirst"),
947 - ("Запази сесията", SAVE_SESSION),
948 - ("Изчисти запазената сесия", CLEAR_SESSION)
949 - ),
950 - ("Изглед",
951 - ("Теми", OPEN_MENU, "-noext #wmdatadir#/Themes $HOME/GNUstep/Library/WindowMaker/Themes WITH setstyle"),
952 - ("Стилове", OPEN_MENU, "-noext #wmdatadir#/Styles $HOME/GNUstep/Library/WindowMaker/Styles WITH setstyle"),
953 - ("Колекции иконки", OPEN_MENU, "-noext #wmdatadir#/IconSets $HOME/GNUstep/Library/WindowMaker/IconSets WITH seticons"),
954 - ("Фон",
955 - ("Плътен",
956 - ("Черен", EXEC, "wdwrite WindowMaker WorkspaceBack '(solid, black)'"),
957 - ("Син", EXEC, "wdwrite WindowMaker WorkspaceBack '(solid, \"#505075\")'"),
958 - ("Тъмнолилав", EXEC, "wdwrite WindowMaker WorkspaceBack '(solid, \"#243e6c\")'"),
959 - ("Ясно синьо", EXEC, "wdwrite WindowMaker WorkspaceBack '(solid, \"#180090\")'"),
960 - ("Мораво", EXEC, "wdwrite WindowMaker WorkspaceBack '(solid, \"#554466\")'"),
961 - ("Пшенично", EXEC, "wdwrite WindowMaker WorkspaceBack '(solid, wheat4)'"),
962 - ("Тъмно сиво", EXEC, "wdwrite WindowMaker WorkspaceBack '(solid, \"#333340\")'"),
963 - ("Винено", EXEC, "wdwrite WindowMaker WorkspaceBack '(solid, \"#400020\")'")
964 - ),
965 - ("Градиент",
966 - ("Слънце", EXEC, "wdwrite WindowMaker WorkspaceBack '(mvgradient, deepskyblue4, black, deepskyblue4, tomato4)'"),
967 - ("Небе", EXEC, "wdwrite WindowMaker WorkspaceBack '(vgradient, blue4, white)'"),
968 - ("Сини сенки", EXEC, "wdwrite WindowMaker WorkspaceBack '(vgradient, \"#7080a5\", \"#101020\")'"),
969 - ("Лилави сенки", EXEC, "wdwrite WindowMaker WorkspaceBack '(vgradient, \"#746ebc\", \"#242e4c\")'"),
970 - ("Морави сенки", EXEC, "wdwrite WindowMaker WorkspaceBack '(vgradient, \"#654c66\", \"#151426\")'"),
971 - ("Пшенични сенки", EXEC, "wdwrite WindowMaker WorkspaceBack '(vgradient, \"#a09060\", \"#302010\")'"),
972 - ("Сиви сенки", EXEC, "wdwrite WindowMaker WorkspaceBack '(vgradient, \"#636380\", \"#131318\")'"),
973 - ("Винени сенки", EXEC, "wdwrite WindowMaker WorkspaceBack '(vgradient, \"#600040\", \"#180010\")'")
974 - ),
975 - ("Изображения", OPEN_MENU, "-noext #wmdatadir#/Backgrounds $HOME/GNUstep/Library/WindowMaker/Backgrounds WITH wmsetbg -u -t")
976 - ),
977 - ("Запази темата", SHEXEC, "getstyle -t $HOME/GNUstep/Library/WindowMaker/Themes/\"%a(Theme name)\""),
978 - ("Запази колекцията иконки", SHEXEC, "geticonset $HOME/GNUstep/Library/WindowMaker/IconSets/\"%a(IconSet name)\""),
979 - ("Пособие за настройки", EXEC, "/usr/local/GNUstep/Applications/WPrefs.app/WPrefs")
980 - ),
981 - ("Изход",
982 - ("Рестартиране", RESTART),
983 - ("Стартирай BlackBox", RESTART, blackbox),
984 - ("Стартирай kwm", RESTART, kwm),
985 - ("Стартирай IceWM", RESTART, icewm),
986 - ("Изход...", EXIT)
987 - )
988 -)
989 \ No newline at end of file
990 +("Приложения",
991 + ("Инфо",
992 + ("Информационен панел...", INFO_PANEL),
993 + ("Лицензионен панел...", LEGAL_PANEL),
994 + ("Системна конзола", EXEC, "xconsole"),
995 + ("Натоварване на системата", SHEXEC, "xosview || xload"),
996 + ("Списък на процесите", EXEC, "xterm -e top"),
997 + ("Ръководства", EXEC, "xman")
998 + ),
999 + ("Стартирай...", SHEXEC, "%A(Run,Въведете команда, която да се стартира:)"),
1000 + ("XTerm", EXEC, "xterm -sb"),
1001 + ("Rxvt", EXEC, "rxvt -bg black -fg white -fn fixed"),
1002 + ("Работни места", WORKSPACE_MENU),
1003 + ("Приложения",
1004 + ("Графични",
1005 + ("Gimp", SHEXEC, "gimp >/dev/null"),
1006 + ("XV", EXEC, "xv"),
1007 + ("XPaint", EXEC, "xpaint"),
1008 + ("XFig", EXEC, "xfig")
1009 + ),
1010 + ("X File Manager", EXEC, "xfm"),
1011 + ("OffiX Files", EXEC, "files"),
1012 + ("LyX", EXEC, "lyx"),
1013 + ("Netscape", EXEC, "netscape"),
1014 + ("Ghostview", EXEC, "ghostview %a(Enter file to view)"),
1015 + ("Acrobat", EXEC, "/usr/local/Acrobat3/bin/acroread %a(Enter PDF to view)"),
1016 + ("TkDesk", EXEC, "tkdesk")
1017 + ),
1018 + ("Редактори",
1019 + ("XFte", EXEC, "xfte"),
1020 + ("XEmacs", SHEXEC, "xemacs || emacs"),
1021 + ("XJed", EXEC, "xjed"),
1022 + ("NEdit", EXEC, "nedit"),
1023 + ("Xedit", EXEC, "xedit"),
1024 + ("VI", EXEC, "xterm -e vi")
1025 + ),
1026 + ("Разни",
1027 + ("Xmcd", SHEXEC, "xmcd 2> /dev/null"),
1028 + ("Xplaycd", EXEC, "xplaycd"),
1029 + ("Xmixer", EXEC, "xmixer")
1030 + ),
1031 + ("Инструменти",
1032 + ("Калкулатор", EXEC, "xcalc"),
1033 + ("Свойства на прозореца", SHEXEC, "xprop | xmessage -center -title 'xprop' -file -"),
1034 + ("Избор на шрифт", EXEC, "xfontsel"),
1035 + ("Емулатор на терминал", EXEC, "xminicom"),
1036 + ("Лупа", EXEC, "xmag"),
1037 + ("Цветна палитра", EXEC, "xcmap"),
1038 + ("XKill", EXEC, "xkill"),
1039 + ("ASClock", EXEC, "asclock -shape"),
1040 + ("Clipboard", EXEC, "xclipboard")
1041 + ),
1042 + ("Избор",
1043 + ("Copy", SHEXEC, "echo '%s' | wxcopy"),
1044 + ("Mail To", EXEC, "xterm -name mail -T Pine -e pine %s"),
1045 + ("Navigate", EXEC, "netscape %s"),
1046 + ("Search in Manual", EXEC, "MANUAL_SEARCH(%s)")
1047 + ),
1048 + ("Работно място",
1049 + ("Скрий другите", HIDE_OTHERS),
1050 + ("Покажи всички", SHOW_ALL),
1051 + ("Подреди иконките", ARRANGE_ICONS),
1052 + ("Опресни", REFRESH),
1053 + ("Заключи", EXEC, "xlock -allowroot -usefirst"),
1054 + ("Запази сесията", SAVE_SESSION),
1055 + ("Изчисти запазената сесия", CLEAR_SESSION)
1056 + ),
1057 + ("Изглед",
1058 + ("Теми", OPEN_MENU, "-noext #wmdatadir#/Themes $HOME/GNUstep/Library/WindowMaker/Themes WITH setstyle"),
1059 + ("Стилове", OPEN_MENU, "-noext #wmdatadir#/Styles $HOME/GNUstep/Library/WindowMaker/Styles WITH setstyle"),
1060 + ("Колекции иконки", OPEN_MENU, "-noext #wmdatadir#/IconSets $HOME/GNUstep/Library/WindowMaker/IconSets WITH seticons"),
1061 + ("Фон",
1062 + ("Плътен",
1063 + ("Черен", EXEC, "wdwrite WindowMaker WorkspaceBack '(solid, black)'"),
1064 + ("Син", EXEC, "wdwrite WindowMaker WorkspaceBack '(solid, \"#505075\")'"),
1065 + ("Тъмнолилав", EXEC, "wdwrite WindowMaker WorkspaceBack '(solid, \"#243e6c\")'"),
1066 + ("Ясно синьо", EXEC, "wdwrite WindowMaker WorkspaceBack '(solid, \"#180090\")'"),
1067 + ("Мораво", EXEC, "wdwrite WindowMaker WorkspaceBack '(solid, \"#554466\")'"),
1068 + ("Пшенично", EXEC, "wdwrite WindowMaker WorkspaceBack '(solid, wheat4)'"),
1069 + ("Тъмно сиво", EXEC, "wdwrite WindowMaker WorkspaceBack '(solid, \"#333340\")'"),
1070 + ("Винено", EXEC, "wdwrite WindowMaker WorkspaceBack '(solid, \"#400020\")'")
1071 + ),
1072 + ("Градиент",
1073 + ("Слънце", EXEC, "wdwrite WindowMaker WorkspaceBack '(mvgradient, deepskyblue4, black, deepskyblue4, tomato4)'"),
1074 + ("Небе", EXEC, "wdwrite WindowMaker WorkspaceBack '(vgradient, blue4, white)'"),
1075 + ("Сини сенки", EXEC, "wdwrite WindowMaker WorkspaceBack '(vgradient, \"#7080a5\", \"#101020\")'"),
1076 + ("Лилави сенки", EXEC, "wdwrite WindowMaker WorkspaceBack '(vgradient, \"#746ebc\", \"#242e4c\")'"),
1077 + ("Морави сенки", EXEC, "wdwrite WindowMaker WorkspaceBack '(vgradient, \"#654c66\", \"#151426\")'"),
1078 + ("Пшенични сенки", EXEC, "wdwrite WindowMaker WorkspaceBack '(vgradient, \"#a09060\", \"#302010\")'"),
1079 + ("Сиви сенки", EXEC, "wdwrite WindowMaker WorkspaceBack '(vgradient, \"#636380\", \"#131318\")'"),
1080 + ("Винени сенки", EXEC, "wdwrite WindowMaker WorkspaceBack '(vgradient, \"#600040\", \"#180010\")'")
1081 + ),
1082 + ("Изображения", OPEN_MENU, "-noext #wmdatadir#/Backgrounds $HOME/GNUstep/Library/WindowMaker/Backgrounds WITH wmsetbg -u -t")
1083 + ),
1084 + ("Запази темата", SHEXEC, "getstyle -t $HOME/GNUstep/Library/WindowMaker/Themes/\"%a(Theme name)\""),
1085 + ("Запази колекцията иконки", SHEXEC, "geticonset $HOME/GNUstep/Library/WindowMaker/IconSets/\"%a(IconSet name)\""),
1086 + ("Пособие за настройки", EXEC, "/usr/local/GNUstep/Applications/WPrefs.app/WPrefs")
1087 + ),
1088 + ("Изход",
1089 + ("Рестартиране", RESTART),
1090 + ("Стартирай BlackBox", RESTART, blackbox),
1091 + ("Стартирай kwm", RESTART, kwm),
1092 + ("Стартирай IceWM", RESTART, icewm),
1093 + ("Изход...", EXIT)
1094 + )
1095 +)
1096 --- a/WindowMaker/plmenu.es Sat Dec 13 13:57:40 2008 -0800
1097 +++ b/WindowMaker/plmenu.es Sat Dec 13 14:10:41 2008 -0800
1098 @@ -7,7 +7,7 @@
1099 ("Lista de Procesos", EXEC, "xterm -e top"),
1100 ("Paginas del Manual", EXEC, "xman")
1101 ),
1102 - ("Ejecutar...", SHEXEC, "%a(Run,Type command to run:)"),
1103 + ("Ejecutar...", SHEXEC, "%A(Run,Type command to run:)"),
1104 ("XTerm", EXEC, "xterm -sb"),
1105 ("Rxvt", EXEC, "rxvt -bg black -fg white -fn fixed"),
1106 ("Espacio de Trabajo", WORKSPACE_MENU),
1107 --- a/WindowMaker/plmenu.ja Sat Dec 13 13:57:40 2008 -0800
1108 +++ b/WindowMaker/plmenu.ja Sat Dec 13 14:10:41 2008 -0800
1109 @@ -7,7 +7,7 @@
1110 ("プロセス一覧", EXEC, "xterm -e top"),
1111 ("マニュアルブラウザ", EXEC, "xman")
1112 ),
1113 - ("コマンド実行", SHEXEC, "%a(Run,Type command to run:)"),
1114 + ("コマンド実行", SHEXEC, "%A(Run,Type command to run:)"),
1115 ("KTerm", EXEC, "kterm -sb"),
1116 ("Rxvt", EXEC, "rxvt -bg black -fg white"),
1117 ("ワークスペース", WORKSPACE_MENU),
1118 --- a/src/WindowMaker.h Sat Dec 13 13:57:40 2008 -0800
1119 +++ b/src/WindowMaker.h Sat Dec 13 14:10:41 2008 -0800
1120 @@ -475,6 +475,8 @@
1121 RImage *swtileImage;
1122 RImage *swbackImage[9];
1123
1124 + int history_lines;
1125 +
1126 struct {
1127 unsigned int nodock:1; /* don't display the dock */
1128 unsigned int noclip:1; /* don't display the clip */
1129 --- a/src/defaults.c Sat Dec 13 13:57:40 2008 -0800
1130 +++ b/src/defaults.c Sat Dec 13 14:10:41 2008 -0800
1131 @@ -860,6 +860,9 @@
1132 },
1133 {"SelectCursor", "(builtin, cross)", (void*)WCUR_SELECT,
1134 NULL, getCursor, setCursor
1135 + },
1136 + {"DialogHistoryLines", "500", NULL,
1137 + &wPreferences.history_lines, getInt, NULL
1138 }
1139 };
1140
1141 --- a/src/dialog.c Sat Dec 13 13:57:40 2008 -0800
1142 +++ b/src/dialog.c Sat Dec 13 14:10:41 2008 -0800
1143 @@ -178,6 +178,328 @@
1144 return result;
1145 }
1146
1147 +typedef struct _WMInputPanelWithHistory
1148 +{
1149 + WMInputPanel *panel;
1150 + WMArray *history;
1151 + int histpos;
1152 + char *prefix;
1153 + char *suffix;
1154 + char *rest;
1155 + WMArray *variants;
1156 + int varpos;
1157 +} WMInputPanelWithHistory;
1158 +
1159 +static char *
1160 +HistoryFileName(char *name)
1161 +{
1162 + char *filename = NULL;
1163 +
1164 + filename = wstrdup(wusergnusteppath());
1165 + filename = wstrappend(filename, "/.AppInfo/WindowMaker/History");
1166 + if(name && strlen(name)) {
1167 + filename = wstrappend(filename, ".");
1168 + filename = wstrappend(filename, name);
1169 + }
1170 + return filename;
1171 +}
1172 +
1173 +static int
1174 +matchString(void *str1, void *str2)
1175 +{
1176 + return (strcmp((char*)str1, (char*)str2)==0 ? 1 : 0);
1177 +}
1178 +
1179 +static WMArray *
1180 +LoadHistory(char *filename, int max)
1181 +{
1182 + WMPropList *plhistory;
1183 + WMPropList *plitem;
1184 + WMArray *history;
1185 + int i, num;
1186 +
1187 + history = WMCreateArrayWithDestructor(1, wfree);
1188 + WMAddToArray(history, wstrdup(""));
1189 +
1190 + plhistory = WMReadPropListFromFile((char*)filename);
1191 +
1192 + if(plhistory && WMIsPLArray(plhistory)) {
1193 + num = WMGetPropListItemCount(plhistory);
1194 + if(num > max) num = max;
1195 +
1196 + for(i = 0; i < num; ++i) {
1197 + plitem = WMGetFromPLArray(plhistory, i);
1198 + if(WMIsPLString(plitem) && WMFindInArray(history, matchString,
1199 + WMGetFromPLString(plitem)) == WANotFound)
1200 + WMAddToArray(history, WMGetFromPLString(plitem));
1201 + }
1202 + }
1203 +
1204 + return history;
1205 +}
1206 +
1207 +static void
1208 +SaveHistory(WMArray *history, char *filename)
1209 +{
1210 + int i;
1211 + WMPropList *plhistory;
1212 +
1213 + plhistory = WMCreatePLArray(NULL);
1214 +
1215 + for(i = 0; i < WMGetArrayItemCount(history); ++i)
1216 + WMAddToPLArray(plhistory,
1217 + WMCreatePLString(WMGetFromArray(history, i)));
1218 +
1219 + WMWritePropListToFile(plhistory, (char*)filename, False);
1220 + WMReleasePropList(plhistory);
1221 +}
1222 +
1223 +static int
1224 +strmatch(const char *str1, const char *str2)
1225 +{
1226 + return !strcmp(str1, str2);
1227 +}
1228 +
1229 +static int
1230 +pstrcmp(const char **str1, const char **str2)
1231 +{
1232 + return strcmp(*str1, *str2);
1233 +}
1234 +
1235 +static void
1236 +ScanFiles(const char *dir, const char *prefix, unsigned acceptmask,
1237 + unsigned declinemask, WMArray *result)
1238 +{
1239 + int prefixlen;
1240 + DIR *d;
1241 + struct dirent *de;
1242 + struct stat sb;
1243 + char *fullfilename, *suffix;
1244 +
1245 + prefixlen = strlen(prefix);
1246 + if((d = opendir(dir)) != NULL) {
1247 + while((de = readdir(d)) != NULL) {
1248 + if(strlen(de->d_name) > prefixlen &&
1249 + !strncmp(prefix, de->d_name, prefixlen) &&
1250 + strcmp(de->d_name, ".") != 0 &&
1251 + strcmp(de->d_name, "..")) {
1252 + fullfilename = wstrconcat((char*)dir, "/");
1253 + fullfilename = wstrappend(fullfilename, de->d_name);
1254 +
1255 + if(stat(fullfilename, &sb) == 0 &&
1256 + (sb.st_mode & acceptmask) &&
1257 + !(sb.st_mode & declinemask) &&
1258 + WMFindInArray(result, (WMMatchDataProc*)strmatch,
1259 + de->d_name + prefixlen) == WANotFound) {
1260 + suffix = wstrdup(de->d_name + prefixlen);
1261 + WMAddToArray(result, suffix);
1262 + }
1263 + wfree(fullfilename);
1264 + }
1265 + }
1266 + closedir(d);
1267 + }
1268 +}
1269 +
1270 +static WMArray *
1271 +GenerateVariants(const char * complete)
1272 +{
1273 + Bool firstWord = True;
1274 + WMArray *variants = NULL;
1275 + char *pos = NULL, *path = NULL, *tmp = NULL, *dir = NULL, *prefix = NULL;
1276 +
1277 + variants = WMCreateArrayWithDestructor(0, wfree);
1278 +
1279 + while(*complete == ' ') ++complete;
1280 +
1281 + if((pos = strrchr(complete, ' ')) != NULL) {
1282 + complete = pos + 1;
1283 + firstWord = False;
1284 + }
1285 +
1286 + if((pos = strrchr(complete, '/')) != NULL) {
1287 + tmp = wstrndup((char*)complete, pos - complete + 1);
1288 + if(*tmp == '~' && *(tmp+1) == '/' && getenv("HOME")) {
1289 + dir = wstrdup(getenv("HOME"));
1290 + dir = wstrappend(dir, tmp + 1);
1291 + wfree(tmp);
1292 + } else {
1293 + dir = tmp;
1294 + }
1295 + prefix = wstrdup(pos + 1);
1296 + ScanFiles(dir, prefix, (unsigned)-1, 0, variants);
1297 + wfree(dir);
1298 + wfree(prefix);
1299 + } else if(*complete == '~') {
1300 + WMAddToArray(variants, wstrdup("/"));
1301 + } else if(firstWord) {
1302 + path = getenv("PATH");
1303 + while(path) {
1304 + pos = strchr(path, ':');
1305 + if(pos) {
1306 + tmp = wstrndup(path, pos - path);
1307 + path = pos + 1;
1308 + } else if(*path != '\0') {
1309 + tmp = wstrdup(path);
1310 + path = NULL;
1311 + } else break;
1312 + ScanFiles(tmp, complete,
1313 + S_IXOTH | S_IXGRP | S_IXUSR, S_IFDIR, variants);
1314 + wfree(tmp);
1315 + }
1316 + }
1317 +
1318 + WMSortArray(variants, (WMCompareDataProc*)pstrcmp);
1319 + return variants;
1320 +}
1321 +
1322 +static void
1323 +handleHistoryKeyPress(XEvent *event, void *clientData)
1324 +{
1325 + char *text;
1326 + unsigned pos;
1327 + WMInputPanelWithHistory *p = (WMInputPanelWithHistory*)clientData;
1328 + KeySym ksym;
1329 +
1330 + ksym = XLookupKeysym(&event->xkey, 0);
1331 +
1332 + switch(ksym)
1333 + {
1334 + case XK_Up:
1335 + if(p->histpos < WMGetArrayItemCount(p->history) - 1) {
1336 + if(p->histpos == 0)
1337 + wfree(WMReplaceInArray(p->history,
1338 + 0, WMGetTextFieldText(p->panel->text)));
1339 + p->histpos++;
1340 + WMSetTextFieldText(p->panel->text,
1341 + WMGetFromArray(p->history, p->histpos));
1342 + }
1343 + break;
1344 + case XK_Down:
1345 + if(p->histpos > 0) {
1346 + p->histpos--;
1347 + WMSetTextFieldText(p->panel->text,
1348 + WMGetFromArray(p->history, p->histpos));
1349 + }
1350 + break;
1351 + case XK_Tab:
1352 + if(!p->variants) {
1353 + text = WMGetTextFieldText(p->panel->text);
1354 + pos = WMGetTextFieldCursorPosition(p->panel->text);
1355 + p->prefix = wstrndup(text, pos);
1356 + p->suffix = wstrdup(text + pos);
1357 + wfree(text);
1358 + p->variants = GenerateVariants(p->prefix);
1359 + p->varpos = 0;
1360 + if(!p->variants) {
1361 + wfree(p->prefix);
1362 + wfree(p->suffix);
1363 + p->prefix = NULL;
1364 + p->suffix = NULL;
1365 + }
1366 + }
1367 + if(p->variants && p->prefix && p->suffix) {
1368 + p->varpos++;
1369 + if(p->varpos > WMGetArrayItemCount(p->variants))
1370 + p->varpos = 0;
1371 + if(p->varpos > 0)
1372 + text = wstrconcat(p->prefix,
1373 + WMGetFromArray(p->variants, p->varpos - 1));
1374 + else
1375 + text = wstrdup(p->prefix);
1376 + pos = strlen(text);
1377 + text = wstrappend(text, p->suffix);
1378 + WMSetTextFieldText(p->panel->text, text);
1379 + WMSetTextFieldCursorPosition(p->panel->text, pos);
1380 + wfree(text);
1381 + }
1382 + break;
1383 + }
1384 + if(ksym != XK_Tab) {
1385 + if(p->prefix) {
1386 + wfree(p->prefix);
1387 + p->prefix = NULL;
1388 + }
1389 + if(p->suffix) {
1390 + wfree(p->suffix);
1391 + p->suffix = NULL;
1392 + }
1393 + if(p->variants) {
1394 + WMFreeArray(p->variants);
1395 + p->variants = NULL;
1396 + }
1397 + }
1398 +}
1399 +
1400 +int
1401 +wAdvancedInputDialog(WScreen *scr, char *title, char *message,
1402 + char *name, char **text)
1403 +{
1404 + WWindow *wwin;
1405 + Window parent;
1406 + char *result;
1407 + WMPoint center;
1408 + WMInputPanelWithHistory *p;
1409 + char *filename;
1410 +
1411 + filename = HistoryFileName(name);
1412 + p = wmalloc(sizeof(WMInputPanelWithHistory));
1413 + p->panel = WMCreateInputPanel(scr->wmscreen, NULL, title, message, *text,
1414 + _("OK"), _("Cancel"));
1415 + p->history = LoadHistory(filename, wPreferences.history_lines);
1416 + p->histpos = 0;
1417 + p->prefix = NULL;
1418 + p->suffix = NULL;
1419 + p->rest = NULL;
1420 + p->variants = NULL;
1421 + p->varpos = 0;
1422 + WMCreateEventHandler(WMWidgetView(p->panel->text), KeyPressMask,
1423 + handleHistoryKeyPress, p);
1424 +
1425 + parent = XCreateSimpleWindow(dpy, scr->root_win, 0, 0, 320, 160, 0, 0, 0);
1426 + XSelectInput(dpy, parent, KeyPressMask|KeyReleaseMask);
1427 +
1428 + XReparentWindow(dpy, WMWidgetXID(p->panel->win), parent, 0, 0);
1429 +
1430 + center = getCenter(scr, 320, 160);
1431 + wwin = wManageInternalWindow(scr, parent, None, NULL, center.x, center.y,
1432 + 320, 160);
1433 +
1434 + wwin->client_leader = WMWidgetXID(p->panel->win);
1435 +
1436 + WMMapWidget(p->panel->win);
1437 +
1438 + wWindowMap(wwin);
1439 +
1440 + WMRunModalLoop(WMWidgetScreen(p->panel->win), WMWidgetView(p->panel->win));
1441 +
1442 + if (p->panel->result == WAPRDefault) {
1443 + result = WMGetTextFieldText(p->panel->text);
1444 + wfree(WMReplaceInArray(p->history, 0, wstrdup(result)));
1445 + SaveHistory(p->history, filename);
1446 + }
1447 + else
1448 + result = NULL;
1449 +
1450 + wUnmanageWindow(wwin, False, False);
1451 +
1452 + WMDestroyInputPanel(p->panel);
1453 + WMFreeArray(p->history);
1454 + wfree(p);
1455 + wfree(filename);
1456 +
1457 + XDestroyWindow(dpy, parent);
1458 +
1459 + if (result==NULL)
1460 + return False;
1461 + else {
1462 + if (*text)
1463 + wfree(*text);
1464 + *text = result;
1465 +
1466 + return True;
1467 + }
1468 +}
1469
1470 int
1471 wInputDialog(WScreen *scr, char *title, char *message, char **text)
1472 --- a/src/dialog.h Sat Dec 13 13:57:40 2008 -0800
1473 +++ b/src/dialog.h Sat Dec 13 14:10:41 2008 -0800
1474 @@ -33,6 +33,7 @@
1475
1476 int wMessageDialog(WScreen *scr, char *title, char *message,
1477 char *defBtn, char *altBtn, char *othBtn);
1478 +int wAdvancedInputDialog(WScreen *scr, char *title, char *message, char *name, char **text);
1479 int wInputDialog(WScreen *scr, char *title, char *message, char **text);
1480
1481 int wExitDialog(WScreen *scr, char *title, char *message, char *defBtn,
1482 --- a/src/misc.c Sat Dec 13 13:57:40 2008 -0800
1483 +++ b/src/misc.c Sat Dec 13 14:10:41 2008 -0800
1484 @@ -607,96 +607,59 @@
1485
1486
1487 static char*
1488 -getuserinput(WScreen *scr, char *line, int *ptr)
1489 +parseuserinputpart(char *line, int *ptr, char *endchars)
1490 {
1491 - char *ret;
1492 - char *title;
1493 - char *prompt;
1494 - int j, state;
1495 - int begin = 0;
1496 -#define BUFSIZE 512
1497 - char tbuffer[BUFSIZE], pbuffer[BUFSIZE];
1498 + int depth = 0, begin;
1499 + char *value = NULL;
1500 + begin = ++*ptr;
1501
1502 + while(line[*ptr] != '\0') {
1503 + if(line[*ptr] == '(') {
1504 + ++depth;
1505 + } else if(depth > 0 && line[*ptr] == ')') {
1506 + --depth;
1507 + } else if(depth == 0 && strchr(endchars, line[*ptr]) != NULL) {
1508 + value = wmalloc(*ptr - begin + 1);
1509 + strncpy(value, line + begin, *ptr - begin);
1510 + value[*ptr - begin] = '\0';
1511 + break;
1512 + }
1513 + ++*ptr;
1514 + }
1515
1516 - title = _("Program Arguments");
1517 - prompt = _("Enter command arguments:");
1518 - ret = NULL;
1519 -
1520 -#define _STARTING 0
1521 -#define _TITLE 1
1522 -#define _PROMPT 2
1523 -#define _DONE 3
1524 -
1525 - state = _STARTING;
1526 - j = 0;
1527 - for (; line[*ptr]!=0 && state!=_DONE; (*ptr)++) {
1528 - switch (state) {
1529 - case _STARTING:
1530 - if (line[*ptr]=='(') {
1531 - state = _TITLE;
1532 - begin = *ptr+1;
1533 - } else {
1534 - state = _DONE;
1535 - }
1536 - break;
1537 -
1538 - case _TITLE:
1539 - if (j <= 0 && line[*ptr]==',') {
1540 -
1541 - j = 0;
1542 - if (*ptr > begin) {
1543 - strncpy(tbuffer, &line[begin], WMIN(*ptr-begin, BUFSIZE));
1544 - tbuffer[WMIN(*ptr-begin, BUFSIZE)] = 0;
1545 - title = (char*)tbuffer;
1546 - }
1547 - begin = *ptr+1;
1548 - state = _PROMPT;
1549 -
1550 - } else if (j <= 0 && line[*ptr]==')') {
1551 -
1552 - if (*ptr > begin) {
1553 - strncpy(tbuffer, &line[begin], WMIN(*ptr-begin, BUFSIZE));
1554 - tbuffer[WMIN(*ptr-begin, BUFSIZE)] = 0;
1555 - title = (char*)tbuffer;
1556 - }
1557 - state = _DONE;
1558 -
1559 - } else if (line[*ptr]=='(') {
1560 - j++;
1561 - } else if (line[*ptr]==')') {
1562 - j--;
1563 - }
1564 -
1565 - break;
1566 -
1567 - case _PROMPT:
1568 - if (line[*ptr]==')' && j==0) {
1569 -
1570 - if (*ptr-begin > 1) {
1571 - strncpy(pbuffer, &line[begin], WMIN(*ptr-begin, BUFSIZE));
1572 - pbuffer[WMIN(*ptr-begin, BUFSIZE)] = 0;
1573 - prompt = (char*)pbuffer;
1574 - }
1575 - state = _DONE;
1576 - } else if (line[*ptr]=='(')
1577 - j++;
1578 - else if (line[*ptr]==')')
1579 - j--;
1580 - break;
1581 - }
1582 - }
1583 - (*ptr)--;
1584 -#undef _STARTING
1585 -#undef _TITLE
1586 -#undef _PROMPT
1587 -#undef _DONE
1588 -
1589 - if (!wInputDialog(scr, title, prompt, &ret))
1590 - return NULL;
1591 - else
1592 - return ret;
1593 + return value;
1594 }
1595
1596 +static char*
1597 +getuserinput(WScreen *scr, char *line, int *ptr, Bool advanced)
1598 +{
1599 + char *ret = NULL, *title = NULL, *prompt = NULL, *name = NULL;
1600 + int rv;
1601 +
1602 + if(line[*ptr] == '(')
1603 + title = parseuserinputpart(line, ptr, ",)");
1604 + if(title != NULL && line[*ptr] == ',')
1605 + prompt = parseuserinputpart(line, ptr, ",)");
1606 + if(prompt != NULL && line[*ptr] == ',')
1607 + name = parseuserinputpart(line, ptr, ")");
1608 +
1609 + if(advanced)
1610 + rv = wAdvancedInputDialog(scr,
1611 + title ? gettext(title):_("Program Arguments"),
1612 + prompt ? gettext(prompt):_("Enter command arguments:"),
1613 + name, &ret);
1614 + else
1615 + rv = wInputDialog(scr,
1616 + title ? gettext(title):_("Program Arguments"),
1617 + prompt ? gettext(prompt):_("Enter command arguments:"),
1618 + &ret);
1619 +
1620 + if(title) wfree(title);
1621 + if(prompt) wfree(prompt);
1622 + if(name) wfree(name);
1623 +
1624 + return rv ? ret : NULL;
1625 +}
1626
1627 #define S_NORMAL 0
1628 #define S_ESCAPE 1
1629 @@ -814,8 +777,9 @@
1630 break;
1631
1632 case 'a':
1633 + case 'A':
1634 ptr++;
1635 - user_input = getuserinput(scr, cmdline, &ptr);
1636 + user_input = getuserinput(scr, cmdline, &ptr, cmdline[ptr-1] == 'A');
1637 if (user_input) {
1638 slen = strlen(user_input);
1639 olen += slen;
1640
1641
1642
1643
1644 1.1 src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-doubleclick-maximise.patch
1645
1646 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-doubleclick-maximise.patch?rev=1.1&view=markup
1647 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-doubleclick-maximise.patch?rev=1.1&content-type=text/plain
1648
1649 Index: windowmaker-0.92.0-doubleclick-maximise.patch
1650 ===================================================================
1651 diff -ur WindowMaker-0.92.0.orig/src/defaults.c WindowMaker-0.92.0/src/defaults.c
1652 --- WindowMaker-0.92.0.orig/src/defaults.c 2009-10-28 13:11:59.544812000 +0100
1653 +++ WindowMaker-0.92.0/src/defaults.c 2009-10-28 13:35:29.344762516 +0100
1654 @@ -562,6 +562,9 @@
1655 {"TranslateMenu", "YES", NULL,
1656 &wPreferences.translate_menu, getBool, NULL
1657 },
1658 + {"DCMaximize", "NO", NULL,
1659 + &wPreferences.dc_maximize, getBool, NULL
1660 + },
1661 /* style options */
1662 {"MenuStyle", "normal", seMenuStyles,
1663 &wPreferences.menu_style, getEnum, setMenuStyle
1664 diff -ur WindowMaker-0.92.0.orig/src/window.c WindowMaker-0.92.0/src/window.c
1665 --- WindowMaker-0.92.0.orig/src/window.c 2009-10-28 13:11:59.364429000 +0100
1666 +++ WindowMaker-0.92.0/src/window.c 2009-10-28 13:18:44.219635690 +0100
1667 @@ -3096,13 +3096,29 @@
1668
1669 if (event->xbutton.button==Button1) {
1670 if (event->xbutton.state == 0) {
1671 - if (!WFLAGP(wwin, no_shadeable)) {
1672 + /* check preferences, maximize or shade */
1673 + if (wPreferences.dc_maximize) {
1674 + if (!WFLAGP(wwin, no_resizable)) {
1675 + /* maximize window */
1676 + if (wwin->flags.maximized != 0) {
1677 + wUnmaximizeWindow(wwin);
1678 + wwin->flags.maximized = 0;
1679 + }
1680 + else {
1681 + wMaximizeWindow(wwin, MAX_VERTICAL|MAX_HORIZONTAL);
1682 + wwin->flags.maximized = MAX_VERTICAL|MAX_HORIZONTAL;
1683 + }
1684 + }
1685 + }
1686 + else {
1687 + if (!WFLAGP(wwin, no_shadeable)) {
1688 /* shade window */
1689 if (wwin->flags.shaded)
1690 - wUnshadeWindow(wwin);
1691 + wUnshadeWindow(wwin);
1692 else
1693 - wShadeWindow(wwin);
1694 - }
1695 + wShadeWindow(wwin);
1696 + }
1697 + }
1698 } else {
1699 int dir = 0;
1700
1701 diff -ur WindowMaker-0.92.0.orig/src/WindowMaker.h WindowMaker-0.92.0/src/WindowMaker.h
1702 --- WindowMaker-0.92.0.orig/src/WindowMaker.h 2009-10-28 13:11:59.547716000 +0100
1703 +++ WindowMaker-0.92.0/src/WindowMaker.h 2009-10-28 13:28:11.599489347 +0100
1704 @@ -478,6 +478,9 @@
1705 unsigned int workspace_border_size; /* Size in pixels of the workspace border */
1706 char workspace_border_position; /* Where to leave a workspace border */
1707
1708 + /* double click on title bar maximize */
1709 + char dc_maximize;
1710 +
1711 /* single click to lauch applications */
1712 char single_click;
1713
1714 diff -ur WindowMaker-0.92.0.orig/WPrefs.app/Expert.c WindowMaker-0.92.0/WPrefs.app/Expert.c
1715 --- WindowMaker-0.92.0.orig/WPrefs.app/Expert.c 2009-10-28 13:11:57.555080000 +0100
1716 +++ WindowMaker-0.92.0/WPrefs.app/Expert.c 2009-10-28 13:26:00.864274985 +0100
1717 @@ -55,6 +55,7 @@
1718 WMSetButtonSelected(panel->swi[5], GetBoolForKey("DisableBlinking"));
1719 WMSetButtonSelected(panel->swi[6], GetBoolForKey("AntialiasedText"));
1720 WMSetButtonSelected(panel->swi[7], GetBoolForKey("SingleClickLaunch"));
1721 + WMSetButtonSelected(panel->swi[8], GetBoolForKey("DCMaximize"));
1722 }
1723
1724
1725 @@ -67,10 +68,10 @@
1726 panel->box = WMCreateBox(panel->parent);
1727 WMSetViewExpandsToParent(WMWidgetView(panel->box), 2, 2, 2, 2);
1728
1729 - for (i=0; i<8; i++) {
1730 + for (i=0; i<9; i++) {
1731 panel->swi[i] = WMCreateSwitchButton(panel->box);
1732 WMResizeWidget(panel->swi[i], FRAME_WIDTH-40, 25);
1733 - WMMoveWidget(panel->swi[i], 20, 20+i*25);
1734 + WMMoveWidget(panel->swi[i], 20, 20+i*23);
1735 }
1736
1737 WMSetButtonText(panel->swi[0], _("Disable miniwindows (icons for minimized windows). For use with KDE/GNOME."));
1738 @@ -81,6 +82,7 @@
1739 WMSetButtonText(panel->swi[5], _("Disable selection animation for selected icons."));
1740 WMSetButtonText(panel->swi[6], _("Smooth font edges (needs restart)."));
1741 WMSetButtonText(panel->swi[7], _("Launch applications and restore windows with a single click."));
1742 + WMSetButtonText(panel->swi[8], _("Double click on title bar maximize"));
1743
1744 WMSetButtonEnabled(panel->swi[6], True);
1745
1746 @@ -106,6 +108,7 @@
1747 SetBoolForKey(WMGetButtonSelected(panel->swi[5]), "DisableBlinking");
1748 SetBoolForKey(WMGetButtonSelected(panel->swi[6]), "AntialiasedText");
1749 SetBoolForKey(WMGetButtonSelected(panel->swi[7]), "SingleClickLaunch");
1750 + SetBoolForKey(WMGetButtonSelected(panel->swi[8]), "DCMaximize");
1751 }
1752
1753
1754
1755
1756
1757 1.1 src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-empty-command-fatal-error.patch
1758
1759 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-empty-command-fatal-error.patch?rev=1.1&view=markup
1760 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-empty-command-fatal-error.patch?rev=1.1&content-type=text/plain
1761
1762 Index: windowmaker-0.92.0-empty-command-fatal-error.patch
1763 ===================================================================
1764
1765 # HG changeset patch
1766 # User John H. Robinson, IV <jaqque@××××.org>
1767 # Date 1229206923 28800
1768 # Node ID 9d3cac24b05fe672f821aa14d3dbed1a1cff1890
1769 # Parent ceef975fe4e697423f61314b3fa5cf0d44d7a21c
1770 Check for argc==0 when calling wtokensplit()
1771
1772 The WINGs-function wtokensplit does not set argv to NULL if no string has been
1773 split - instead argc is set to 0.
1774
1775 You can only observe this issue if you compile Window Maker without any
1776 optimization:
1777
1778 compile Window Maker with CFLAGS=""
1779 run Window Maker and save a session
1780 change session-file and replace a 'command xyz' line with 'command " "'
1781 restart Window Maker
1782 watch "Fatal error"-message
1783
1784 Author: Tobias Stoeckmann
1785 Retrieved from: http://paldium.homeunix.org/tobias/wmaker/
1786 Submitted by Gilbert Ashley <amigo@×××××××.org>
1787
1788 --- a/src/dock.c Sat Dec 13 14:18:06 2008 -0800
1789 +++ b/src/dock.c Sat Dec 13 14:22:03 2008 -0800
1790 @@ -2977,7 +2977,7 @@
1791
1792 wtokensplit(cmdline, &argv, &argc);
1793
1794 - if (argv==NULL) {
1795 + if (!argc) {
1796 if (cmdline)
1797 wfree(cmdline);
1798 if (state)
1799 --- a/src/session.c Sat Dec 13 14:18:06 2008 -0800
1800 +++ b/src/session.c Sat Dec 13 14:22:03 2008 -0800
1801 @@ -381,7 +381,7 @@
1802
1803 wtokensplit(command, &argv, &argc);
1804
1805 - if (argv==NULL) {
1806 + if (!argc) {
1807 return 0;
1808 }
1809
1810
1811
1812
1813
1814 1.1 src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-findfile-overflow.patch
1815
1816 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-findfile-overflow.patch?rev=1.1&view=markup
1817 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-findfile-overflow.patch?rev=1.1&content-type=text/plain
1818
1819 Index: windowmaker-0.92.0-findfile-overflow.patch
1820 ===================================================================
1821
1822 # HG changeset patch
1823 # User John H. Robinson, IV <jaqque@××××.org>
1824 # Date 1229207180 28800
1825 # Node ID 829f629ad8d832da06ca6446ec066f307a9ed285
1826 # Parent 9d3cac24b05fe672f821aa14d3dbed1a1cff1890
1827 Fix multiple errors in findfile.c
1828
1829 Problems:
1830
1831 1.)
1832 During expansion of path, the resulting path can overflow the supplied
1833 area of PATH_MAX+2 (buffer as well as buffer2). A tampered environment
1834 variable can be used to modify program flow.
1835
1836 Proof:
1837 [note: wmaker has been compiled with propolice]
1838 $ export A="[tested with 4096x A]"
1839 $ GNUSTEP_USER_ROOT="\$A\$A/\$A/\$A/" wmaker --for-real
1840
1841 --- a/WINGs/findfile.c Sat Dec 13 14:22:03 2008 -0800
1842 +++ b/WINGs/findfile.c Sat Dec 13 14:26:20 2008 -0800
1843 @@ -23,6 +23,7 @@
1844
1845 #include "WUtil.h"
1846
1847 +#include <errno.h>
1848 #include <stdlib.h>
1849 #include <unistd.h>
1850 #include <string.h>
1851 @@ -79,6 +80,7 @@
1852 char*
1853 wexpandpath(char *path)
1854 {
1855 + char *origpath = path;
1856 char buffer2[PATH_MAX+2];
1857 char buffer[PATH_MAX+2];
1858 int i;
1859 @@ -91,25 +93,29 @@
1860 path++;
1861 if (*path=='/' || *path==0) {
1862 home = wgethomedir();
1863 + if (strlen(home) > PATH_MAX)
1864 + goto error;
1865 strcat(buffer, home);
1866 } else {
1867 int j;
1868 j = 0;
1869 while (*path!=0 && *path!='/') {
1870 + if (j > PATH_MAX)
1871 + goto error;
1872 buffer2[j++] = *path;
1873 buffer2[j] = 0;
1874 path++;
1875 }
1876 home = getuserhomedir(buffer2);
1877 - if (!home)
1878 - return NULL;
1879 + if (!home || strlen(home) > PATH_MAX)
1880 + goto error;
1881 strcat(buffer, home);
1882 }
1883 }
1884
1885 i = strlen(buffer);
1886
1887 - while (*path!=0) {
1888 + while (*path!=0 && i <= PATH_MAX) {
1889 char *tmp;
1890
1891 if (*path=='$') {
1892 @@ -119,35 +125,50 @@
1893 if (*path=='(') {
1894 path++;
1895 while (*path!=0 && *path!=')') {
1896 + if (j > PATH_MAX)
1897 + goto error;
1898 buffer2[j++] = *(path++);
1899 buffer2[j] = 0;
1900 }
1901 - if (*path==')')
1902 + if (*path==')') {
1903 path++;
1904 - tmp = getenv(buffer2);
1905 + tmp = getenv(buffer2);
1906 + } else {
1907 + tmp = NULL;
1908 + }
1909 if (!tmp) {
1910 + if ((i += strlen(buffer2)+2) > PATH_MAX)
1911 + goto error;
1912 buffer[i] = 0;
1913 strcat(buffer, "$(");
1914 strcat(buffer, buffer2);
1915 - strcat(buffer, ")");
1916 - i += strlen(buffer2)+3;
1917 + if (*(path-1)==')') {
1918 + if (++i > PATH_MAX)
1919 + goto error;
1920 + strcat(buffer, ")");
1921 + }
1922 } else {
1923 + if ((i += strlen(tmp)) > PATH_MAX)
1924 + goto error;
1925 strcat(buffer, tmp);
1926 - i += strlen(tmp);
1927 }
1928 } else {
1929 while (*path!=0 && *path!='/') {
1930 + if (j > PATH_MAX)
1931 + goto error;
1932 buffer2[j++] = *(path++);
1933 buffer2[j] = 0;
1934 }
1935 tmp = getenv(buffer2);
1936 if (!tmp) {
1937 + if ((i += strlen(buffer2)+1) > PATH_MAX)
1938 + goto error;
1939 strcat(buffer, "$");
1940 strcat(buffer, buffer2);
1941 - i += strlen(buffer2)+1;
1942 } else {
1943 + if ((i += strlen(tmp)) > PATH_MAX)
1944 + goto error;
1945 strcat(buffer, tmp);
1946 - i += strlen(tmp);
1947 }
1948 }
1949 } else {
1950 @@ -156,7 +177,16 @@
1951 }
1952 }
1953
1954 + if (*path!=0)
1955 + goto error;
1956 +
1957 return wstrdup(buffer);
1958 +
1959 +error:
1960 + errno = ENAMETOOLONG;
1961 + wsyserror(_("could not expand %s"), origpath);
1962 + /* FIXME: too many functions handle a return value of NULL incorrectly */
1963 + exit(1);
1964 }
1965
1966
1967
1968
1969
1970
1971 1.1 src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-gettext.patch
1972
1973 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-gettext.patch?rev=1.1&view=markup
1974 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-gettext.patch?rev=1.1&content-type=text/plain
1975
1976 Index: windowmaker-0.92.0-gettext.patch
1977 ===================================================================
1978 * drawback of not using AM_GNU_GETTEXT is that you have to cope with
1979 Solaris defining gettext(), but we want GNU gettext, which is in
1980 -lintl
1981
1982 --- configure.ac
1983 +++ configure.ac
1984 @@ -247,9 +247,9 @@
1985
1986 INTLIBS=""
1987
1988 -AC_CHECK_FUNC(gettext, [HAVEGETTEXT="yes"],
1989 - AC_CHECK_LIB(intl, gettext, [INTLIBS="-lintl" HAVEGETTEXT="yes"],
1990 - INTLIBS="" ))
1991 +AC_CHECK_LIB(intl, gettext, [INTLIBS="-lintl" [HAVEGETTEXT="yes"]], [
1992 + INTLIBS=""
1993 + AC_CHECK_FUNC(gettext, [HAVEGETTEXT="yes"]) ])
1994
1995 AC_CHECK_PROG(XGETTEXT, xgettext, xgettext)
1996
1997
1998
1999
2000 1.1 src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-gif-before-ungif.patch
2001
2002 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-gif-before-ungif.patch?rev=1.1&view=markup
2003 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-gif-before-ungif.patch?rev=1.1&content-type=text/plain
2004
2005 Index: windowmaker-0.92.0-gif-before-ungif.patch
2006 ===================================================================
2007 --- configure.ac
2008 +++ configure.ac
2009 @@ -705,17 +705,17 @@
2010
2011 if test "$gif" = yes; then
2012 my_libname=""
2013 - WM_CHECK_LIB(ungif, DGifOpenFileName, [$XLFLAGS $XLIBS])
2014 - if test "x$ac_cv_lib_ungif_DGifOpenFileName" = xyes; then
2015 - my_libname=-lungif
2016 + WM_CHECK_LIB(gif, DGifOpenFileName, [$XLFLAGS $XLIBS])
2017 + if test "x$ac_cv_lib_gif_DGifOpenFileName" = xyes; then
2018 + my_libname=-lgif
2019 fi
2020 dnl
2021 dnl libungif is the same thing as libgif for all practical purposes.
2022 dnl
2023 if test "x$my_libname" = x; then
2024 - WM_CHECK_LIB(gif, DGifOpenFileName, [$XLFLAGS $XLIBS])
2025 - if test "x$ac_cv_lib_gif_DGifOpenFileName" = xyes; then
2026 - my_libname=-lgif
2027 + WM_CHECK_LIB(ungif, DGifOpenFileName, [$XLFLAGS $XLIBS])
2028 + if test "x$ac_cv_lib_ungif_DGifOpenFileName" = xyes; then
2029 + my_libname=-lungif
2030 fi
2031 fi
2032
2033
2034
2035
2036 1.1 src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-interix3.patch
2037
2038 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-interix3.patch?rev=1.1&view=markup
2039 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-interix3.patch?rev=1.1&content-type=text/plain
2040
2041 Index: windowmaker-0.92.0-interix3.patch
2042 ===================================================================
2043 windows doesn't have socklen_t
2044
2045 --- WindowMaker-0.92.0.orig/WINGs/connection.c 2008-08-18 10:17:56 +0200
2046 +++ WindowMaker-0.92.0/WINGs/connection.c 2008-08-18 10:25:11 +0200
2047 @@ -201,7 +201,7 @@
2048
2049 if (cPtr->state == WCInProgress) {
2050 Bool failed;
2051 - socklen_t len = sizeof(result);
2052 + int len = sizeof(result);
2053
2054 WCErrorCode = 0;
2055 if (getsockopt(cPtr->sock, SOL_SOCKET, SO_ERROR,
2056 @@ -462,7 +462,7 @@
2057 {
2058 WMConnection *cPtr;
2059 struct sockaddr_in *socketaddr;
2060 - socklen_t size;
2061 + int size;
2062 int sock, on;
2063
2064 WCErrorCode = 0;
2065 @@ -678,7 +678,7 @@
2066 WMAcceptConnection(WMConnection *listener)
2067 {
2068 struct sockaddr_in clientname;
2069 - socklen_t size;
2070 + int size;
2071 int newSock;
2072 WMConnection *newConnection;
2073
2074
2075
2076
2077 1.1 src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-math_h.patch
2078
2079 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-math_h.patch?rev=1.1&view=markup
2080 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-math_h.patch?rev=1.1&content-type=text/plain
2081
2082 Index: windowmaker-0.92.0-math_h.patch
2083 ===================================================================
2084
2085 Add a missing #include <math.h>.
2086
2087 --- WindowMaker-0.92.0/configure.ac
2088 +++ WindowMaker-0.92.0/configure.ac
2089 @@ -78,7 +78,8 @@
2090 [ --with-incs-from pass compiler flags to look for header files],
2091 [inc_search_path="$withval $inc_search_path"])
2092
2093 -
2094 +AC_CHECK_LIBM
2095 +AC_SUBST([LIBM])
2096
2097 dnl Checks for library functions.
2098 dnl ============================
2099 --- WindowMaker-0.92.0/src/placement.c
2100 +++ WindowMaker-0.92.0/src/placement.c
2101 @@ -27,6 +27,7 @@
2102 #include <stdio.h>
2103 #include <string.h>
2104 #include <limits.h>
2105 +#include <math.h>
2106
2107 #include "WindowMaker.h"
2108 #include "wcore.h"
2109
2110
2111
2112 1.1 src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-maximise-borderless-too-small.patch
2113
2114 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-maximise-borderless-too-small.patch?rev=1.1&view=markup
2115 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-maximise-borderless-too-small.patch?rev=1.1&content-type=text/plain
2116
2117 Index: windowmaker-0.92.0-maximise-borderless-too-small.patch
2118 ===================================================================
2119
2120 # HG changeset patch
2121 # User John H. Robinson, IV <jaqque@××××.org>
2122 # Date 1229205014 28800
2123 # Node ID ff96eb3a10c98136aa55acf0caff18b69ca48ae0
2124 # Parent cc00640a0aa908707adc6de8c0f5c60235493df0
2125 Maximize borderless fix missing pixels
2126
2127 A minor bug has been bothering me for a long time. When you maximize a
2128 borderless window in Window Maker, the window ends up too narrow and too short
2129 by two pixels. I've attached a patch against CVS to fix the problem.
2130
2131 Submitted by: Gilbert Ashley <amigo@×××××××.org>
2132 Author: David Benbennick <dbenbenn@×××××.com>
2133
2134 --- a/src/actions.c Sat Dec 13 13:48:24 2008 -0800
2135 +++ b/src/actions.c Sat Dec 13 13:50:14 2008 -0800
2136 @@ -428,7 +428,9 @@
2137 wwin->flags.maximized = directions;
2138
2139 if (directions & MAX_HORIZONTAL) {
2140 - new_width = (usableArea.x2-usableArea.x1)-FRAME_BORDER_WIDTH*2;
2141 + new_width = usableArea.x2 - usableArea.x1;
2142 + if (HAS_BORDER(wwin))
2143 + new_width -= FRAME_BORDER_WIDTH * 2;
2144 new_x = usableArea.x1;
2145 } else if (shrink_h) {
2146 new_x = wwin->old_geometry.x;
2147 @@ -439,7 +441,9 @@
2148 }
2149
2150 if (directions & MAX_VERTICAL) {
2151 - new_height = (usableArea.y2-usableArea.y1)-FRAME_BORDER_WIDTH*2;
2152 + new_height = usableArea.y2 - usableArea.y1;
2153 + if (HAS_BORDER(wwin))
2154 + new_height -= FRAME_BORDER_WIDTH * 2;
2155 new_y = usableArea.y1;
2156 if (WFLAGP(wwin, full_maximize)) {
2157 new_y -= wwin->frame->top_width;
2158
2159
2160
2161
2162 1.1 src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-mouse-window-focus.patch
2163
2164 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-mouse-window-focus.patch?rev=1.1&view=markup
2165 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-mouse-window-focus.patch?rev=1.1&content-type=text/plain
2166
2167 Index: windowmaker-0.92.0-mouse-window-focus.patch
2168 ===================================================================
2169
2170 # HG changeset patch
2171 # User John H. Robinson, IV <jhriv@××××.edu>
2172 # Date 1225266843 25200
2173 # Node ID 8640d186c4f424a9c7977cb3672ab96e855c36fa
2174 # Parent ce1b81cb49375becb2268da560cb586f9aaf7bb6
2175 Fixed inability to focus windows via mouse
2176
2177
2178 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=102314
2179 Pedro Gimeno <parigalo@××××××××.es>
2180
2181 I found this statement in actions.c (function wSetFocusTo) suspicious:
2182
2183 if (scr->flags.ignore_focus_events || LastFocusChange > timestamp)
2184 return;
2185
2186 timestamp is defined like this:
2187
2188 int timestamp=LastTimestamp;
2189
2190 where LastTimestamp is of type Time (which is an unsigned 32-bit integer
2191 according to my /usr/include/X11/X.h) and so is LastFocusChange.
2192
2193 This way of comparing timestamps is broken and not only because of the
2194 signedness. If this is the cause of this bug, then it should be
2195 reproducable exactly every 24 days, 20 hours, 31 mins, 23.648 seconds
2196 (which is 2^31 milliseconds) or maybe the double.
2197
2198 I've attached a patch that compares the timestamps properly. It is done
2199 against version 0.92.0-6.1 which is current in etch as of this writing.
2200
2201 I have just checked that it does not seem to break anything and that
2202 reverting the condition (the direction of the comparison) causes the
2203 expected symptoms. I have not verified that the bug is periodic, so I
2204 can't be sure that this will fix it. If necessary I can wait for another
2205 24 days (or maybe 48) if no downtime happens here, to verify the
2206 periodicity of the bug and another 24 (or 48) more to check if the fix
2207 works.
2208
2209 --- a/src/actions.c Sun Oct 26 21:42:52 2008 -0700
2210 +++ b/src/actions.c Wed Oct 29 00:54:03 2008 -0700
2211 @@ -78,6 +78,15 @@
2212 #define SHADE_STEPS shadePars[(int)wPreferences.shade_speed].steps
2213 #define SHADE_DELAY shadePars[(int)wPreferences.shade_speed].delay
2214
2215 +static int
2216 +compareTimes(Time t1, Time t2)
2217 +{
2218 + Time diff;
2219 + if (t1 == t2)
2220 + return 0;
2221 + diff = t1 - t2;
2222 + return (diff < 60000) ? 1 : -1;
2223 +}
2224
2225 /*
2226 *----------------------------------------------------------------------
2227 @@ -99,11 +108,11 @@
2228
2229 WWindow *old_focused;
2230 WWindow *focused=scr->focused_window;
2231 - int timestamp=LastTimestamp;
2232 + Time timestamp=LastTimestamp;
2233 WApplication *oapp=NULL, *napp=NULL;
2234 int wasfocused;
2235
2236 - if (scr->flags.ignore_focus_events || LastFocusChange > timestamp)
2237 + if (scr->flags.ignore_focus_events || compareTimes(LastFocusChange, timestamp) > 0)
2238 return;
2239
2240 if (!old_scr)
2241
2242
2243
2244
2245 1.1 src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-nls.patch
2246
2247 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-nls.patch?rev=1.1&view=markup
2248 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-nls.patch?rev=1.1&content-type=text/plain
2249
2250 Index: windowmaker-0.92.0-nls.patch
2251 ===================================================================
2252 * use AM_GNU_GETTEXT macro, but do not enable, it requires gettext to be
2253 installed in order to run autoconf
2254 * make sure we really don't need gettext
2255
2256 *--- configure.ac
2257 *+++ configure.ac
2258 *@@ -241,15 +241,16 @@
2259 * dnl -------
2260 *
2261 *
2262 *-dnl AM_GNU_GETTEXT
2263 *+#NLSENABLE AM_GNU_GETTEXT([external])
2264 *+#NLSENABLE HAVEGETTEXT="${USE_NLS}"
2265 *+#NLSENABLE INTLIBS="${LIBINTL}"
2266 *
2267 *
2268 *-
2269 *-INTLIBS=""
2270 *-
2271 *-AC_CHECK_LIB(intl, gettext, [INTLIBS="-lintl" [HAVEGETTEXT="yes"]], [
2272 *- INTLIBS=""
2273 *- AC_CHECK_FUNC(gettext, [HAVEGETTEXT="yes"]) ])
2274 *+dnl INTLIBS=""
2275 *+dnl
2276 *+dnl AC_CHECK_LIB(intl, gettext, [INTLIBS="-lintl" [HAVEGETTEXT="yes"]], [
2277 *+dnl INTLIBS=""
2278 *+dnl AC_CHECK_FUNC(gettext, [HAVEGETTEXT="yes"]) ])
2279 *
2280 * AC_CHECK_PROG(XGETTEXT, xgettext, xgettext)
2281 *
2282 --- src/misc.c
2283 +++ src/misc.c
2284 @@ -645,13 +645,13 @@
2285
2286 if(advanced)
2287 rv = wAdvancedInputDialog(scr,
2288 - title ? gettext(title):_("Program Arguments"),
2289 - prompt ? gettext(prompt):_("Enter command arguments:"),
2290 + title ? _(title):_("Program Arguments"),
2291 + prompt ? _(prompt):_("Enter command arguments:"),
2292 name, &ret);
2293 else
2294 rv = wInputDialog(scr,
2295 - title ? gettext(title):_("Program Arguments"),
2296 - prompt ? gettext(prompt):_("Enter command arguments:"),
2297 + title ? _(title):_("Program Arguments"),
2298 + prompt ? _(prompt):_("Enter command arguments:"),
2299 &ret);
2300
2301 if(title) wfree(title);
2302 --- src/rootmenu.c
2303 +++ src/rootmenu.c
2304 @@ -363,8 +363,11 @@
2305 if(!strncmp(NOTRANSLATE_PREFIX, title, strlen(NOTRANSLATE_PREFIX)))
2306 return title + strlen(NOTRANSLATE_PREFIX);
2307 if(wPreferences.translate_menu)
2308 + #if defined(HAVE_LIBINTL_H) && defined(I18N)
2309 return dgettext("menu-messages", title);
2310 + #else
2311 return title;
2312 + #endif
2313 }
2314
2315 /********************************************************************/
2316
2317
2318
2319 1.1 src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-no-clip-title.patch
2320
2321 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-no-clip-title.patch?rev=1.1&view=markup
2322 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-no-clip-title.patch?rev=1.1&content-type=text/plain
2323
2324 Index: windowmaker-0.92.0-no-clip-title.patch
2325 ===================================================================
2326 Only in WindowMaker-0.92.0: nocliptitle.patch
2327 diff -ur WindowMaker-0.92.0.orig/src/defaults.c WindowMaker-0.92.0/src/defaults.c
2328 --- WindowMaker-0.92.0.orig/src/defaults.c 2009-10-28 13:07:57.594817000 +0100
2329 +++ WindowMaker-0.92.0/src/defaults.c 2009-10-28 13:09:19.223404220 +0100
2330 @@ -623,6 +623,9 @@
2331 {"ClipTitleFont", DEF_CLIP_TITLE_FONT, NULL,
2332 NULL, getFont, setClipTitleFont
2333 },
2334 + {"ShowClipTitle", "YES", NULL,
2335 + &wPreferences.show_clip_title, getBool, NULL
2336 + },
2337 {"LargeDisplayFont",DEF_WORKSPACE_NAME_FONT, NULL,
2338 NULL, getFont, setLargeDisplayFont
2339 },
2340 Only in WindowMaker-0.92.0/src: defaults.c.orig
2341 diff -ur WindowMaker-0.92.0.orig/src/dock.c WindowMaker-0.92.0/src/dock.c
2342 --- WindowMaker-0.92.0.orig/src/dock.c 2009-10-28 13:07:56.325404000 +0100
2343 +++ WindowMaker-0.92.0/src/dock.c 2009-10-28 13:09:19.221166695 +0100
2344 @@ -1293,8 +1293,9 @@
2345
2346 tx = CLIP_BUTTON_SIZE*ICON_SIZE/64;
2347
2348 - WMDrawString(scr->wmscreen, win, color, scr->clip_title_font, tx,
2349 - ty, ws_name, length);
2350 + if(wPreferences.show_clip_title)
2351 + WMDrawString(scr->wmscreen, win, color, scr->clip_title_font, tx,
2352 + ty, ws_name, length);
2353 /*WMDrawString(scr->wmscreen, win, color, scr->clip_title_font, 4,
2354 2, ws_name, length);*/
2355
2356 Only in WindowMaker-0.92.0/src: dock.c.orig
2357 diff -ur WindowMaker-0.92.0.orig/src/WindowMaker.h WindowMaker-0.92.0/src/WindowMaker.h
2358 --- WindowMaker-0.92.0.orig/src/WindowMaker.h 2009-10-28 13:07:57.595432000 +0100
2359 +++ WindowMaker-0.92.0/src/WindowMaker.h 2009-10-28 13:09:56.616645224 +0100
2360 @@ -481,6 +481,8 @@
2361 /* single click to lauch applications */
2362 char single_click;
2363
2364 + int show_clip_title;
2365 +
2366 RImage *swtileImage;
2367 RImage *swbackImage[9];
2368
2369 Only in WindowMaker-0.92.0/src: WindowMaker.h.orig
2370 Only in WindowMaker-0.92.0/src: WindowMaker.h.rej
2371
2372
2373
2374 1.1 src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-no-pop-empty-array.patch
2375
2376 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-no-pop-empty-array.patch?rev=1.1&view=markup
2377 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-no-pop-empty-array.patch?rev=1.1&content-type=text/plain
2378
2379 Index: windowmaker-0.92.0-no-pop-empty-array.patch
2380 ===================================================================
2381
2382 # HG changeset patch
2383 # User John H. Robinson, IV <jaqque@××××.org>
2384 # Date 1229206686 28800
2385 # Node ID ceef975fe4e697423f61314b3fa5cf0d44d7a21c
2386 # Parent 17b8b5652f973923c0e07baddeb5765d9acedf55
2387 Do not allow a pop from array if no more items are left
2388
2389 Author: Tobias Stoeckmann
2390 Retrieved from: http://paldium.homeunix.org/tobias/wmaker/
2391 Submitted by: Gilbert Ashley <amigo@×××××××.org>
2392
2393 --- a/WINGs/array.c Sat Dec 13 14:17:09 2008 -0800
2394 +++ b/WINGs/array.c Sat Dec 13 14:18:06 2008 -0800
2395 @@ -230,6 +230,8 @@
2396 void*
2397 WMPopFromArray(WMArray *array)
2398 {
2399 + wassertr(array->itemCount > 0);
2400 +
2401 array->itemCount--;
2402
2403 return array->items[array->itemCount];
2404
2405
2406
2407
2408 1.1 src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-pointer-integer-warn-fix.patch
2409
2410 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-pointer-integer-warn-fix.patch?rev=1.1&view=markup
2411 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-pointer-integer-warn-fix.patch?rev=1.1&content-type=text/plain
2412
2413 Index: windowmaker-0.92.0-pointer-integer-warn-fix.patch
2414 ===================================================================
2415
2416 # HG changeset patch
2417 # User Carlos R. Mafra <crmafra@×××××××.de>
2418 # Date 1225932989 -3600
2419 # Node ID 39c2c334b1cc3c160da95c0042e1f073048519ad
2420 # Parent 112d01554c5363665c3dc108d5aaba87306da351
2421 wmaker: Fix compiler warnings about pointer <--> integer conversion
2422
2423 There may be issues with running applications in 64-bit mode when
2424 they were written with tacit assumptions about 32-bit platforms.
2425 For example,
2426
2427 * Assuming that a pointer can be cast back and forth to an integer
2428
2429 The reason is that the size of the integer and pointer may be different.
2430 See the description of "[PATCH] Warn when casting a pointer (constant)
2431 to an integer of different size." in the gcc mailing list
2432
2433 http://gcc.gnu.org/ml/gcc-patches/2005-12/msg01881.html
2434
2435 where it was also suggested the use of casts to uintptr_t. This is
2436 what this patch does.
2437
2438 As a result the following warnings are fixed, leaving us with an
2439 almost warning-free compilation in 64-bits:
2440
2441 defaults.c:1446: warning: cast to pointer from integer of different size
2442 defaults.c:1457: warning: cast to pointer from integer of different size
2443 defaults.c:1471: warning: cast to pointer from integer of different size
2444 defaults.c:1486: warning: cast to pointer from integer of different size
2445 icon.c:67: warning: cast from pointer to integer of different size
2446 menu.c:112: warning: cast from pointer to integer of different size
2447 switchmenu.c:452: warning: cast from pointer to integer of different size
2448 window.c:140: warning: cast from pointer to integer of different size
2449 window.c:2217: warning: cast to pointer from integer of different size
2450 workspace.c:135: warning: cast to pointer from integer of different size
2451 workspace.c:214: warning: cast to pointer from integer of different size
2452 workspace.c:634: warning: cast to pointer from integer of different size
2453 workspace.c:1330: warning: cast to pointer from integer of different size
2454 workspace.c:1514: warning: cast to pointer from integer of different size
2455 wfilepanel.c:135: warning: cast from pointer to integer of different size
2456 wfilepanel.c:171: warning: cast from pointer to integer of different size
2457 wfontpanel.c:499: warning: cast to pointer from integer of different size
2458 wfontpanel.c:500: warning: cast to pointer from integer of different size
2459 wfontpanel.c:505: warning: cast to pointer from integer of different size
2460 wfontpanel.c:506: warning: cast to pointer from integer of different size
2461 wfontpanel.c:776: warning: cast from pointer to integer of different size
2462 wfontpanel.c:777: warning: cast from pointer to integer of different size
2463 wfontpanel.c:877: warning: cast from pointer to integer of different size
2464 wfontpanel.c:878: warning: cast from pointer to integer of different size
2465 wpanel.c:363: warning: cast from pointer to integer of different size
2466 fontl.c:42: warning: cast from pointer to integer of different size
2467 fontl.c:42: warning: cast from pointer to integer of different size
2468 fontl.c:42: warning: cast from pointer to integer of different size
2469 fontl.c:90: warning: cast to pointer from integer of different size
2470 puzzle.c:138: warning: cast from pointer to integer of different size
2471 puzzle.c:225: warning: cast to pointer from integer of different size
2472 wtableview.c:1031: warning: cast to pointer from integer of different size
2473 wtableview.c:1067: warning: cast to pointer from integer of different size
2474 wtableview.c:1069: warning: cast to pointer from integer of different size
2475 wtableview.c:1074: warning: cast to pointer from integer of different size
2476 wtabledelegates.c:234: warning: cast from pointer to integer of different size
2477 wtabledelegates.c:250: warning: cast from pointer to integer of different size
2478 wtabledelegates.c:265: warning: cast from pointer to integer of different size
2479 wtabledelegates.c:287: warning: cast to pointer from integer of different size
2480 wtabledelegates.c:351: warning: cast from pointer to integer of different size
2481 wtabledelegates.c:372: warning: cast from pointer to integer of different size
2482 wtabledelegates.c:393: warning: cast from pointer to integer of different size
2483 wtabledelegates.c:410: warning: cast to pointer from integer of different size
2484 test.c:44: warning: cast from pointer to integer of different size
2485 test.c:47: warning: cast to pointer from integer of different size
2486 test.c:55: warning: cast from pointer to integer of different size
2487 test.c:58: warning: cast from pointer to integer of different size
2488
2489 --- a/WINGs/Examples/fontl.c Sat Dec 13 14:27:52 2008 -0800
2490 +++ b/WINGs/Examples/fontl.c Thu Nov 06 01:56:29 2008 +0100
2491 @@ -24,6 +24,7 @@
2492
2493 #include <stdlib.h>
2494 #include <stdio.h>
2495 +#include <stdint.h>
2496 #include <WINGs/WINGs.h>
2497 #include <WINGs/WUtil.h>
2498
2499 @@ -39,7 +40,8 @@
2500 void *d;
2501 WMLabel *l = (WMLabel*)data;
2502 d = WMGetHangedData(self);
2503 - sprintf(buf, "%i - 0x%x - 0%o", (int)d, (int)d, (int)d);
2504 + sprintf(buf, "%i - 0x%x - 0%o", (int)(uintptr_t)d, (int)(uintptr_t)d,
2505 + (int)(uintptr_t)d);
2506 WMSetLabelText(l, buf);
2507 }
2508
2509 @@ -87,7 +89,7 @@
2510 sprintf(buf, "%c", c);
2511 WMSetButtonText(lab, buf);
2512 WMSetButtonAction(lab, show, pos);
2513 - WMHangData(lab, (void*)c);
2514 + WMHangData(lab, (void*)(uintptr_t)c);
2515 if (c>0) {
2516 WMGroupButtons(l0, lab);
2517 } else {
2518 --- a/WINGs/Examples/puzzle.c Sat Dec 13 14:27:52 2008 -0800
2519 +++ b/WINGs/Examples/puzzle.c Thu Nov 06 01:56:29 2008 +0100
2520 @@ -4,7 +4,7 @@
2521 #include <stdlib.h>
2522 #include <stdio.h>
2523 #include <WINGs/WINGs.h>
2524 -
2525 +#include <stdint.h>
2526
2527
2528 #define MAX_SIZE 10*10
2529 @@ -135,7 +135,7 @@
2530 {
2531 char buffer[300];
2532
2533 - if (SlideButton((int)ptr)) {
2534 + if (SlideButton((int)(uintptr_t)ptr)) {
2535 MoveCount++;
2536
2537 if (CheckWin()) {
2538 @@ -222,7 +222,7 @@
2539 Button[i] = WMCreateButton(win, WBTMomentaryLight);
2540 WMSetWidgetBackgroundColor(Button[i], color);
2541 WMReleaseColor(color);
2542 - WMSetButtonAction(Button[i], buttonClick, (void*)i);
2543 + WMSetButtonAction(Button[i], buttonClick, (void*)(uintptr_t)i);
2544 WMResizeWidget(Button[i], WinSize/Size, WinSize/Size);
2545 WMMoveWidget(Button[i], x*(WinSize/Size), y*(WinSize/Size));
2546 sprintf(buf, "%i", i+1);
2547 --- a/WINGs/Extras/test.c Sat Dec 13 14:27:52 2008 -0800
2548 +++ b/WINGs/Extras/test.c Thu Nov 06 01:56:29 2008 +0100
2549 @@ -2,6 +2,7 @@
2550
2551 #include <WINGs/WINGs.h>
2552 #include <stdio.h>
2553 +#include <stdint.h>
2554 #include "wtableview.h"
2555 #include "wtabledelegates.h"
2556
2557 @@ -41,10 +42,10 @@
2558 col2[i] = 0;
2559 }
2560 }
2561 - if ((int)WMGetTableColumnId(column) == 1)
2562 + if ((int)(uintptr_t)WMGetTableColumnId(column) == 1)
2563 return col1[row];
2564 else
2565 - return (void*)col2[row];
2566 + return (void*)(uintptr_t)col2[row];
2567 }
2568
2569
2570 @@ -52,10 +53,10 @@
2571 setValueForCell(WMTableViewDelegate *self, WMTableColumn *column, int row,
2572 void *data)
2573 {
2574 - if ((int)WMGetTableColumnId(column) == 1)
2575 + if ((int)(uintptr_t)WMGetTableColumnId(column) == 1)
2576 col1[row] = data;
2577 else
2578 - col2[row] = (int)data;
2579 + col2[row] = (int)(uintptr_t)data;
2580 }
2581
2582
2583 --- a/WINGs/Extras/wtabledelegates.c Sat Dec 13 14:27:52 2008 -0800
2584 +++ b/WINGs/Extras/wtabledelegates.c Thu Nov 06 01:56:29 2008 +0100
2585 @@ -1,5 +1,5 @@
2586
2587 -
2588 +#include <stdint.h>
2589 #include <WINGs/WINGsP.h>
2590
2591 #include "wtableview.h"
2592 @@ -231,7 +231,7 @@
2593 {
2594 EnumSelectorData *strdata = (EnumSelectorData*)self->data;
2595 WMTableView *table = WMGetTableColumnTableView(column);
2596 - int i = (int)WMTableViewDataForCell(table, column, row);
2597 + int i = (int)(uintptr_t)WMTableViewDataForCell(table, column, row);
2598
2599 stringDraw(WMWidgetScreen(table), d,
2600 strdata->gc, strdata->selGC, strdata->textColor, strdata->font,
2601 @@ -247,7 +247,7 @@
2602 {
2603 EnumSelectorData *strdata = (EnumSelectorData*)self->data;
2604 WMTableView *table = WMGetTableColumnTableView(column);
2605 - int i = (int)WMTableViewDataForCell(table, column, row);
2606 + int i = (int)(uintptr_t)WMTableViewDataForCell(table, column, row);
2607
2608 stringDraw(WMWidgetScreen(table), d,
2609 strdata->gc, strdata->selGC, strdata->textColor, strdata->font,
2610 @@ -262,7 +262,7 @@
2611 {
2612 EnumSelectorData *strdata = (EnumSelectorData*)self->data;
2613 WMRect rect = WMTableViewRectForCell(strdata->table, column, row);
2614 - int data = (int)WMTableViewDataForCell(strdata->table, column, row);
2615 + int data = (int)(uintptr_t)WMTableViewDataForCell(strdata->table, column, row);
2616
2617 wassertr(data < strdata->count);
2618
2619 @@ -284,7 +284,7 @@
2620 WMUnmapWidget(strdata->widget);
2621
2622 option = WMGetPopUpButtonSelectedItem(strdata->widget);
2623 - WMSetTableViewDataForCell(strdata->table, column, row, (void*)option);
2624 + WMSetTableViewDataForCell(strdata->table, column, row, (void*)(uintptr_t)option);
2625 }
2626
2627
2628 @@ -348,7 +348,7 @@
2629 {
2630 BooleanSwitchData *strdata = (BooleanSwitchData*)self->data;
2631 WMTableView *table = WMGetTableColumnTableView(column);
2632 - int i = (int)WMTableViewDataForCell(table, column, row);
2633 + int i = (int)(uintptr_t)WMTableViewDataForCell(table, column, row);
2634 WMScreen *scr = WMWidgetScreen(table);
2635
2636 if (i) {
2637 @@ -369,7 +369,7 @@
2638 {
2639 BooleanSwitchData *strdata = (BooleanSwitchData*)self->data;
2640 WMTableView *table = WMGetTableColumnTableView(column);
2641 - int i = (int)WMTableViewDataForCell(table, column, row);
2642 + int i = (int)(uintptr_t)WMTableViewDataForCell(table, column, row);
2643 WMScreen *scr = WMWidgetScreen(table);
2644
2645 if (i) {
2646 @@ -390,7 +390,7 @@
2647 {
2648 BooleanSwitchData *strdata = (BooleanSwitchData*)self->data;
2649 WMRect rect = WMTableViewRectForCell(strdata->table, column, row);
2650 - int data = (int)WMTableViewDataForCell(strdata->table, column, row);
2651 + int data = (int)(uintptr_t)WMTableViewDataForCell(strdata->table, column, row);
2652
2653 WMSetButtonSelected(strdata->widget, data);
2654 WMMoveWidget(strdata->widget, rect.pos.x+1, rect.pos.y+1);
2655 @@ -407,7 +407,7 @@
2656 int value;
2657
2658 value = WMGetButtonSelected(strdata->widget);
2659 - WMSetTableViewDataForCell(strdata->table, column, row, (void*)value);
2660 + WMSetTableViewDataForCell(strdata->table, column, row, (void*)(uintptr_t)value);
2661 WMUnmapWidget(strdata->widget);
2662 }
2663
2664 --- a/WINGs/Extras/wtableview.c Sat Dec 13 14:27:52 2008 -0800
2665 +++ b/WINGs/Extras/wtableview.c Thu Nov 06 01:56:29 2008 +0100
2666 @@ -2,6 +2,7 @@
2667
2668 #include <WINGs/WINGsP.h>
2669 #include <X11/cursorfont.h>
2670 +#include <stdint.h>
2671
2672 #include "wtableview.h"
2673
2674 @@ -1028,7 +1029,7 @@
2675 if (!column->delegate || !column->delegate->drawCell)
2676 continue;
2677
2678 - if (WMFindInArray(table->selectedRows, NULL, (void*)row) != WANotFound)
2679 + if (WMFindInArray(table->selectedRows, NULL, (void*)(uintptr_t)row) != WANotFound)
2680 (*column->delegate->drawSelectedCell)(column->delegate, column, row, d);
2681 else
2682 (*column->delegate->drawCell)(column->delegate, column, row, d);
2683 @@ -1064,14 +1065,14 @@
2684 {
2685 int repaint = 0;
2686
2687 - if (WMFindInArray(table->selectedRows, NULL, (void*)row) != WANotFound) {
2688 + if (WMFindInArray(table->selectedRows, NULL, (void*)(uintptr_t)row) != WANotFound) {
2689 if (!flag) {
2690 - WMRemoveFromArray(table->selectedRows, (void*)row);
2691 + WMRemoveFromArray(table->selectedRows, (void*)(uintptr_t)row);
2692 repaint = 1;
2693 }
2694 } else {
2695 if (flag) {
2696 - WMAddToArray(table->selectedRows, (void*)row);
2697 + WMAddToArray(table->selectedRows, (void*)(uintptr_t)row);
2698 repaint = 1;
2699 }
2700 }
2701 --- a/WINGs/wfilepanel.c Sat Dec 13 14:27:52 2008 -0800
2702 +++ b/WINGs/wfilepanel.c Thu Nov 06 01:56:29 2008 +0100
2703 @@ -8,6 +8,7 @@
2704 #include <dirent.h>
2705 #include <limits.h>
2706 #include <errno.h>
2707 +#include <stdint.h>
2708
2709 #ifndef PATH_MAX
2710 #define PATH_MAX 1024
2711 @@ -132,7 +133,7 @@
2712 return;
2713
2714 text = WMGetTextFieldText(panel->fileField);
2715 - textEvent = (int)WMGetNotificationClientData(notification);
2716 + textEvent = (int)(uintptr_t)WMGetNotificationClientData(notification);
2717
2718 if (panel->flags.autoCompletion && textEvent!=WMDeleteTextEvent)
2719 i = closestListItem(list, text, False);
2720 @@ -168,7 +169,7 @@
2721 {
2722 W_FilePanel *panel = (W_FilePanel*)observerData;
2723
2724 - if ((int)WMGetNotificationClientData(notification)==WMReturnTextMovement) {
2725 + if ((int)(uintptr_t)WMGetNotificationClientData(notification)==WMReturnTextMovement) {
2726 WMPerformButtonClick(panel->okButton);
2727 }
2728 }
2729 --- a/WINGs/wfontpanel.c Sat Dec 13 14:27:52 2008 -0800
2730 +++ b/WINGs/wfontpanel.c Thu Nov 06 01:56:29 2008 +0100
2731 @@ -8,6 +8,7 @@
2732
2733 #include <ctype.h>
2734 #include <string.h>
2735 +#include <stdint.h>
2736
2737 #include <X11/Xft/Xft.h>
2738 #include <fontconfig/fontconfig.h>
2739 @@ -496,14 +497,14 @@
2740 for (j = 0; j < sizeof(scalableFontSizes)/sizeof(int); j++) {
2741 size = scalableFontSizes[j];
2742
2743 - if (!WMCountInArray(face->sizes, (void*)size)) {
2744 - WMAddToArray(face->sizes, (void*)size);
2745 + if (!WMCountInArray(face->sizes, (void*)(uintptr_t)size)) {
2746 + WMAddToArray(face->sizes, (void*)(uintptr_t)size);
2747 }
2748 }
2749 WMSortArray(face->sizes, compare_int);
2750 } else {
2751 - if (!WMCountInArray(face->sizes, (void*)size)) {
2752 - WMAddToArray(face->sizes, (void*)size);
2753 + if (!WMCountInArray(face->sizes, (void*)(uintptr_t)size)) {
2754 + WMAddToArray(face->sizes, (void*)(uintptr_t)size);
2755 WMSortArray(face->sizes, compare_int);
2756 }
2757 }
2758 @@ -773,8 +774,8 @@
2759 WMClearList(panel->sizLs);
2760
2761 WM_ITERATE_ARRAY(face->sizes, size, i) {
2762 - if ((int)size != 0) {
2763 - sprintf(buffer, "%i", (int)size);
2764 + if ((int)(uintptr_t)size != 0) {
2765 + sprintf(buffer, "%i", (int)(uintptr_t)size);
2766
2767 WMAddListItem(panel->sizLs, buffer);
2768 }
2769 @@ -874,8 +875,8 @@
2770
2771 WM_ITERATE_ARRAY(face->sizes, vsize, i) {
2772 char buffer[32];
2773 - if ((int)vsize != 0) {
2774 - sprintf(buffer, "%i", (int)vsize);
2775 + if ((int)(uintptr_t)vsize != 0) {
2776 + sprintf(buffer, "%i", (int)(uintptr_t)vsize);
2777
2778 WMAddListItem(panel->sizLs, buffer);
2779 }
2780 --- a/WINGs/wpanel.c Sat Dec 13 14:27:52 2008 -0800
2781 +++ b/WINGs/wpanel.c Thu Nov 06 01:56:29 2008 +0100
2782 @@ -3,6 +3,7 @@
2783 #include "WINGsP.h"
2784
2785 #include <X11/keysym.h>
2786 +#include <stdint.h>
2787
2788
2789
2790 @@ -360,7 +361,7 @@
2791 {
2792 WMInputPanel *panel = (WMInputPanel*)observerData;
2793
2794 - switch ((int)WMGetNotificationClientData(notification)) {
2795 + switch ((int)(uintptr_t)WMGetNotificationClientData(notification)) {
2796 case WMReturnTextMovement:
2797 if (panel->defBtn)
2798 WMPerformButtonClick(panel->defBtn);
2799 --- a/WPrefs.app/editmenu.c Sat Dec 13 14:27:52 2008 -0800
2800 +++ b/WPrefs.app/editmenu.c Thu Nov 06 01:56:29 2008 +0100
2801 @@ -24,6 +24,7 @@
2802 #include <WINGs/WINGsP.h>
2803 #include <WINGs/WUtil.h>
2804 #include <stdlib.h>
2805 +#include <stdint.h>
2806 #include <assert.h>
2807 #include <ctype.h>
2808
2809 @@ -969,7 +970,7 @@
2810 if (!menu->flags.isEditing)
2811 return;
2812
2813 - reason = (int)WMGetNotificationClientData(notif);
2814 + reason = (int)(uintptr_t)WMGetNotificationClientData(notif);
2815
2816 switch (reason) {
2817 case WMEscapeTextMovement:
2818 --- a/src/defaults.c Sat Dec 13 14:27:52 2008 -0800
2819 +++ b/src/defaults.c Thu Nov 06 01:56:29 2008 +0100
2820 @@ -24,6 +24,7 @@
2821 #include "wconfig.h"
2822
2823 #include <stdio.h>
2824 +#include <stdint.h>
2825 #include <stdlib.h>
2826 #include <unistd.h>
2827 #include <string.h>
2828 @@ -1451,7 +1452,7 @@
2829 foo |= WColorSettings;
2830 if (foo)
2831 WMPostNotificationName(WNMenuTitleAppearanceSettingsChanged, NULL,
2832 - (void*)foo);
2833 + (void*)(uintptr_t)foo);
2834
2835 foo = 0;
2836 if (needs_refresh & REFRESH_MENU_TEXTURE)
2837 @@ -1462,7 +1463,7 @@
2838 foo |= WColorSettings;
2839 if (foo)
2840 WMPostNotificationName(WNMenuAppearanceSettingsChanged, NULL,
2841 - (void*)foo);
2842 + (void*)(uintptr_t)foo);
2843
2844 foo = 0;
2845 if (needs_refresh & REFRESH_WINDOW_FONT) {
2846 @@ -1476,7 +1477,7 @@
2847 }
2848 if (foo)
2849 WMPostNotificationName(WNWindowAppearanceSettingsChanged, NULL,
2850 - (void*)foo);
2851 + (void*)(uintptr_t)foo);
2852
2853 if (!(needs_refresh & REFRESH_ICON_TILE)) {
2854 foo = 0;
2855 @@ -1491,7 +1492,7 @@
2856 }
2857 if (foo)
2858 WMPostNotificationName(WNIconAppearanceSettingsChanged, NULL,
2859 - (void*)foo);
2860 + (void*)(uintptr_t)foo);
2861 }
2862 if (needs_refresh & REFRESH_ICON_TILE)
2863 WMPostNotificationName(WNIconTileSettingsChanged, NULL, NULL);
2864 --- a/src/icon.c Sat Dec 13 14:27:52 2008 -0800
2865 +++ b/src/icon.c Thu Nov 06 01:56:29 2008 +0100
2866 @@ -26,6 +26,7 @@
2867 #include <X11/Xutil.h>
2868 #include <stdlib.h>
2869 #include <stdio.h>
2870 +#include <stdint.h>
2871 #include <string.h>
2872 #include <unistd.h>
2873 #include <ctype.h>
2874 @@ -64,7 +65,7 @@
2875 appearanceObserver(void *self, WMNotification *notif)
2876 {
2877 WIcon *icon = (WIcon*)self;
2878 - int flags = (int)WMGetNotificationClientData(notif);
2879 + int flags = (int)(uintptr_t)WMGetNotificationClientData(notif);
2880
2881 if (flags & WTextureSettings) {
2882 icon->force_paint = 1;
2883 --- a/src/menu.c Sat Dec 13 14:27:52 2008 -0800
2884 +++ b/src/menu.c Thu Nov 06 01:56:29 2008 +0100
2885 @@ -29,6 +29,7 @@
2886 #include <stdlib.h>
2887 #include <string.h>
2888 #include <stdio.h>
2889 +#include <stdint.h>
2890 #include <unistd.h>
2891 #include <ctype.h>
2892 #if 0
2893 @@ -109,7 +110,7 @@
2894 appearanceObserver(void *self, WMNotification *notif)
2895 {
2896 WMenu *menu = (WMenu*)self;
2897 - int flags = (int)WMGetNotificationClientData(notif);
2898 + int flags = (int)(uintptr_t)WMGetNotificationClientData(notif);
2899
2900 if (!menu->flags.realized)
2901 return;
2902 --- a/src/switchmenu.c Sat Dec 13 14:27:52 2008 -0800
2903 +++ b/src/switchmenu.c Thu Nov 06 01:56:29 2008 +0100
2904 @@ -28,6 +28,7 @@
2905 #include <stdio.h>
2906 #include <stdlib.h>
2907 #include <string.h>
2908 +#include <stdint.h>
2909
2910 #include <X11/Xlib.h>
2911 #include <X11/Xutil.h>
2912 @@ -449,7 +450,7 @@
2913 void *data = WMGetNotificationClientData(notif);
2914
2915 if (strcmp(name, WMNWorkspaceNameChanged) == 0) {
2916 - UpdateSwitchMenuWorkspace(scr, (int)data);
2917 + UpdateSwitchMenuWorkspace(scr, (int)(uintptr_t)data);
2918 } else if (strcmp(name, WMNWorkspaceChanged) == 0) {
2919
2920 }
2921 --- a/src/window.c Sat Dec 13 14:27:52 2008 -0800
2922 +++ b/src/window.c Thu Nov 06 01:56:29 2008 +0100
2923 @@ -33,6 +33,7 @@
2924 #include <stdlib.h>
2925 #include <stdio.h>
2926 #include <string.h>
2927 +#include <stdint.h>
2928
2929 /* For getting mouse wheel mappings from WINGs */
2930 #include <WINGs/WINGsP.h>
2931 @@ -137,7 +138,7 @@
2932 appearanceObserver(void *self, WMNotification *notif)
2933 {
2934 WWindow *wwin = (WWindow*)self;
2935 - int flags = (int)WMGetNotificationClientData(notif);
2936 + int flags = (int)(uintptr_t)WMGetNotificationClientData(notif);
2937
2938 if (!wwin->frame || (!wwin->frame->titlebar && !wwin->frame->resizebar))
2939 return;
2940 @@ -2214,7 +2215,7 @@
2941
2942 wwin->frame->workspace = workspace;
2943
2944 - WMPostNotificationName(WMNChangedWorkspace, wwin, (void*)oldWorkspace);
2945 + WMPostNotificationName(WMNChangedWorkspace, wwin, (void*)(uintptr_t)oldWorkspace);
2946 }
2947
2948 if (unmap) {
2949 --- a/src/workspace.c Sat Dec 13 14:27:52 2008 -0800
2950 +++ b/src/workspace.c Thu Nov 06 01:56:29 2008 +0100
2951 @@ -29,6 +29,7 @@
2952
2953 #include <stdlib.h>
2954 #include <stdio.h>
2955 +#include <stdint.h>
2956 #include <unistd.h>
2957 #include <ctype.h>
2958 #include <string.h>
2959 @@ -132,7 +133,7 @@
2960 #endif
2961
2962 WMPostNotificationName(WMNWorkspaceCreated, scr,
2963 - (void*)(scr->workspace_count-1));
2964 + (void*)(uintptr_t)(scr->workspace_count-1));
2965 XFlush(dpy);
2966
2967 return scr->workspace_count-1;
2968 @@ -211,7 +212,7 @@
2969 #endif
2970
2971 WMPostNotificationName(WMNWorkspaceDestroyed, scr,
2972 - (void*)(scr->workspace_count-1));
2973 + (void*)(uintptr_t)(scr->workspace_count-1));
2974
2975 if (scr->current_workspace >= scr->workspace_count)
2976 wWorkspaceChange(scr, scr->workspace_count-1);
2977 @@ -631,7 +632,7 @@
2978
2979 showWorkspaceName(scr, workspace);
2980
2981 - WMPostNotificationName(WMNWorkspaceChanged, scr, (void*)workspace);
2982 + WMPostNotificationName(WMNWorkspaceChanged, scr, (void*)(uintptr_t)workspace);
2983
2984 /* XSync(dpy, False); */
2985 }
2986 @@ -1327,7 +1328,7 @@
2987 if (scr->clip_icon)
2988 wClipIconPaint(scr->clip_icon);
2989
2990 - WMPostNotificationName(WMNWorkspaceNameChanged, scr, (void*)workspace);
2991 + WMPostNotificationName(WMNWorkspaceNameChanged, scr, (void*)(uintptr_t)workspace);
2992 }
2993
2994
2995 @@ -1511,7 +1512,7 @@
2996 }
2997 }
2998
2999 - WMPostNotificationName(WMNWorkspaceNameChanged, scr, (void*)i);
3000 + WMPostNotificationName(WMNWorkspaceNameChanged, scr, (void*)(uintptr_t)i);
3001 }
3002 }
3003
3004
3005
3006
3007
3008 1.1 src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-single-click-dockapp-start.patch
3009
3010 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-single-click-dockapp-start.patch?rev=1.1&view=markup
3011 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-single-click-dockapp-start.patch?rev=1.1&content-type=text/plain
3012
3013 Index: windowmaker-0.92.0-single-click-dockapp-start.patch
3014 ===================================================================
3015
3016 # HG changeset patch
3017 # User John H. Robinson, IV <jaqque@××××.org>
3018 # Date 1229206629 28800
3019 # Node ID 17b8b5652f973923c0e07baddeb5765d9acedf55
3020 # Parent 714532b354dd0e89ae06060d64916ac592ba7e99
3021 Add option to allow starting DockApps with a single click
3022
3023 This patch is from the contrib directory. It adds an option to allow starting
3024 DockApps with a single click. It's a handy option that adds only a few lines to
3025 the code. It is a good feature patch example because it includes modifications
3026 to the WPrefs application so that the feature can be easily enabled or
3027 disabled. The one-click ability allows wmaker to integrate more seemlessly with
3028 programs like ROX-Filer which can be configured to use single or double click
3029 actions.
3030
3031 Author: unknown
3032 Submitted by: Gilbert Ashley <amigo@×××××××.org>
3033
3034 --- a/WPrefs.app/Expert.c Sat Dec 13 14:10:41 2008 -0800
3035 +++ b/WPrefs.app/Expert.c Sat Dec 13 14:17:09 2008 -0800
3036 @@ -54,6 +54,7 @@
3037 WMSetButtonSelected(panel->swi[4], GetBoolForKey("DontConfirmKill"));
3038 WMSetButtonSelected(panel->swi[5], GetBoolForKey("DisableBlinking"));
3039 WMSetButtonSelected(panel->swi[6], GetBoolForKey("AntialiasedText"));
3040 + WMSetButtonSelected(panel->swi[7], GetBoolForKey("SingleClickLaunch"));
3041 }
3042
3043
3044 @@ -66,7 +67,7 @@
3045 panel->box = WMCreateBox(panel->parent);
3046 WMSetViewExpandsToParent(WMWidgetView(panel->box), 2, 2, 2, 2);
3047
3048 - for (i=0; i<7; i++) {
3049 + for (i=0; i<8; i++) {
3050 panel->swi[i] = WMCreateSwitchButton(panel->box);
3051 WMResizeWidget(panel->swi[i], FRAME_WIDTH-40, 25);
3052 WMMoveWidget(panel->swi[i], 20, 20+i*25);
3053 @@ -79,6 +80,7 @@
3054 WMSetButtonText(panel->swi[4], _("Disable confirmation panel for the Kill command."));
3055 WMSetButtonText(panel->swi[5], _("Disable selection animation for selected icons."));
3056 WMSetButtonText(panel->swi[6], _("Smooth font edges (needs restart)."));
3057 + WMSetButtonText(panel->swi[7], _("Launch applications and restore windows with a single click."));
3058
3059 WMSetButtonEnabled(panel->swi[6], True);
3060
3061 @@ -103,6 +105,7 @@
3062 SetBoolForKey(WMGetButtonSelected(panel->swi[4]), "DontConfirmKill");
3063 SetBoolForKey(WMGetButtonSelected(panel->swi[5]), "DisableBlinking");
3064 SetBoolForKey(WMGetButtonSelected(panel->swi[6]), "AntialiasedText");
3065 + SetBoolForKey(WMGetButtonSelected(panel->swi[7]), "SingleClickLaunch");
3066 }
3067
3068
3069 --- a/src/WindowMaker.h Sat Dec 13 14:10:41 2008 -0800
3070 +++ b/src/WindowMaker.h Sat Dec 13 14:17:09 2008 -0800
3071 @@ -472,6 +472,9 @@
3072 unsigned int workspace_border_size; /* Size in pixels of the workspace border */
3073 char workspace_border_position; /* Where to leave a workspace border */
3074
3075 + /* single click to lauch applications */
3076 + char single_click;
3077 +
3078 RImage *swtileImage;
3079 RImage *swbackImage[9];
3080
3081 --- a/src/appicon.c Sat Dec 13 14:10:41 2008 -0800
3082 +++ b/src/appicon.c Sat Dec 13 14:17:09 2008 -0800
3083 @@ -590,6 +590,7 @@
3084 Bool movingSingle = False;
3085 int oldX = x;
3086 int oldY = y;
3087 + Bool hasMoved = False;
3088
3089 if (aicon->editing || WCHECK_STATE(WSTATE_MODAL))
3090 return;
3091 @@ -665,6 +666,7 @@
3092 break;
3093
3094 case MotionNotify:
3095 + hasMoved = True;
3096 if (!grabbed) {
3097 if (abs(dx-ev.xmotion.x)>=MOVE_THRESHOLD
3098 || abs(dy-ev.xmotion.y)>=MOVE_THRESHOLD) {
3099 @@ -802,6 +804,9 @@
3100 if (wPreferences.auto_arrange_icons)
3101 wArrangeIcons(scr, True);
3102
3103 + if (wPreferences.single_click && !hasMoved)
3104 + iconDblClick(desc, event);
3105 +
3106 done = 1;
3107 break;
3108 }
3109 --- a/src/defaults.c Sat Dec 13 14:10:41 2008 -0800
3110 +++ b/src/defaults.c Sat Dec 13 14:17:09 2008 -0800
3111 @@ -552,6 +552,9 @@
3112 },
3113 {"DisableBlinking", "NO", NULL,
3114 &wPreferences.dont_blink, getBool, NULL
3115 + },
3116 + {"SingleClickLaunch", "NO", NULL,
3117 + &wPreferences.single_click, getBool, NULL
3118 },
3119 /* style options */
3120 {"MenuStyle", "normal", seMenuStyles,
3121 --- a/src/dock.c Sat Dec 13 14:10:41 2008 -0800
3122 +++ b/src/dock.c Sat Dec 13 14:17:09 2008 -0800
3123 @@ -3758,7 +3758,7 @@
3124
3125
3126
3127 -static void
3128 +static Bool
3129 handleIconMove(WDock *dock, WAppIcon *aicon, XEvent *event)
3130 {
3131 WScreen *scr = dock->screen_ptr;
3132 @@ -3776,6 +3776,7 @@
3133 Bool docked;
3134 int superfluous = wPreferences.superfluous; /* we catch it to avoid problems */
3135 int omnipresent = aicon->omnipresent; /* this must be cached!!! */
3136 + Bool hasMoved = False;
3137
3138
3139 if (wPreferences.flags.noupdates)
3140 @@ -3828,6 +3829,7 @@
3141 break;
3142
3143 case MotionNotify:
3144 + hasMoved = True;
3145 if (!grabbed) {
3146 if (abs(ofs_x-ev.xmotion.x)>=MOVE_THRESHOLD
3147 || abs(ofs_y-ev.xmotion.y)>=MOVE_THRESHOLD) {
3148 @@ -3977,9 +3979,11 @@
3149 #ifdef DEBUG
3150 puts("End icon move");
3151 #endif
3152 - return;
3153 - }
3154 - }
3155 + return hasMoved;
3156 + }
3157 + }
3158 +
3159 + return False; /* never reached */
3160 }
3161
3162
3163 @@ -4116,8 +4120,11 @@
3164 handleClipChangeWorkspace(scr, event);
3165 else
3166 handleDockMove(dock, aicon, event);
3167 - } else
3168 - handleIconMove(dock, aicon, event);
3169 + } else {
3170 + Bool hasMoved = handleIconMove(dock, aicon, event);
3171 + if (wPreferences.single_click && !hasMoved)
3172 + iconDblClick(desc, event);
3173 + }
3174
3175 } else if (event->xbutton.button==Button2 && dock->type==WM_CLIP &&
3176 aicon==scr->clip_icon) {
3177 --- a/src/icon.c Sat Dec 13 14:10:41 2008 -0800
3178 +++ b/src/icon.c Sat Dec 13 14:17:09 2008 -0800
3179 @@ -891,6 +891,7 @@
3180 int dx=event->xbutton.x, dy=event->xbutton.y;
3181 int grabbed=0;
3182 int clickButton=event->xbutton.button;
3183 + Bool hasMoved = False;
3184
3185 if (WCHECK_STATE(WSTATE_MODAL))
3186 return;
3187 @@ -942,6 +943,7 @@
3188 break;
3189
3190 case MotionNotify:
3191 + hasMoved = True;
3192 if (!grabbed) {
3193 if (abs(dx-ev.xmotion.x)>=MOVE_THRESHOLD
3194 || abs(dy-ev.xmotion.y)>=MOVE_THRESHOLD) {
3195 @@ -979,6 +981,8 @@
3196
3197 if (wPreferences.auto_arrange_icons)
3198 wArrangeIcons(wwin->screen_ptr, True);
3199 + if (wPreferences.single_click && !hasMoved)
3200 + miniwindowDblClick(desc, event);
3201 return;
3202
3203 }
3204
3205
3206
3207
3208 1.1 src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-workspace-change-crash.patch
3209
3210 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-workspace-change-crash.patch?rev=1.1&view=markup
3211 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-workspace-change-crash.patch?rev=1.1&content-type=text/plain
3212
3213 Index: windowmaker-0.92.0-workspace-change-crash.patch
3214 ===================================================================
3215
3216 # HG changeset patch
3217 # User Carlos R. Mafra <crmafra2@×××××.com>
3218 # Date 1229313545 28800
3219 # Node ID 5a2507602c48324fba0f07754a442a8cc6ab967c
3220 # Parent 39c2c334b1cc3c160da95c0042e1f073048519ad
3221 Fix buffer overflows in shortcut and workspace name handling
3222
3223 The handling of user defined shortcuts was not checking the length
3224 of the shortcut before copying it to a fixed-length temporary buffer,
3225
3226 char buf[128];
3227
3228 strcpy(buf, shortcutDefinition);
3229
3230 and strcpy() is well known for not checking if overflows will occur.
3231
3232 In particular, wmaker was crashing here if a big 'shortcut' was defined
3233 either through WPrefs or by directly editing the configuration files.
3234
3235 This is now avoided by using strncpy() instead, and wmaker does not
3236 crash anymore.
3237
3238 And this patch also fixes a similar buffer overflow for big workspace
3239 names too.
3240
3241 Furthermore, use MAX_SHORTCUT_LENGTH instead of raw number and define
3242 it to be 32 instead of 128.
3243
3244 --- a/src/defaults.c Thu Nov 06 01:56:29 2008 +0100
3245 +++ b/src/defaults.c Sun Dec 14 19:59:05 2008 -0800
3246 @@ -2523,7 +2523,7 @@
3247 KeySym ksym;
3248 char *val;
3249 char *k;
3250 - char buf[128], *b;
3251 + char buf[MAX_SHORTCUT_LENGTH], *b;
3252
3253
3254 GET_STRING_OR_DEFAULT("Key spec", val);
3255 @@ -2536,7 +2536,7 @@
3256 return True;
3257 }
3258
3259 - strcpy(buf, val);
3260 + strncpy(buf, val, MAX_SHORTCUT_LENGTH);
3261
3262 b = (char*)buf;
3263
3264 --- a/src/rootmenu.c Thu Nov 06 01:56:29 2008 +0100
3265 +++ b/src/rootmenu.c Sun Dec 14 19:59:05 2008 -0800
3266 @@ -513,11 +513,11 @@
3267 Shortcut *ptr;
3268 KeySym ksym;
3269 char *k;
3270 - char buf[128], *b;
3271 + char buf[MAX_SHORTCUT_LENGTH], *b;
3272
3273 ptr = wmalloc(sizeof(Shortcut));
3274
3275 - strcpy(buf, shortcutDefinition);
3276 + strncpy(buf, shortcutDefinition, MAX_SHORTCUT_LENGTH);
3277 b = (char*)buf;
3278
3279 /* get modifiers */
3280 --- a/src/usermenu.c Thu Nov 06 01:56:29 2008 +0100
3281 +++ b/src/usermenu.c Sun Dec 14 19:59:05 2008 -0800
3282 @@ -139,7 +139,7 @@
3283 KeySym ksym;
3284 char *k;
3285 char *buffer;
3286 - char buf[128], *b;
3287 + char buf[MAX_SHORTCUT_LENGTH], *b;
3288 int keycount,i,j,mod;
3289
3290 if (WMIsPLString(shortcut)) {
3291 @@ -163,9 +163,10 @@
3292 for (i=0,j=0;i<keycount;i++) {
3293 data->key[j].modifier = 0;
3294 if (WMIsPLArray(shortcut)) {
3295 - strcpy(buf, WMGetFromPLString(WMGetFromPLArray(shortcut, i)));
3296 + strncpy(buf, WMGetFromPLString(WMGetFromPLArray(shortcut, i)),
3297 + MAX_SHORTCUT_LENGTH);
3298 } else {
3299 - strcpy(buf, WMGetFromPLString(shortcut));
3300 + strncpy(buf, WMGetFromPLString(shortcut), MAX_SHORTCUT_LENGTH);
3301 }
3302 b = (char*)buf;
3303
3304 --- a/src/wconfig.h.in Thu Nov 06 01:56:29 2008 +0100
3305 +++ b/src/wconfig.h.in Sun Dec 14 19:59:05 2008 -0800
3306 @@ -489,6 +489,7 @@
3307
3308 #define WM_PI 3.14159265358979323846
3309
3310 +#define MAX_SHORTCUT_LENGTH 32
3311 #define FRAME_BORDER_WIDTH 1 /* width of window border for frames */
3312
3313 #define RESIZEBAR_HEIGHT 8 /* height of the resizebar */
3314 --- a/src/workspace.c Thu Nov 06 01:56:29 2008 +0100
3315 +++ b/src/workspace.c Sun Dec 14 19:59:05 2008 -0800
3316 @@ -1384,7 +1384,7 @@
3317 i = scr->workspace_count-(menu->entry_no-2);
3318 ws = menu->entry_no - 2;
3319 while (i>0) {
3320 - strcpy(title, scr->workspaces[ws]->name);
3321 + strncpy(title, scr->workspaces[ws]->name, MAX_WORKSPACENAME_WIDTH);
3322
3323 entry = wMenuAddCallback(menu, title, switchWSCommand, (void*)ws);
3324 entry->flags.indicator = 1;
3325
3326
3327
3328
3329 1.1 src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-xchangeproperty-64bits-fix.patch
3330
3331 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-xchangeproperty-64bits-fix.patch?rev=1.1&view=markup
3332 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-xchangeproperty-64bits-fix.patch?rev=1.1&content-type=text/plain
3333
3334 Index: windowmaker-0.92.0-xchangeproperty-64bits-fix.patch
3335 ===================================================================
3336
3337 # HG changeset patch
3338 # User Carlos R. Mafra <crmafra@×××××.com>
3339 # Date 1253011934 -7200
3340 # Node ID 9420959defee1a8936a715d6b5b42183eaef2e2c
3341 # Parent d58ab202df60c2429cc1e8577e19710b706d2afa
3342 Fix the call to XChangeProperty() in 64-bit mode
3343
3344 The man page of XChangeProperty() says:
3345
3346 "If the specified format is 32, the property data must be a
3347 long array."
3348
3349 And as we call it with format 32, the type of 'data' must
3350 be 'long'. It happens to work nowadays in 32-bit architectures
3351 because sizeof(CARD32) = sizeof(long), but that is no longer
3352 true in 64-bit mode.
3353
3354 This patch was downloaded from
3355 www.openbsd.org/cgi-bin/cvsweb/ports/x11/windowmaker/patches/patch-WINGs_wwindow_c
3356 and I thank Alexey I. Frolov and Vladimir Nadvornik for helping me
3357 to understand it on a wmaker-dev thread.
3358
3359 Transplanted from git://repo.or.cz/wmaker-crm.git
3360 commit c7f2a189c48bd4c9eb87958fff66b52e0fdcb7ce
3361
3362 --- a/WINGs/wwindow.c Mon Aug 24 10:10:03 2009 +0200
3363 +++ b/WINGs/wwindow.c Tue Sep 15 12:52:14 2009 +0200
3364 @@ -254,14 +254,14 @@
3365 setMiniwindow(WMWindow *win, RImage *image)
3366 {
3367 WMScreen *scr= win->view->screen;
3368 - CARD32 *data;
3369 + long *data;
3370 int x, y;
3371 int o;
3372
3373 if (!image)
3374 return;
3375
3376 - data = wmalloc((image->width * image->height + 2) * sizeof(CARD32));
3377 + data = wmalloc((image->width * image->height + 2) * sizeof(long));
3378
3379 o= 0;
3380 data[o++] = image->width;
3381 @@ -269,7 +269,7 @@
3382
3383 for (y= 0; y < image->height; y++) {
3384 for (x= 0; x < image->width; x++) {
3385 - CARD32 pixel;
3386 + long pixel;
3387 int offs= (x+y*image->width);
3388
3389 if (image->format == RRGBFormat)
3390
3391
3392
3393
3394 1.1 src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-xinerama-switchpanel-corruption.patch
3395
3396 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-xinerama-switchpanel-corruption.patch?rev=1.1&view=markup
3397 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/windowmaker/0.92.0/windowmaker-0.92.0-xinerama-switchpanel-corruption.patch?rev=1.1&content-type=text/plain
3398
3399 Index: windowmaker-0.92.0-xinerama-switchpanel-corruption.patch
3400 ===================================================================
3401
3402 # HG changeset patch
3403 # User John H. Robinson, IV <jaqque@××××.org>
3404 # Date 1229205226 28800
3405 # Node ID ded22ccbb04f0893e7d33055066674c9a3116bd8
3406 # Parent ff96eb3a10c98136aa55acf0caff18b69ca48ae0
3407 xinerama switchpanel corruption fix
3408
3409 This is a small patch to fix an issue with the switchpanel and a large number
3410 of windows which happens only on a Xinerama setup.
3411
3412 When the number of open windows is so large that displaying all of them would
3413 cause the switchpanel to be too wide for the screen, the panel is supposed to
3414 shrink and scroll to accomodate them all.
3415
3416 In Window Maker 0.92.0 this works for single head displays but not for
3417 Xinerama. The panel extends to the next head and gets garbled. This patch fixes
3418 the issue by correctly constraining the panel to the head with the cursor.
3419
3420 Submitted by: Gilbert Ashley <amigo@×××××××.org>
3421 Author: Iain Patterson <wm@××××.cx>
3422
3423 --- a/src/switchpanel.c Sat Dec 13 13:50:14 2008 -0800
3424 +++ b/src/switchpanel.c Sat Dec 13 13:53:46 2008 -0800
3425 @@ -464,7 +464,7 @@
3426 iconsThatFitCount= count;
3427
3428 if (width > rect.size.width) {
3429 - iconsThatFitCount = (WMScreenWidth(scr->wmscreen)-SCREEN_BORDER_SPACING)/ICON_TILE_SIZE;
3430 + iconsThatFitCount = (rect.size.width-SCREEN_BORDER_SPACING)/ICON_TILE_SIZE;
3431 width= iconsThatFitCount*ICON_TILE_SIZE;
3432 }
3433
3434
3435
3436
3437
3438 1.1 src/patchsets/windowmaker/0.92.0/wlist-0.9x.patch
3439
3440 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/windowmaker/0.92.0/wlist-0.9x.patch?rev=1.1&view=markup
3441 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/windowmaker/0.92.0/wlist-0.9x.patch?rev=1.1&content-type=text/plain
3442
3443 Index: wlist-0.9x.patch
3444 ===================================================================
3445 diff -ur WindowMaker-0.91.0/WINGs/wlist.c WindowMaker-0.91.0-test/WINGs/wlist.c
3446 --- WindowMaker-0.91.0/WINGs/wlist.c 2004-10-12 14:36:42.000000000 -0400
3447 +++ WindowMaker-0.91.0-test/WINGs/wlist.c 2005-03-13 13:37:39.914633856 -0500
3448 @@ -4,6 +4,8 @@
3449
3450 #include "WINGsP.h"
3451
3452 +#include <X11/keysym.h>
3453 +
3454 char *WMListDidScrollNotification = "WMListDidScrollNotification";
3455 char *WMListSelectionDidChangeNotification = "WMListSelectionDidChangeNotification";
3456
3457 @@ -44,6 +46,7 @@
3458 unsigned int redrawPending:1;
3459 unsigned int buttonPressed:1;
3460 unsigned int buttonWasPressed:1;
3461 + unsigned int focused:1;
3462 } flags;
3463 } List;
3464
3465 @@ -141,10 +144,10 @@
3466 lPtr->view->delegate = &_ListViewDelegate;
3467
3468 WMCreateEventHandler(lPtr->view, ExposureMask|StructureNotifyMask
3469 - |ClientMessageMask, handleEvents, lPtr);
3470 + |FocusChangeMask|ClientMessageMask, handleEvents, lPtr);
3471
3472 WMCreateEventHandler(lPtr->view, ButtonPressMask|ButtonReleaseMask
3473 - |EnterWindowMask|LeaveWindowMask|ButtonMotionMask,
3474 + |EnterWindowMask|LeaveWindowMask|ButtonMotionMask|KeyPressMask,
3475 handleActionEvents, lPtr);
3476
3477 lPtr->itemHeight = WMFontHeight(scrPtr->normalFont) + 1;
3478 @@ -1044,6 +1047,11 @@
3479 int topItem = lPtr->topItem;
3480 static int lastClicked = -1, prevItem = -1;
3481
3482 + /* for arrow keys handling */
3483 + char buffer[64];
3484 + KeySym ksym;
3485 + int count, row;
3486 +
3487 CHECK_CLASS(data, WC_List);
3488
3489 switch (event->type) {
3490 @@ -1096,6 +1104,10 @@
3491 case ButtonPress:
3492 if (event->xbutton.x <= WMWidgetWidth(lPtr->vScroller))
3493 break;
3494 + /* need focus for keyboard events */
3495 + if (!lPtr->flags.focused);
3496 + WMSetFocusToWidget(lPtr);
3497 +
3498 if (event->xbutton.button == WINGsConfiguration.mouseWheelDown ||
3499 event->xbutton.button == WINGsConfiguration.mouseWheelUp) {
3500 int amount = 0;
3501 @@ -1202,6 +1214,34 @@
3502 prevItem = tmp;
3503 }
3504 break;
3505 + case KeyPress:
3506 + /* handle arrow keys, space and return */
3507 + count = XLookupString(&event->xkey, buffer, 63, &ksym, NULL);
3508 + buffer[count] = '\0';
3509 + switch(ksym) {
3510 + case XK_Up:
3511 + row = WMGetListSelectedItemRow(lPtr);
3512 + WMSelectListItem(lPtr, row - 1);
3513 + if (row <= topItem)
3514 + scrollByAmount(lPtr, -1);
3515 + break;
3516 + case XK_Down:
3517 + row = WMGetListSelectedItemRow(lPtr);
3518 + WMSelectListItem(lPtr, row + 1);
3519 + if (row - topItem >= lPtr->fullFitLines)
3520 + scrollByAmount(lPtr, 1);
3521 + break;
3522 + case XK_space:
3523 + if (lPtr->action)
3524 + (*lPtr->action)(lPtr, lPtr->clientData);
3525 + break;
3526 + case XK_Return:
3527 + if (lPtr->doubleAction)
3528 + (*lPtr->doubleAction)(lPtr, lPtr->clientData);
3529 + break;
3530 + }
3531 + break;
3532 +
3533 }
3534 if (lPtr->topItem != topItem)
3535 WMPostNotificationName(WMListDidScrollNotification, lPtr, NULL);
3536 Only in WindowMaker-0.91.0-test/WINGs: wlist.c.orig