[PATCH 1/1] util: fix parsing of XDG menus with multiple groups
The specification for XDG menu files allows having more than one group and assumes no constraint on their order. The original code assumed that once the proper group marker was found, everything after was part of it, causing misinterpretation of some data, like taking the wrong launch command. This patch stops the parsing of the menu XDG file when a new group is found, hence implementing the expected behaviour. Reported-by: Andreas Metzler--- util/wmmenugen_parse_xdg.c | 5 + 1 file changed, 5 insertions(+) diff --git a/util/wmmenugen_parse_xdg.c b/util/wmmenugen_parse_xdg.c index fc5f6b19..31ee8130 100644 --- a/util/wmmenugen_parse_xdg.c +++ b/util/wmmenugen_parse_xdg.c @@ -132,6 +132,11 @@ void parse_xdg(const char *file, cb_add_menu_entry *addWMMenuEntryCallback) /* start processing group */ memset(buf, 0, sizeof(buf)); continue; + } else if (p[0] == '[') { + /* If we find a new group and the previous group was the main one, +* we stop all further processing +*/ + if (InGroup) break; } if (!InGroup) { -- 2.11.0 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 1/1] configure: fixed incorrect variable name that prevented --disable-xdnd to work
From: Rodolfo García Peñas (kix) k...@kix.es The name of the variable used in the AM_CONDITIONAL check was not aligned with the name used at the other places of the file, which made the test always succeed, making the conditional always enabled, causing an unnecessary file to be included if user asked to disable the feature, feature which was still not enabled. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 589c7c9..2b0e16d 100644 --- a/configure.ac +++ b/configure.ac @@ -534,7 +534,7 @@ AS_IF([test x$enable_xdnd = xyes], [supported_core=$supported_core XDnD AC_DEFINE([USE_DOCK_XDND], [1], [whether Drag-and-Drop on the dock should be enabled])], [unsupported=$unsupported XDnd]) -AM_CONDITIONAL([USE_DOCK_XDND], [test x$enable_dock_xdnd != xno]) +AM_CONDITIONAL([USE_DOCK_XDND], [test x$enable_xdnd != xno]) dnl Support for ICCCM 2.0 Window Manager replacement -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 1/1] fixup! Configure: increased the version of Automake requested
--- debian/control | 2 +- doc/build/Compilation.texi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/control b/debian/control index ce41a77..b761636 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,7 @@ Section: x11 Priority: optional Maintainer: Rodolfo García Peñas (kix) k...@debian.org Standards-Version: 3.9.6 -Build-Depends: debhelper (= 9), automake (= 1:1.11), gettext, +Build-Depends: debhelper (= 9), automake (= 1:1.12), gettext, libfontconfig1-dev, libjpeg-dev, libpng-dev, libsm-dev, libtiff5-dev, libtool, libgif-dev, libx11-dev, libxext-dev, libxft-dev, libxinerama-dev, libxkbfile-dev, libxpm-dev, libxt-dev, libxrender-dev, sharutils, libxmu-dev, diff --git a/doc/build/Compilation.texi b/doc/build/Compilation.texi index 2ab7598..00e5862 100644 --- a/doc/build/Compilation.texi +++ b/doc/build/Compilation.texi @@ -164,7 +164,7 @@ package, you will also need: @itemize @item @emph{git} @item @emph{autoconf} 2.69 -@item @emph{automake} 1.11 +@item @emph{automake} 1.12 @item @emph{libtool} 1.4.2 @end itemize -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 3/3] doc: include the INSTALL-WMAKER documentation in the repository
As suggested by Carlos, the instruction to compile from the repository are included in this document, so it is a good idea to have it in the repository, even if it is a generated file. In addition, autogen.sh will not generate it anymore as it would create an incorrect version of it (the reference to the version number would be wrong). When the source file is modified, make will re-generate accordingly the file, so there should be no problem. Suggested-by: Carlos R. Mafra crma...@gmail.com Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- .gitignore | 1 - INSTALL-WMAKER | 717 + autogen.sh | 3 +- 3 files changed, 718 insertions(+), 3 deletions(-) create mode 100644 INSTALL-WMAKER diff --git a/.gitignore b/.gitignore index e50a2b7..0e94104 100644 --- a/.gitignore +++ b/.gitignore @@ -32,7 +32,6 @@ m4/lt~obsolete.m4 src/wconfig.h # These files are generated by scripts -INSTALL-WMAKER README.i18n # These files are compilation stuff diff --git a/INSTALL-WMAKER b/INSTALL-WMAKER new file mode 100644 index 000..64e07e4 --- /dev/null +++ b/INSTALL-WMAKER @@ -0,0 +1,717 @@ + + + + + + Window Maker Compilation and Installation + + + ~ A guide to configure, compile and install ~ + ~ Window Maker from sources. ~ + + -- The Window Maker Team -- + + + + +This manual is for Window Maker window manager, version 0.95.6. + +Copyright (c) 2015 The Window Maker Team. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program, see file COPYING for details. + + + Published by The Window Maker team on 20 June 2015. + + + + + +1 Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . 73 + 1.1 Supported Platforms . . . . . . . . . . . . . . . . . . . 77 + 1.2 Software Dependencies . . . . . . . . . . . . . . . . . . 88 + 1.3 Special Dependencies . . . . . . . . . . . . . . . . . . 122 + 1.4 Optional Dependencies . . . . . . . . . . . . . . . . . . 134 + +2 Building Window Maker . . . . . . . . . . . . . . . . . . . . 223 + 2.1 Getting the Sources . . . . . . . . . . . . . . . . . . . 227 + 2.2 Build and Install . . . . . . . . . . . . . . . . . . . . 248 + 2.3 User specific configuration . . . . . . . . . . . . . . . 298 + 2.4 Locales/Internationalisation . . . . . . . . . . . . . . 324 + 2.5 Configure Options . . . . . . . . . . . . . . . . . . . . 332 +2.5.1 Installation Directory . . . . . . . . . . . . . . . 346 +2.5.2 External Libraries . . . . . . . . . . . . . . . . . 391 +2.5.3 X11 and Extensions . . . . . . . . . . . . . . . . . 452 +2.5.4 Feature Selection . . . . . . . . . . . . . . . . . . 500 +2.5.5 Developer Stuff . . . . . . . . . . . . . . . . . . . 549 + +3 Miscellaneous . . . . . . . . . . . . . . . . . . . . . . . . 577 + 3.1 Platform Specific Notes . . . . . . . . . . . . . . . . . 581 + 3.2 I don't have the root password :( . . . . . . . . . . . . 626 + 3.3 Upgrading . . . . . . . . . . . . . . . . . . . . . . . . 645 + +4 Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . 655 + 4.1 Error with loading fonts, even if they exist . . . . . . 663 + 4.2 configure doesn't detect libtiff, or other graphic librari 673 + 4.3 configure doesn't detect libXpm . . . . . . . . . . . . . 687 + 4.4 Segmentation fault on startup . . . . . . . . . . . . . . 693 + 4.5 ...: your machine is misconfigured. gethostname() returne 705 + 4.6 The root menu contains only 2 entries. (XTerm and Exit. 712 + + +1 Prerequisites +*** + + +1.1 Supported Platforms +=== + + - Intel GNU/Linux Systems in general, ix86 and x86_64 but other + architectures should work + - BSD systems + - Solaris, at least on release 10 and 11 + + Patches to make it work on other platforms are welcome. + + +1.2 Software Dependencies += + +The following software is required to use Window Maker: + + - X11R6.x + + Window Maker can be compiled in older versions of X, like X11R5 + (Solaris
[PATCH 2/3] WPrefs: fix conversion of old Apercu setting to the new keywords
As pointed by Josip, the code for loading the legacy setting keywords for the Minipreview feature did not update correctly the configuration: - if the setting used a size as a multiple of icon size, this was understood as the minimum pixel size, which meant here disabling the feature. The code is now consistent with what Window Maker does; - if the old keyword were found, they were loaded but not removed from the database after creating the new ones, which is a source of problem as Window Maker assumes that the presence of the legacy keywords means they are to be taken in consideration. Reported-by: Josip Deanovic djosip+n...@linuxpages.net Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- WPrefs.app/Icons.c | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/WPrefs.app/Icons.c b/WPrefs.app/Icons.c index 4e7f237..e68da56 100644 --- a/WPrefs.app/Icons.c +++ b/WPrefs.app/Icons.c @@ -60,6 +60,8 @@ typedef struct _Panel { CallbackRec callbacks; + Bool have_legacy_apercu; + WMWidget *parent; WMFrame *posF; @@ -206,6 +208,7 @@ static void showData(_Panel * panel) * new settings * This hack should be kept for at least 2 years, that means = 2017. */ + panel-have_legacy_apercu = False; str = GetStringForKey(MiniwindowPreviewBalloons); if (str != NULL) { /* New names found, use them in priority */ @@ -221,9 +224,18 @@ static void showData(_Panel * panel) /* No new names, try the legacy names */ b = GetBoolForKey(MiniwindowApercuBalloons); if (b) { + panel-have_legacy_apercu = True; i = GetIntegerForKey(ApercuSize); + + /* +* In the beginning, the option was coded as a multiple of the icon +* size; then it was converted to pixel size +*/ + if (i 24) + i *= GetIntegerForKey(IconSize); + if (i = minipreview_minimum_size) - i = minipreview_minimum_size; + i = minipreview_minimum_size + 1; /* +1 to not display as off */ } else { i = minipreview_minimum_size; } @@ -466,6 +478,10 @@ static void storeData(_Panel * panel) } SetIntegerForKey(i, MiniPreviewSize); } + if (panel-have_legacy_apercu) { + RemoveObjectForKey(MiniwindowApercuBalloons); + RemoveObjectForKey(ApercuSize); + } for (i = 0; i wlengthof(icon_animation); i++) { if (WMGetButtonSelected(panel-animB[i])) { -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 1/3] wmaker: fix detection of legacy Apercu configuration keywords
As reported by Josip, the code in Window Maker to detect the use of the legacy keyword MiniwindowApercuBalloons and ApercuSize was broken, which means they were always seen as used even when not present. This patch fixes the detection to only use them if they were effectively used. Reported-by: Josip Deanovic djosip+n...@linuxpages.net Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- src/defaults.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/defaults.c b/src/defaults.c index 70fbeb5..c5a94c6 100644 --- a/src/defaults.c +++ b/src/defaults.c @@ -529,7 +529,7 @@ WDefaultEntry optionList[] = { */ {MiniwindowApercuBalloons, NO, NULL, legacy_minipreview_config.enable, getBool, NULL, NULL, NULL}, - {ApercuSize, 128, NULL, + {ApercuSize, 0, NULL, legacy_minipreview_config.size, getInt, NULL, NULL, NULL}, /* style options */ @@ -1155,10 +1155,6 @@ void wReadDefaults(WScreen * scr, WMPropList * new_dict) void *tdata; WMPropList *old_dict = (w_global.domain.wmaker-dictionary != new_dict ? w_global.domain.wmaker-dictionary : NULL); - /* Backward Compatibility: init array to special value to detect if they changed */ - legacy_minipreview_config.enable = 99; - legacy_minipreview_config.size = -1; - needs_refresh = 0; for (i = 0; i wlengthof(optionList); i++) { @@ -1223,11 +1219,11 @@ void wReadDefaults(WScreen * scr, WMPropList * new_dict) * This code should probably stay for at least 2 years, you should not consider removing * it before year 2017 */ - if (legacy_minipreview_config.enable != 99) { + if (legacy_minipreview_config.enable) { wwarning(_(your configuration is using old syntax for Mini-Preview settings; consider running WPrefs.app to update)); wPreferences.miniwin_preview_balloon = legacy_minipreview_config.enable; - if (legacy_minipreview_config.size = 0) { + if (legacy_minipreview_config.size 0) { /* * the option 'ApercuSize' used to be coded as a multiple of the icon size in v0.95.6 * it is now expressed directly in pixels, but to avoid breaking user's setting we check -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 0/3] Fixes...
Hello, The first 2 patchs will fix the Apercu/Minipreview problems reported by Josip recently. The 3rd patch is including the generated INSTALL-WMAKER into the repository as suggested by Carlos. Carlos, I would also suggest to run this (before or after, it does not matter): git rebase -i HEAD~7 --autosquash as there's a patch meant to be merged in the branch... Regards, Christophe. .gitignore | 1 - INSTALL-WMAKER | 717 + WPrefs.app/Icons.c | 18 +- autogen.sh | 3 +- src/defaults.c | 10 +- 5 files changed, 738 insertions(+), 11 deletions(-) create mode 100644 INSTALL-WMAKER -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 1/2] wrlib: fixed gcc version needed for deprecated attribute support
The support for a custom message in the attribute 'deprecated' have been added only from gcc 4.5.0 and not 4.0, so the check was updated accordingly to avoid compilation error with version 4.0 to 4.4. Reported-by: Josip Deanovic djosip+n...@linuxpages.net Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- wrlib/wraster.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wrlib/wraster.h b/wrlib/wraster.h index 479f975..ab187bf 100644 --- a/wrlib/wraster.h +++ b/wrlib/wraster.h @@ -61,7 +61,7 @@ * mechanism and define an internal macro appropriately. Please note that the macro are not considered being * part of the public API. */ -#if __GNUC__ = 4 +#if __GNUC__ 4 || (__GNUC__ == 4 __GNUC_MINOR__ = 5) #define __wrlib_deprecated(msg) __attribute__ ((deprecated(msg))) #elif __GNUC__ = 3 #define __wrlib_deprecated(msg) __attribute__ ((deprecated)) -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 2/2] Configure: increased the version of Automake requested
The compilation of the WRaster library needs the keyword EXTRA_*_DEPENDENCIES in its Makefile so the configure.ac have been updated to require at least the version of automake in which it is added. Reported-by: Josip Deanovic djosip+n...@linuxpages.net Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- configure.ac | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index c5d3167..2b01108 100644 --- a/configure.ac +++ b/configure.ac @@ -37,7 +37,11 @@ dnl === AC_INIT([WindowMaker],[0.95.6],[wmaker-dev@lists.windowmaker.org],[WindowMaker],[http://www.windowmaker.org/]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_HEADERS([config.h]) -AM_INIT_AUTOMAKE([1.11 silent-rules]) + +dnl We need the EXTRA_xxx_DEPENDENCIES keyword in Makefiles which have been +dnl introduced in the version 1.11.3; because the 1.12 was realeased shortly +dnl after, we just ask for it +AM_INIT_AUTOMAKE([1.12 silent-rules]) dnl Reference file used by 'configure' to make sure the path to sources is valid AC_CONFIG_SRCDIR([src/WindowMaker.h]) -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 3/5] fixup! wmiv: Improve help text.
--- util/wmiv.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/util/wmiv.c b/util/wmiv.c index 2fb1e15..e99e3e3 100755 --- a/util/wmiv.c +++ b/util/wmiv.c @@ -731,10 +731,10 @@ int main(int argc, char **argv) [L]rotate image on the left\n [Q]quit\n [R]rotate image on the right\n - [right]next image\n - [left] previous image\n - [up] first image\n - [down] last image\n, + [▸]next image\n + [◂]previous image\n + [▴]first image\n + [▾]last image\n, argv[0]); return EXIT_SUCCESS; case 'v': -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 5/5] wmaker: replaced old email address with the official one
In the crash handling dialog there was a reference to an old email address. This patch replaces it with the official one, taken from the 'configure.ac' definition so it will not need manual update anymore. The mail address is inserted in the string with a '%s' in order to not have it in the translation files (po) to ease the maintainer's task in case of future change. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- po/be.po | 8 +--- po/bg.po | 9 + po/ca.po | 9 + po/cs.po | 8 +--- po/da.po | 4 ++-- po/de.po | 5 ++--- po/el.po | 6 -- po/es.po | 4 ++-- po/et.po | 4 ++-- po/fi.po | 4 ++-- po/fr.po | 16 +--- po/gl.po | 4 ++-- po/hu.po | 4 ++-- po/hy.po | 4 po/it.po | 4 ++-- po/ja.po | 4 ++-- po/ko.po | 4 ++-- po/ms.po | 4 ++-- po/nl.po | 21 ++--- po/pt.po | 5 ++--- po/ru.po | 9 + po/sk.po | 14 -- po/uk.po | 4 ++-- po/zh_CN.po | 4 ++-- po/zh_TW.po | 4 ++-- src/dialog.c | 8 +--- src/osdep_stub.c | 10 -- 27 files changed, 95 insertions(+), 89 deletions(-) diff --git a/po/be.po b/po/be.po index 555c0b8..4b85c67 100644 --- a/po/be.po +++ b/po/be.po @@ -468,13 +468,15 @@ msgstr msgid Window Maker received signal %i. msgstr Window Maker атрымаў сігнал %i. -#: ../src/dialog.c:1822 +#. Comment for the PO file: the %s is an email address +#: ../src/dialog.c:1632 +#, c-format msgid This fatal error occured probably due to a bug. Please fill the included -BUGFORM and report it to b...@windowmaker.info. +BUGFORM and report it to %s. msgstr Гэты крытычны збой магчыма вызваны памылкамі ў WindowMaker. -Дашліце запоўненае паведамленне аб памылке (BUGFORM) на b...@windowmaker.info +Дашліце запоўненае паведамленне аб памылке (BUGFORM) на %s #: ../src/dialog.c:1831 msgid What do you want to do now? diff --git a/po/bg.po b/po/bg.po index dfcdecf..de61b83 100644 --- a/po/bg.po +++ b/po/bg.po @@ -598,12 +598,13 @@ msgstr msgid Window Maker received signal %i. msgstr Уиндоу Мейкър получи сигнал %i. -# ../src/dialog.c:1564 -#: ../src/dialog.c:1822 +#. Comment for the PO file: the %s is an email address +#: ../src/dialog.c:1632 +#, c-format msgid This fatal error occured probably due to a bug. Please fill the included -BUGFORM and report it to b...@windowmaker.info. -msgstr Възникналата критична грешка вероятно се дължи на програмен дефект. Моля попълнете формуляра от файла BUGFORM и го изпратете на адрес b...@windowmaker.info. +BUGFORM and report it to %s. +msgstr Възникналата критична грешка вероятно се дължи на програмен дефект. Моля попълнете формуляра от файла BUGFORM и го изпратете на адрес %s. # ../src/dialog.c:1572 #: ../src/dialog.c:1831 diff --git a/po/ca.po b/po/ca.po index 2167395..bd44174 100644 --- a/po/ca.po +++ b/po/ca.po @@ -490,14 +490,15 @@ msgstr msgid Window Maker received signal %i. msgstr Window Maker ha rebut un senyal %i. -#: ../src/dialog.c:1752 +#. Comment for the PO file: the %s is an email address +#: ../src/dialog.c:1632 +#, c-format msgid This fatal error occured probably due to a bug. Please fill the included -BUGFORM and report it to b...@windowmaker.info. +BUGFORM and report it to %s. msgstr Aquest error fatal probablement ha estat causat per un \bug\. Si us plau, -ompliu el formulari d'error inclòs i envieu-lo a l'adreça bugs@windowmaker. -org. +ompliu el formulari d'error inclòs i envieu-lo a l'adreça %s. #: ../src/dialog.c:1761 msgid What do you want to do now? diff --git a/po/cs.po b/po/cs.po index f611bf3..3a21117 100644 --- a/po/cs.po +++ b/po/cs.po @@ -473,13 +473,15 @@ msgstr msgid Window Maker received signal %i. msgstr Window Maker přijal signál %i. -#: ../src/dialog.c:1705 +#. Comment for the PO file: the %s is an email address +#: ../src/dialog.c:1632 +#, c-format msgid This fatal error occured probably due to a bug. Please fill the included -BUGFORM and report it to b...@windowmaker.info. +BUGFORM and report it to %s. msgstr Tato závažná chyba se vyskytla pravděpodobně v důsledku chyby v kódu Window -Makeru. Prosím, vyplňte soubor BUGFORM a zašlete ho na b...@windowmaker.info +Makeru. Prosím, vyplňte soubor BUGFORM a zašlete ho na %s (pouze anglicky) #: ../src/dialog.c:1714 diff --git a/po/da.po b/po/da.po index c5a2c26..167a162 100644 --- a/po/da.po +++ b/po/da.po @@ -545,10 +545,10 @@ msgstr Window Maker modtog signal %i #: ../src/dialog.c:1790 msgid This fatal error occured probably due to a bug. Please fill the included -BUGFORM and report it to b...@windowmaker.info. +BUGFORM and report it to %s. msgstr en fatal fejl er opstået, sikkert pga. en bug. Udfyld venligst den vedlagte -BUGFORM og indberet det til b...@windowmaker.info. +BUGFORM og indberet
[PATCH 1/4] WINGs: Updated news with the API changes that occured between 0.95.6 and 0.95.7
Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- WINGs/NEWS | 45 + 1 file changed, 45 insertions(+) diff --git a/WINGs/NEWS b/WINGs/NEWS index d1bfa7b..1c94845 100644 --- a/WINGs/NEWS +++ b/WINGs/NEWS @@ -155,6 +155,41 @@ wshellquote ADDED +*** Fri May 15 18:44:50 CEST 2015 - Christophe + +New Tri-state type for WMButton +--- + +A new check-box type button is available with state On/Off/Tri, the later being +generally used to express leave as-is. The states are cycled through as user +click on the button. It is created with: + btn = WMCreateButton(parent_widget, WBTTriState); + +There are is this case 3 possible values for WMSetButtonSelected/WMGetButtonSelected: + - 0 and 1, the legacy checked/unchecked states + - the new -1, when in the 3rd state + + +*** Sun Dec 7 10:52:21 CET 2014 - David + +Support for pixmap in the background of Widget +-- + +The new function WMSetWidgetBackgroundPixmap was introduced to specify a pixmap +that will be displayed as the background of a widget instead of the usual plain +color. The dual WMGetWidgetBackgroundPixmap is provided too. + + +*** Sun Nov 2 13:04:14 CET 2014 - David + +Get the text of a button + + +It was assumed that there was no need to retrieve the text from a button because +it is generally a static constant text, but there are some cases where this can +be useful, so the new function WMGetButtonText was added to the API. + + *** Thu May 9 18:24:03 CEST 2013 - Christophe Const-correctness API changes for WRaster, WUtils and WINGs @@ -172,6 +207,16 @@ This function now returns 'const char *' because its result must *not* be modified, so it may generate a const related warning in old code. +*** Fri Mar 7 00:39:28 CET 2014 - David + +New function WMCreateScaledBlendedPixmapFromFile + + +This function can load an image from a file and if it is bigger than the +specified width/height then it will be scaled down to fit the size while +keeping the aspect ratio of the original image. + + *** Mon Oct 14 19:42:42 EEST 2002 - Dan Double buffering -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 0/4] Minor updates for next release
Hello, Some minor updates which could be interresting for the forthcoming release: - 1 2 are documentation; - 3 4 are minor bug fixes. From what I have checked, the library versions numbers in the API headers and in the configure.ac have already been incremented, so it should be ok for the release. Christophe. WINGs/NEWS | 63 ++ WINGs/wfontpanel.c | 13 +++ wrlib/xutil.c | 3 +++ 3 files changed, 66 insertions(+), 13 deletions(-) -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 2/4] WINGs: ran spell checker on the NEWS file
The command used was: aspell --lang=en_GB check WINGs/NEWS Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- WINGs/NEWS | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/WINGs/NEWS b/WINGs/NEWS index 1c94845..c5afb8d 100644 --- a/WINGs/NEWS +++ b/WINGs/NEWS @@ -223,8 +223,8 @@ Double buffering To avoid flickering caused by redrawing the widgets on Expose events, a -double buffering tehnique was implemented for most of the widgets. -This flickering effect has gotten more vizible with the introduction +double buffering technique was implemented for most of the widgets. +This flickering effect has gotten more visible with the introduction of antialiased fonts. If with normal text one can redraw the text over the old one over and over again without any degradation of the text (new pixels simply overwrite old pixels), with antialiased text the situation is @@ -236,7 +236,7 @@ The double buffer is implemented to solve this issue. This is a change that that will be automatically available for any WINGs applications and will require no change in the existing code. However there is an exception from this in case of WMList if you delegate -the drawing of items to userspace (read below for the compelte details). +the drawing of items to userspace (read below for the complete details). *** Mon Oct 14 22:07:42 EEST 2002 - Dan @@ -244,10 +244,10 @@ the drawing of items to userspace (read below for the compelte details). WMList change - -In case of WMList there is the posibility to delegate the drawing of the +In case of WMList there is the possibility to delegate the drawing of the list items to the application that is linked with WINGs, and this code will not be inside the WINGs library, but in userland. Since we use the double -buffering tehnique in this case too (to allow all widgets based on WMList +buffering technique in this case too (to allow all widgets based on WMList and the ones that draw their list items by themselves to benefit from the double buffering advantage automatically), we no longer pass the window to the user code doing item drawing, but instead pass this pixmap in which we @@ -276,7 +276,7 @@ This change is required to support extending WMFont to allow it to handle antialiased fonts through the XFree86 Xft2 extension. This also has the advantage of hiding low level X11 details and use WINGs -internat objects instead. +internal objects instead. To fix your old code to work with the new WINGs API you need to replace the GC passed to WMDraw***String() in your code with a WMColor*. @@ -343,7 +343,7 @@ WMSendConnectionData() can return 3 values: -1, 0, 1 -1 - means that the connection has died. you should stop sending data and close the connection ASAP. - 1 - means that the data was succesfully sent + 1 - means that the data was successfully sent 0 - means that the data (or part of it) was not sent. however, it was saved in a queue and the library will try to send it later when possible. @@ -352,14 +352,14 @@ on, until the return value of such a send call will be 0. After it returns 0 you can continue sending, however, the data will not be sent over the connection because the operating system cannot accept any more data for the moment. Instead it will be queued inside the library, making your -program's memory footprint increase. If the ammount of data you need to +program's memory footprint increase. If the amount of data you need to send is limited and not too big, this shouldn't be a problem, because your data will be queued and sent when the operating system will notify the library that sending is possible again. If this is the case you can just ignore the output of WMSendConnectionData() and not set a callback for canResumeSending. -However, if the ammount of data you have to send is undetermined and you +However, if the amount of data you have to send is undetermined and you also want to keep a small memory footprint for your program (so that it won't grow until it uses all your available memory ;) ), you will have to stop sending data over the connection as soon as WMSendConnectionData() -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 4/4] WRaster: fix unused variable warning when XShm extention is not enabled
Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- wrlib/xutil.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wrlib/xutil.c b/wrlib/xutil.c index 1c3f86d..8e90333 100644 --- a/wrlib/xutil.c +++ b/wrlib/xutil.c @@ -154,6 +154,9 @@ RXImage *RCreateXImage(RContext * context, int depth, unsigned width, unsigned h void RDestroyXImage(RContext * context, RXImage * rximage) { #ifndef USE_XSHM + /* Argument is not used in this case, tell the compiler it is ok */ + (void) context; + XDestroyImage(rximage-image); #else /* USE_XSHM */ if (rximage-is_shared) { -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 3/4] WINGs: fix non-portable int conversion for printf in font panel size handling
The original code assumed that the (void *) type could be safely converted to an integer for the printf use, but it is not that simple, as pointed by gcc when compiling on 32-bits platforms, where pointers do not match anymore the long (%li) size. The new code now do the conversions by the rules, so the compiler knows what is happening and printf always gets the 'int' it expects. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- WINGs/wfontpanel.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/WINGs/wfontpanel.c b/WINGs/wfontpanel.c index 2d6f77f..019c710 100644 --- a/WINGs/wfontpanel.c +++ b/WINGs/wfontpanel.c @@ -699,8 +699,10 @@ static void typefaceClick(WMWidget * w, void *data) WMClearList(panel-sizLs); WM_ITERATE_ARRAY(face-sizes, size, i) { - if ((uintptr_t)size != 0) { - sprintf(buffer, %li, (uintptr_t)size); + if (size != NULL) { + int size_int = (int) size; + + sprintf(buffer, %i, size_int); WMAddListItem(panel-sizLs, buffer); } @@ -798,8 +800,11 @@ static void setFontPanelFontName(FontPanel * panel, const char *family, const ch WM_ITERATE_ARRAY(face-sizes, vsize, i) { char buffer[32]; - if ((uintptr_t)vsize != 0) { - sprintf(buffer, %li, (uintptr_t)vsize); + + if (vsize != NULL) { + int size_int = (int) vsize; + + sprintf(buffer, %i, size_int); WMAddListItem(panel-sizLs, buffer); } -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 2/5] Fixed floating point constants defined as double but expected as float
To preserve the accuracy of the operation, the C standard request that the mathematical operation is performed using double precision, but in many case this is not necessary so this patch fixes a few constants to avoid that conversion. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- WINGs/wcolorwell.c | 2 +- WINGs/wscroller.c | 16 WINGs/wscrollview.c| 4 ++-- WPrefs.app/MouseSettings.c | 2 +- src/misc.c | 12 ++-- wrlib/alpha_combine.c | 2 +- wrlib/context.c| 2 +- wrlib/rotate.c | 22 +++--- 8 files changed, 31 insertions(+), 31 deletions(-) diff --git a/WINGs/wcolorwell.c b/WINGs/wcolorwell.c index a5d1a1d..c67c7d0 100644 --- a/WINGs/wcolorwell.c +++ b/WINGs/wcolorwell.c @@ -211,7 +211,7 @@ static void willResizeColorWell(W_ViewDelegate * self, WMView * view, unsigned i if (*height MIN_HEIGHT) *height = MIN_HEIGHT; - bw = (int)((float)WMIN(*width, *height) * 0.24); + bw = (int)((float)WMIN(*width, *height) * 0.24F); W_ResizeView(cPtr-colorView, *width - 2 * bw, *height - 2 * bw); diff --git a/WINGs/wscroller.c b/WINGs/wscroller.c index f1daa3a..4a8f027 100644 --- a/WINGs/wscroller.c +++ b/WINGs/wscroller.c @@ -168,10 +168,10 @@ void WMSetScrollerParameters(WMScroller * sPtr, float floatValue, float knobProp assert(!isnan(floatValue)); - if (floatValue 0.0) - sPtr-floatValue = 0.0; - else if (floatValue 1.0) - sPtr-floatValue = 1.0; + if (floatValue 0.0F) + sPtr-floatValue = 0.0F; + else if (floatValue 1.0F) + sPtr-floatValue = 1.0F; else sPtr-floatValue = floatValue; @@ -180,9 +180,9 @@ void WMSetScrollerParameters(WMScroller * sPtr, float floatValue, float knobProp sPtr-knobProportion = min_knob_proportion; sPtr-flags.documentFullyVisible = 0; - } else if (knobProportion = 1.0) { + } else if (knobProportion = 1.0F) { - sPtr-knobProportion = 1.0; + sPtr-knobProportion = 1.0F; sPtr-flags.documentFullyVisible = 1; } else { @@ -344,7 +344,7 @@ static int knobLength(Scroller * sPtr) length -= 2 * (BUTTON_SIZE + 1); } - tmp = (int)((float)length * sPtr-knobProportion + 0.5); + tmp = (int)((float)length * sPtr-knobProportion + 0.5F); /* keep minimum size */ if (tmp BUTTON_SIZE) tmp = BUTTON_SIZE; @@ -418,7 +418,7 @@ static void paintScroller(Scroller * sPtr) length - (int)(knobP + knobL), view-size.height - 4); } else { /* before */ - if (knobP 0.0) + if (knobP 0.0F) XFillRectangle(scr-display, d, scr-stippleGC, 2, ofs, view-size.width - 4, (int)knobP); diff --git a/WINGs/wscrollview.c b/WINGs/wscrollview.c index a21864e..a1b030e 100644 --- a/WINGs/wscrollview.c +++ b/WINGs/wscrollview.c @@ -506,7 +506,7 @@ static void updateScrollerProportion(ScrollView * sPtr) prop = (float)sPtr-viewport-size.width / (float)sPtr-contentView-size.width; - if (oldP 1.0) + if (oldP 1.0F) value = (prop * oldV) / oldP; else value = 0; @@ -518,7 +518,7 @@ static void updateScrollerProportion(ScrollView * sPtr) prop = (float)sPtr-viewport-size.height / (float)sPtr-contentView-size.height; - if (oldP 1.0) + if (oldP 1.0F) value = (prop * oldV) / oldP; else value = 0; diff --git a/WPrefs.app/MouseSettings.c b/WPrefs.app/MouseSettings.c index 6df9300..7859f14 100644 --- a/WPrefs.app/MouseSettings.c +++ b/WPrefs.app/MouseSettings.c @@ -298,7 +298,7 @@ static void showData(_Panel * panel) sprintf(buffer, %i, a); WMSetTextFieldText(panel-threT, buffer); - WMSetSliderValue(panel-speedS, (accel - 0.25) / 0.25); + WMSetSliderValue(panel-speedS, (accel - 0.25F) / 0.25F); panel-acceleration = accel; sprintf(buffer, %.2f, accel); diff --git a/src/misc.c b/src/misc.c index 99341d3..02aa401 100644 --- a/src/misc.c +++ b/src/misc.c @@ -201,14 +201,14 @@ void slide_windows(Window wins[], int n, int from_x, int from_y, int to_x, int t px = slide_steps; else if (px -slide_steps px 0) px = -slide_steps; - py = (is_dx_nul ? 0.0 : px * dy / dx); + py = (is_dx_nul ? 0.0F : px * dy / dx); } else { py = dy / slide_slowdown
[PATCH 1/5] configure: Add compiler detection on non optimal floating point constant
Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- configure.ac | 5 + 1 file changed, 5 insertions(+) diff --git a/configure.ac b/configure.ac index 40f76fb..c5d3167 100644 --- a/configure.ac +++ b/configure.ac @@ -153,6 +153,11 @@ AS_IF([test x$debug = xyes], dnl too complicated to maintain AX_CFLAGS_GCC_OPTION([-Wdisabled-optimization]) dnl + dnl Because of C's type promotion, the compiler has to generate + dnl less optimal code when a double constant is used in a + dnl float expression + AX_CFLAGS_GCC_OPTION([-Wdouble-promotion]) + dnl dnl Floating-point comparison is not a good idea AX_CFLAGS_GCC_OPTION([-Wfloat-equal]) dnl -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 3/5] Added some explicit conversion to double precision
When the result of the operation is expected to use double precision, this patchs adds an explicit conversion to that type to tell the compiler that this is what we want, and not an unexpected side effect. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- WINGs/userdefaults.c | 2 +- WINGs/wbrowser.c | 2 +- WPrefs.app/MouseSettings.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/WINGs/userdefaults.c b/WINGs/userdefaults.c index 92f4e0f..65ed099 100644 --- a/WINGs/userdefaults.c +++ b/WINGs/userdefaults.c @@ -591,7 +591,7 @@ void WMSetUDFloatForKey(WMUserDefaults * database, float value, const char *defa WMPropList *object; char buffer[128]; - sprintf(buffer, %f, value); + sprintf(buffer, %f, (double)value); object = WMCreatePLString(buffer); WMSetUDObjectForKey(database, object, defaultName); diff --git a/WINGs/wbrowser.c b/WINGs/wbrowser.c index 0475611..d49ce1f 100644 --- a/WINGs/wbrowser.c +++ b/WINGs/wbrowser.c @@ -565,7 +565,7 @@ static void scrollCallback(WMWidget * scroller, void *self) floatValue = (floatValue * value) / value; - newFirst = rint(floatValue * (float)(bPtr-columnCount - bPtr-maxVisibleColumns)); + newFirst = rint(floatValue * (double)(bPtr-columnCount - bPtr-maxVisibleColumns)); if (bPtr-firstVisibleColumn != newFirst) scrollToColumn(bPtr, newFirst, False); diff --git a/WPrefs.app/MouseSettings.c b/WPrefs.app/MouseSettings.c index 7859f14..528f695 100644 --- a/WPrefs.app/MouseSettings.c +++ b/WPrefs.app/MouseSettings.c @@ -301,7 +301,7 @@ static void showData(_Panel * panel) WMSetSliderValue(panel-speedS, (accel - 0.25F) / 0.25F); panel-acceleration = accel; - sprintf(buffer, %.2f, accel); + sprintf(buffer, %.2f, (double)accel); WMSetTextFieldText(panel-acceT, buffer); /**/ b = GetIntegerForKey(DoubleClickTime); -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 5/5] wrlib: changed Gamma Correction calculation to use single-precision float
The original code was using double precision floating point to perform the color corrections for the creation of the standard colormap. This precision is not necessary because color coding is 16 bits anyway, and on some architecture the double precision comes with a cost. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- m4/wm_libmath.m4 | 1 + wrlib/context.c | 26 +++--- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/m4/wm_libmath.m4 b/m4/wm_libmath.m4 index 77ed8d7..5a8143c 100644 --- a/m4/wm_libmath.m4 +++ b/m4/wm_libmath.m4 @@ -70,6 +70,7 @@ AC_CACHE_CHECK([if sinf+cosf are defined in math.h], [wm_cv_libm_sinf], a = atan2f(a, b); b = cosf(a); a = sinf(b); + a = powf(a, b); return (int)a;])], [wm_cv_libm_sinf=`echo $wm_arg | sed -e 's,^.*% *,,' ` ; break]) done diff --git a/wrlib/context.c b/wrlib/context.c index d74bf53..ee0b993 100644 --- a/wrlib/context.c +++ b/wrlib/context.c @@ -38,6 +38,10 @@ #include scale.h +#ifndef HAVE_FLOAT_MATHFUNC +#define powf(x, y) ((float) pow((double)(x), (double)(y))) +#endif + static Bool bestContext(Display * dpy, int screen_number, RContext * context); static const RContextAttributes DEFAULT_CONTEXT_ATTRIBS = { @@ -248,13 +252,13 @@ static Bool allocatePseudoColor(RContext *ctx) if ((ctx-attribs-flags RC_GammaCorrection) ctx-attribs-rgamma 0 ctx-attribs-ggamma 0 ctx-attribs-bgamma 0) { - double rg, gg, bg; - double tmp; + float rg, gg, bg; + float tmp; /* do gamma correction */ - rg = 1.0 / ctx-attribs-rgamma; - gg = 1.0 / ctx-attribs-ggamma; - bg = 1.0 / ctx-attribs-bgamma; + rg = 1.0F / ctx-attribs-rgamma; + gg = 1.0F / ctx-attribs-ggamma; + bg = 1.0F / ctx-attribs-bgamma; for (r = 0; r cpc; r++) { for (g = 0; g cpc; g++) { for (b = 0; b cpc; b++) { @@ -263,14 +267,14 @@ static Bool allocatePseudoColor(RContext *ctx) colors[i].blue = (b * 0x) / (cpc - 1); colors[i].flags = DoRed | DoGreen | DoBlue; - tmp = (double)colors[i].red / 65536.0; - colors[i].red = (unsigned short)(65536.0 * pow(tmp, rg)); + tmp = (float) colors[i].red / 65536.0F; + colors[i].red = (unsigned short)(65536.0F * powf(tmp, rg)); - tmp = (double)colors[i].green / 65536.0; - colors[i].green = (unsigned short)(65536.0 * pow(tmp, gg)); + tmp = (float) colors[i].green / 65536.0F; + colors[i].green = (unsigned short)(65536.0F * powf(tmp, gg)); - tmp = (double)colors[i].blue / 65536.0; - colors[i].blue = (unsigned short)(65536.0 * pow(tmp, bg)); + tmp = (float) colors[i].blue / 65536.0F; + colors[i].blue = (unsigned short)(65536.0F * powf(tmp, bg)); i++; } -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 0/4] Small updates to man pages
Hello, This series of patches is mainly changing the section from 1x to 1 for the man pages and take care of the wmmenugen tool. It was generated with the -R option as suggested by Carlos, because it both makes the patches smaller but also a lot more easy to review because changes to the files done at the same time as rename are clearly visible. For the curious, one way to get git to use this flag every time is: git config diff.renames copy Regards, Christophe doc/Makefile.am| 71 ++-- doc/{WPrefs.1x = WPrefs.1}| 6 +- doc/WindowMaker.1 | 1 + doc/WindowMaker.1x | 1 - doc/build/Translations.texi| 25 +++ doc/cs/Makefile.am | 18 ++--- doc/cs/{geticonset.1x = geticonset.1} | 6 +- doc/cs/{getstyle.1x = getstyle.1} | 6 +- doc/cs/{seticons.1x = seticons.1} | 6 +- doc/cs/{setstyle.1x = setstyle.1} | 6 +- doc/cs/{wdwrite.1x = wdwrite.1} | 4 +- doc/cs/{wmaker.1x = wmaker.1} | 24 +++ doc/cs/{wmsetbg.1x = wmsetbg.1} | 4 +- doc/cs/{wxcopy.1x = wxcopy.1} | 6 +- doc/cs/{wxpaste.1x = wxpaste.1} | 6 +- doc/{geticonset.1x = geticonset.1}| 6 +- doc/{getstyle.1x = getstyle.1}| 6 +- doc/ru/Makefile.am | 18 ++--- doc/ru/{geticonset.1x = geticonset.1} | 6 +- doc/ru/{getstyle.1x = getstyle.1} | 6 +- doc/ru/{seticons.1x = seticons.1} | 6 +- doc/ru/{setstyle.1x = setstyle.1} | 6 +- doc/ru/{wdwrite.1x = wdwrite.1} | 4 +- doc/ru/{wmaker.1x = wmaker.1} | 24 +++ doc/ru/{wmsetbg.1x = wmsetbg.1} | 4 +- doc/ru/{wxcopy.1x = wxcopy.1} | 6 +- doc/ru/{wxpaste.1x = wxpaste.1} | 6 +- doc/{seticons.1x = seticons.1}| 6 +- doc/{setstyle.1x = setstyle.1}| 8 +-- doc/sk/Makefile.am | 18 ++--- doc/sk/{geticonset.1x = geticonset.1} | 6 +- doc/sk/{getstyle.1x = getstyle.1} | 6 +- doc/sk/{seticons.1x = seticons.1} | 6 +- doc/sk/{setstyle.1x = setstyle.1} | 6 +- doc/sk/{wdwrite.1x = wdwrite.1} | 4 +- doc/sk/{wmaker.1x = wmaker.1} | 24 +++ doc/sk/{wmsetbg.1x = wmsetbg.1} | 4 +- doc/sk/{wxcopy.1x = wxcopy.1} | 6 +- doc/sk/{wxpaste.1x = wxpaste.1} | 6 +- doc/upgrade-windowmaker-defaults.8 | 2 +- doc/{wdread.1x = wdread.1}| 5 +- doc/{wdwrite.1x = wdwrite.1} | 5 +- doc/{wmagnify.1x = wmagnify.1}| 2 +- doc/wmaker.in | 27 doc/wmgenmenu.1| 3 + doc/wmmenugen.1| 89 ++--- doc/wmsetbg.in | 4 +- doc/{wxcopy.1x = wxcopy.1}| 6 +- doc/{wxpaste.1x = wxpaste.1} | 6 +- m4/wm_i18n.m4 | 9 ++- util/wmmenugen.c | 117 - 51 files changed, 419 insertions(+), 244 deletions(-) rename doc/{WPrefs.1x = WPrefs.1} (95%) create mode 100644 doc/WindowMaker.1 delete mode 100644 doc/WindowMaker.1x rename doc/cs/{geticonset.1x = geticonset.1} (93%) rename doc/cs/{getstyle.1x = getstyle.1} (97%) rename doc/cs/{seticons.1x = seticons.1} (93%) rename doc/cs/{setstyle.1x = setstyle.1} (96%) rename doc/cs/{wdwrite.1x = wdwrite.1} (95%) rename doc/cs/{wmaker.1x = wmaker.1} (95%) rename doc/cs/{wmsetbg.1x = wmsetbg.1} (97%) rename doc/cs/{wxcopy.1x = wxcopy.1} (95%) rename doc/cs/{wxpaste.1x = wxpaste.1} (95%) rename doc/{geticonset.1x = geticonset.1} (93%) rename doc/{getstyle.1x = getstyle.1} (97%) rename doc/ru/{geticonset.1x = geticonset.1} (95%) rename doc/ru/{getstyle.1x = getstyle.1} (98%) rename doc/ru/{seticons.1x = seticons.1} (96%) rename doc/ru/{setstyle.1x = setstyle.1} (97%) rename doc/ru/{wdwrite.1x = wdwrite.1} (96%) rename doc/ru/{wmaker.1x = wmaker.1} (96%) rename doc/ru/{wmsetbg.1x = wmsetbg.1} (98%) rename doc/ru/{wxcopy.1x = wxcopy.1} (97%) rename doc/ru/{wxpaste.1x = wxpaste.1} (97%) rename doc/{seticons.1x = seticons.1} (94%) rename doc/{setstyle.1x = setstyle.1} (95%) rename doc/sk/{geticonset.1x = geticonset.1} (92%) rename doc/sk/{getstyle.1x = getstyle.1} (97%) rename doc/sk/{seticons.1x = seticons.1} (93%) rename doc/sk/{setstyle.1x = setstyle.1} (96%) rename doc/sk/{wdwrite.1x = wdwrite.1} (94%) rename doc/sk/{wmaker.1x = wmaker.1} (95%) rename doc/sk/{wmsetbg.1x = wmsetbg.1} (97%) rename doc/sk/{wxcopy.1x = wxcopy.1} (94%) rename doc/sk/{wxpaste.1x = wxpaste.1} (94%) rename doc/{wdread.1x = wdread.1} (93%) rename doc/{wdwrite.1x = wdwrite.1} (93%) rename doc/{wmagnify.1x = wmagnify.1} (97%) rename doc/{wxcopy.1x = wxcopy.1} (95%) rename doc/{wxpaste.1x = wxpaste.1} (95%) -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 2/4] util: improve the command line argument parsing in wmmenugen
The code ignored the last argument provided on the command line; It did not support the recommended '--version' and '--help' from GNU which are often handy; It used an unusual syntax to specify the parser, now it can also use more usual -parser=name and -parser name, the old syntax is still supported to avoid breaking compatibility; When a problem is found with an argument, the program stops instead of printing an error message and continuing; There's been updates on the exit codes in case of problem because it is an information that could be useful for people calling the program from a script; Took the opportunity to provide more information in the man page and to get it cross-checked against the program's option list during make check. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- doc/Makefile.am | 8 +++- doc/wmmenugen.1 | 89 +- util/wmmenugen.c | 117 --- 3 files changed, 172 insertions(+), 42 deletions(-) diff --git a/doc/Makefile.am b/doc/Makefile.am index 26187f5..500e33a 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -49,7 +49,7 @@ am__v_CHKOPTS_0 = @echo CHK $@ ; am__v_CHKOPTS_1 = check-local: wmaker-args WPrefs-args wmagnify-args geticonset-args getstyle-args seticons-args setstyle-args \ - wdread-args wdwrite-args wmgenmenu-args wmsetbg-args wxcopy-args wxpaste-args + wdread-args wdwrite-args wmgenmenu-args wmmenugen-args wmsetbg-args wxcopy-args wxpaste-args wmaker-args: $(AM_V_CHKOPTS)$(top_srcdir)/script/check-cmdline-options-doc.sh \ @@ -91,6 +91,10 @@ wmgenmenu-args: $(AM_V_CHKOPTS)$(top_srcdir)/script/check-cmdline-options-doc.sh \ --program $(top_builddir)/util/wmgenmenu --man-page $(top_srcdir)/doc/wmgenmenu.1 +wmmenugen-args: + $(AM_V_CHKOPTS)$(top_srcdir)/script/check-cmdline-options-doc.sh \ + --program $(top_builddir)/util/wmmenugen --man-page $(top_srcdir)/doc/wmmenugen.1 + wmsetbg-args: $(AM_V_CHKOPTS)$(top_srcdir)/script/check-cmdline-options-doc.sh \ --program $(top_builddir)/util/wmsetbg --man-page wmsetbg.1 @@ -104,4 +108,4 @@ wxpaste-args: --program $(top_builddir)/util/wxpaste --man-page $(top_srcdir)/doc/wxpaste.1 .PHONY: wmaker-args WPrefs-args wmagnify-args geticonset-args getstyle-args seticons-args setstyle-args \ - wdread-args wdwrite-args wmgenmenu-args wmsetbg-args wxcopy-args wxpaste-args + wdread-args wdwrite-args wmgenmenu-args wmmenugen-args wmsetbg-args wxcopy-args wxpaste-args diff --git a/doc/wmmenugen.1 b/doc/wmmenugen.1 index 4a9f588..1617648 100644 --- a/doc/wmmenugen.1 +++ b/doc/wmmenugen.1 @@ -1,22 +1,93 @@ -.TH wmmenugen 1 15 August 2011 +.TH wmmenugen 1 16 May 2015 .SH NAME \fBwmmenugen\fR \- Window Maker PropList menu generator .PP .SH SYNOPSIS -.B wmmenugen \fI\-parser:parser fspec \fR[ fpsec ... \fR] -\fR[\fI\-parser:parser fspec \fR[ fpsec ... \fR] ... \fR] -.PP +.B wmmenugen +.RI [ options ...] +.BI \-parser= name +.IR fspec [ fspec ...] +.BI \fR[\fP\-parser= name +.IR fspec [ fspec ...]...] .SH DESCRIPTION -\fBwmmenugen \fR\- Window Maker PropList menu generator -.PP +.B wmmenugen +generates a menu in the +.I PropList +format for Window Maker from the input file +.IR fspec . +In the case where +.I fspec +is a directory instead of a file, then +.B wmmenugen +will read all the files present in the hierarchy of this directory. .SH OPTIONS .TP +.BR \-\-help , \-h +print a help message with the list of options +.TP .B \-parser -\fRspecify the parser. Known parsers are xdg and wmconfig. +specify the format of the file to be parsed +.TP +.B \-\-version +print the version of Window Maker from which the program comes +.SH PARSERS +.B wmmenugen +supports these file formats for input files: +.TP +.I wmconfig +the format of the menu generation tool for X of the same name .TP -.B \-fspec -\fRspecify the file. +.I xdg +the format of the menu specification as defined by the +.I FreeDesktop +standard, currently at version 1.1 +.SH RETURN VALUE +The exit status from the +.B wmmenugen +command provides information for the caller: +.TP +.B 0 +when the +.I PropList +menu was successfully generated on +.IR stdout . +.TP +.B 1 +when a +.I fspec +caused a problem (non readable file, ...) +.TP +.B 2 +the arguments of the command line where not recognised +.TP +.B 3 +the program met an unexpected menu structure; +you probably want to look at the section +.B BUGS +below. +.SH BUGS +If you get the exit status +.B 3 +with the unclear error message about +.IR unprocessed levels on the stack , +you encountered a limitation of +.BR wmmenugen . +It would be a good idea to prepare an archive with the files incriminated and submit them to the +mailing list (wmaker-dev@lists.windowmaker.org) with you command line, so the team can work on +improving the behaviour of the program on this case. +.SH SEE
[PATCH 1/4] doc: changed section for man pages from 1x to 1
As pointed by Douglas Torrance, nowadays no application is using anymore the 1x section for the man pages, so this patch is changing the section for all our concerned man pages to 1 (general commands). Took opportunity to add some missing references in see also sections. Reported-by: Doug Torrance dtorra...@monmouthcollege.edu Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- doc/Makefile.am | 60 ++--- doc/{WPrefs.1x = WPrefs.1} | 6 ++-- doc/WindowMaker.1 | 1 + doc/WindowMaker.1x | 1 - doc/{geticonset.1x = geticonset.1} | 6 ++-- doc/{getstyle.1x = getstyle.1} | 6 ++-- doc/{seticons.1x = seticons.1} | 6 ++-- doc/{setstyle.1x = setstyle.1} | 8 ++--- doc/upgrade-windowmaker-defaults.8 | 2 +- doc/{wdread.1x = wdread.1} | 5 +++- doc/{wdwrite.1x = wdwrite.1} | 5 ++-- doc/{wmagnify.1x = wmagnify.1} | 2 +- doc/wmaker.in | 27 + doc/wmgenmenu.1 | 3 ++ doc/wmsetbg.in | 4 +-- doc/{wxcopy.1x = wxcopy.1} | 6 ++-- doc/{wxpaste.1x = wxpaste.1} | 6 ++-- 17 files changed, 83 insertions(+), 71 deletions(-) rename doc/{WPrefs.1x = WPrefs.1} (95%) create mode 100644 doc/WindowMaker.1 delete mode 100644 doc/WindowMaker.1x rename doc/{geticonset.1x = geticonset.1} (93%) rename doc/{getstyle.1x = getstyle.1} (97%) rename doc/{seticons.1x = seticons.1} (94%) rename doc/{setstyle.1x = setstyle.1} (95%) rename doc/{wdread.1x = wdread.1} (93%) rename doc/{wdwrite.1x = wdwrite.1} (93%) rename doc/{wmagnify.1x = wmagnify.1} (97%) rename doc/{wxcopy.1x = wxcopy.1} (95%) rename doc/{wxpaste.1x = wxpaste.1} (95%) diff --git a/doc/Makefile.am b/doc/Makefile.am index 706158c..26187f5 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -3,44 +3,44 @@ SUBDIRS = build sk cs ru dist_man_MANS = \ - geticonset.1x \ - getstyle.1x \ + geticonset.1 \ + getstyle.1 \ get-wings-flags.1 \ get-wraster-flags.1 \ get-wutil-flags.1 \ - seticons.1x \ - setstyle.1x \ + seticons.1 \ + setstyle.1 \ upgrade-windowmaker-defaults.8 \ - wdread.1x \ - wdwrite.1x \ - WindowMaker.1x \ - wmagnify.1x \ + wdread.1 \ + wdwrite.1 \ + WindowMaker.1 \ + wmagnify.1 \ wmgenmenu.1 \ wmmenugen.1 \ - WPrefs.1x \ - wxcopy.1x \ - wxpaste.1x + WPrefs.1 \ + wxcopy.1 \ + wxpaste.1 man_MANS = \ - wmaker.1x \ - wmsetbg.1x + wmaker.1 \ + wmsetbg.1 -MOSTLYCLEANFILES = wmaker.1x wmsetbg.1x +MOSTLYCLEANFILES = wmaker.1 wmsetbg.1 EXTRA_DIST = wmaker.in wmsetbg.in -wmaker.1x: wmaker.in Makefile $(top_builddir)/config.h +wmaker.1: wmaker.in Makefile $(top_builddir)/config.h $(AM_V_GEN)$(top_srcdir)/script/replace-ac-keywords.sh \ --header $(top_builddir)/config.h --filter HAVE_INOTIFY \ --filter USE_ICCCM_WMREPLACE \ -Dsysconfdir=$(sysconfdir) --replace sysconfdir \ -Dpkgdatadir=$(pkgdatadir) --replace pkgdatadir \ - -o wmaker.1x $(srcdir)/wmaker.in + -o wmaker.1 $(srcdir)/wmaker.in -wmsetbg.1x: wmsetbg.in Makefile $(top_builddir)/config.h +wmsetbg.1: wmsetbg.in Makefile $(top_builddir)/config.h $(AM_V_GEN)$(top_srcdir)/script/replace-ac-keywords.sh \ --header $(top_builddir)/config.h --filter USE_XINERAMA \ - -o wmsetbg.1x $(srcdir)/wmsetbg.in + -o wmsetbg.1 $(srcdir)/wmsetbg.in # Create a 'silent rule' for our make check the same way automake does AM_V_CHKOPTS = $(am__v_CHKOPTS_$(V)) @@ -53,39 +53,39 @@ check-local: wmaker-args WPrefs-args wmagnify-args geticonset-args getstyle-args wmaker-args: $(AM_V_CHKOPTS)$(top_srcdir)/script/check-cmdline-options-doc.sh \ - --program $(top_builddir)/src/wmaker --man-page wmaker.1x + --program $(top_builddir)/src/wmaker --man-page wmaker.1 WPrefs-args: $(AM_V_CHKOPTS)$(top_srcdir)/script/check-cmdline-options-doc.sh \ - --program $(top_builddir)/WPrefs.app/WPrefs --man-page $(top_srcdir)/doc/WPrefs.1x + --program $(top_builddir)/WPrefs.app/WPrefs --man-page $(top_srcdir)/doc/WPrefs.1 wmagnify-args: $(AM_V_CHKOPTS)$(top_srcdir)/script/check-cmdline-options-doc.sh \ - --program $(top_builddir)/util/wmagnify --man-page $(top_srcdir)/doc/wmagnify.1x + --program $(top_builddir)/util/wmagnify --man-page $(top_srcdir)/doc/wmagnify.1 geticonset-args: $(AM_V_CHKOPTS)$(top_srcdir)/script/check-cmdline-options-doc.sh \ - --program $(top_builddir)/util/geticonset --man-page $(top_srcdir)/doc/geticonset.1x + --program $(top_builddir)/util/geticonset --man
[PATCH 2/3] fixup! wmaker: moved the list of Advanced Options into an array, for the Window Inspector
--- src/winspector.c | 48 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/winspector.c b/src/winspector.c index 3255fe6..6b6e687 100644 --- a/src/winspector.c +++ b/src/winspector.c @@ -110,57 +110,57 @@ static const struct { to outside the screen.) } }, advanced_option[] = { - { NoKeyBindings, { .no_bind_keys = 1 }, M_(Do not bind keyboard shortcuts), - M_(Do not bind keyboard shortcuts from Window Maker\n + { NoKeyBindings, { .no_bind_keys = 1 }, N_(Do not bind keyboard shortcuts), + N_(Do not bind keyboard shortcuts from Window Maker\n when this window is focused. This will allow the\n window to receive all key combinations regardless\n of your shortcut configuration.) }, - { NoMouseBindings, { .no_bind_mouse = 1 }, M_(Do not bind mouse clicks), - M_(Do not bind mouse actions, such as `Alt'+drag\n + { NoMouseBindings, { .no_bind_mouse = 1 }, N_(Do not bind mouse clicks), + N_(Do not bind mouse actions, such as `Alt'+drag\n in the window (when Alt is the modifier you have\n configured).) }, - { SkipWindowList, { .skip_window_list = 1 }, M_(Do not show in the window list), - M_(Do not list the window in the window list menu.) }, + { SkipWindowList, { .skip_window_list = 1 }, N_(Do not show in the window list), + N_(Do not list the window in the window list menu.) }, - { SkipSwitchPanel, { .skip_switchpanel = 1 }, M_(Do not show in the switch panel), - M_(Do not include in switch panel while cycling windows.) }, + { SkipSwitchPanel, { .skip_switchpanel = 1 }, N_(Do not show in the switch panel), + N_(Do not include in switch panel while cycling windows.) }, - { Unfocusable, { .no_focusable = 1 }, M_(Do not let it take focus), - M_(Do not let the window take keyboard focus when you\n + { Unfocusable, { .no_focusable = 1 }, N_(Do not let it take focus), + N_(Do not let the window take keyboard focus when you\n click on it.) }, - { KeepInsideScreen, { .dont_move_off = 1 }, M_(Keep inside screen), - M_(Do not allow the window to move itself completely\n + { KeepInsideScreen, { .dont_move_off = 1 }, N_(Keep inside screen), + N_(Do not allow the window to move itself completely\n outside the screen. For bug compatibility.\n) }, - { NoHideOthers, { .no_hide_others = 1 }, M_(Ignore 'Hide Others'), - M_(Do not hide the window when issuing the\n + { NoHideOthers, { .no_hide_others = 1 }, N_(Ignore 'Hide Others'), + N_(Do not hide the window when issuing the\n `HideOthers' command.) }, - { DontSaveSession, { .dont_save_session = 1 }, M_(Ignore 'Save Session'), - M_(Do not save the associated application in the\n + { DontSaveSession, { .dont_save_session = 1 }, N_(Ignore 'Save Session'), + N_(Do not save the associated application in the\n session's state, so that it won't be restarted\n together with other applications when Window Maker\n starts.) }, - { EmulateAppIcon, { .emulate_appicon = 1 }, M_(Emulate application icon), - M_(Make this window act as an application that provides\n + { EmulateAppIcon, { .emulate_appicon = 1 }, N_(Emulate application icon), + N_(Make this window act as an application that provides\n enough information to Window Maker for a dockable\n application icon to be created.) }, - { FocusAcrossWorkspace, { .focus_across_wksp = 1 }, M_(Focus across workspaces), - M_(Allow Window Maker to switch workspace to satisfy\n + { FocusAcrossWorkspace, { .focus_across_wksp = 1 }, N_(Focus across workspaces), + N_(Allow Window Maker to switch workspace to satisfy\n a focus request (annoying).) }, - { NoMiniaturizable, { .no_miniaturizable = 1 }, M_(Do not let it be minimized), - M_(Do not let the window of this application be\n + { NoMiniaturizable, { .no_miniaturizable = 1 }, N_(Do not let it be minimized), + N_(Do not let the window of this application be\n minimized.\n) } #ifdef XKB_BUTTON_HINT - ,{ NoLanguageButton, { .no_language_button = 1 }, M_(Disable language button), - M_(Remove the `toggle language' button of the window.) } + ,{ NoLanguageButton, { .no_language_button = 1 }, N_(Disable language button), + N_(Remove the `toggle language' button of the window.) } #endif }, application_attr[] = { -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 1/3] fixup! wmaker: moved the list of Application Attributes into an array, for the Window Inspector
--- src/winspector.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/winspector.c b/src/winspector.c index 0735caf..3255fe6 100644 --- a/src/winspector.c +++ b/src/winspector.c @@ -164,17 +164,17 @@ static const struct { #endif }, application_attr[] = { - { StartHidden, { .start_hidden = 1 }, M_(Start hidden), - M_(Automatically hide application when it's started.) }, + { StartHidden, { .start_hidden = 1 }, N_(Start hidden), + N_(Automatically hide application when it's started.) }, - { NoAppIcon, { .no_appicon = 1 }, M_(No application icon), - M_(Disable the application icon for the application.\n + { NoAppIcon, { .no_appicon = 1 }, N_(No application icon), + N_(Disable the application icon for the application.\n Note that you won't be able to dock it anymore,\n and any icons that are already docked will stop\n working correctly.) }, - { SharedAppIcon, { .shared_appicon = 1 }, M_(Shared application icon), - M_(Use a single shared application icon for all of\n + { SharedAppIcon, { .shared_appicon = 1 }, N_(Shared application icon), + N_(Use a single shared application icon for all of\n the instances of this application.\n) } }; -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 0/3] Fixes for incorrect I18N specifier
Hi Carlos, This 3 patches fixes the issue found by Alwin on M_() which should have been N_(). I gave a try to a new method for merging the patch which should be easier for you: after the 'git am', you can use: git rebase -i --autosquash next~20 It will detect the 'fixup!' string and move the commit to the appropriate place for you, you'll just have to accept (after review, because the '-i' looks to not be optional). Regards, Christophe. src/winspector.c | 104 +++ 1 file changed, 52 insertions(+), 52 deletions(-) -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 3/3] fixup! wmaker: moved the list of Window Attributes into an array, for the Window Inspector
--- src/winspector.c | 44 ++-- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/src/winspector.c b/src/winspector.c index 6b6e687..e947a14 100644 --- a/src/winspector.c +++ b/src/winspector.c @@ -67,45 +67,45 @@ static const struct { const char *caption; const char *description; } window_attribute[] = { - { NoTitlebar, { .no_titlebar = 1 }, M_(Disable titlebar), - M_(Remove the titlebar of this window.\n + { NoTitlebar, { .no_titlebar = 1 }, N_(Disable titlebar), + N_(Remove the titlebar of this window.\n To access the window commands menu of a window\n without it's titlebar, press Control+Esc (or the\n equivalent shortcut, if you changed the default\n settings).) }, - { NoResizebar, { .no_resizebar = 1 }, M_(Disable resizebar), - M_(Remove the resizebar of this window.) }, + { NoResizebar, { .no_resizebar = 1 }, N_(Disable resizebar), + N_(Remove the resizebar of this window.) }, - { NoCloseButton, { .no_close_button = 1 }, M_(Disable close button), - M_(Remove the `close window' button of this window.) }, + { NoCloseButton, { .no_close_button = 1 }, N_(Disable close button), + N_(Remove the `close window' button of this window.) }, - { NoMiniaturizeButton, { .no_miniaturize_button = 1 }, M_(Disable miniaturize button), - M_(Remove the `miniaturize window' button of the window.) }, + { NoMiniaturizeButton, { .no_miniaturize_button = 1 }, N_(Disable miniaturize button), + N_(Remove the `miniaturize window' button of the window.) }, - { NoBorder, { .no_border = 1 }, M_(Disable border), - M_(Remove the 1 pixel black border around the window.) }, + { NoBorder, { .no_border = 1 }, N_(Disable border), + N_(Remove the 1 pixel black border around the window.) }, - { KeepOnTop, { .floating = 1 }, M_(Keep on top (floating)), - M_(Keep the window over other windows, not allowing\n + { KeepOnTop, { .floating = 1 }, N_(Keep on top (floating)), + N_(Keep the window over other windows, not allowing\n them to cover it.) }, - { KeepOnBottom, { .sunken = 1 }, M_(Keep at bottom (sunken)), - M_(Keep the window under all other windows.) }, + { KeepOnBottom, { .sunken = 1 }, N_(Keep at bottom (sunken)), + N_(Keep the window under all other windows.) }, - { Omnipresent, { .omnipresent = 1 }, M_(Omnipresent), - M_(Make window present in all workspaces.) }, + { Omnipresent, { .omnipresent = 1 }, N_(Omnipresent), + N_(Make window present in all workspaces.) }, - { StartMiniaturized, { .start_miniaturized = 1 }, M_(Start miniaturized), - M_(Make the window be automatically miniaturized when it's\n + { StartMiniaturized, { .start_miniaturized = 1 }, N_(Start miniaturized), + N_(Make the window be automatically miniaturized when it's\n first shown.) }, - { StartMaximized, { .start_maximized = 1 }, M_(Start maximized), - M_(Make the window be automatically maximized when it's\n + { StartMaximized, { .start_maximized = 1 }, N_(Start maximized), + N_(Make the window be automatically maximized when it's\n first shown.) }, - { FullMaximize, { .full_maximize = 1 }, M_(Full screen maximization), - M_(Make the window use the whole screen space when it's\n + { FullMaximize, { .full_maximize = 1 }, N_(Full screen maximization), + N_(Make the window use the whole screen space when it's\n maximized. The titlebar and resizebar will be moved\n to outside the screen.) } -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 1/4] wmaker: replace and be replaced (ICCCM protocol)
From: Iain Patterson w...@iain.cx Use the same logic used by xfwm4, metacity et al to replace an existing window manager on the screen and allow other window managers to replace us, as defined by the ICCCM 2.0: http://www.x.org/releases/X11R7.6/doc/xorg-docs/specs/ICCCM/icccm.html Communication with the Window Manager by Means of Selections By convention those window managers try to become the selection owner of the WM_Sn atom where n is the screen number. If the atom is owned by another window manager and the --replace argument was not given to wmaker we fail to start. If the argument was given we try to become the new owner and wait for the existing window manger to exit. After a successful startup we watch for SelectionClear events on the atom and initiate a shutdown if one arrives, as that implies that another window manager was started with --replace. --- src/WindowMaker.h | 1 + src/event.c | 19 + src/main.c| 3 ++ src/screen.c | 114 +++--- src/screen.h | 1 + 5 files changed, 133 insertions(+), 5 deletions(-) diff --git a/src/WindowMaker.h b/src/WindowMaker.h index 3c2869c..606298d 100644 --- a/src/WindowMaker.h +++ b/src/WindowMaker.h @@ -463,6 +463,7 @@ extern struct WPreferences { char show_clip_title; struct { + unsigned int replace:1; /* replace existing window manager */ unsigned int nodock:1;/* don't display the dock */ unsigned int noclip:1;/* don't display the clip */ unsigned int clip_merged_in_dock:1; /* disable clip, switch workspaces with dock */ diff --git a/src/event.c b/src/event.c index dbb927b..1e100f7 100644 --- a/src/event.c +++ b/src/event.c @@ -103,6 +103,7 @@ static void handleFocusIn(XEvent *event); static void handleMotionNotify(XEvent *event); static void handleVisibilityNotify(XEvent *event); static void handle_inotify_events(void); +static void handle_selection_clear(XSelectionClearEvent *event); static void wdelete_death_handler(WMagicNumber id); @@ -274,6 +275,10 @@ void DispatchEvent(XEvent * event) #endif break; + case SelectionClear: + handle_selection_clear(event-xselectionclear); + break; + default: handleExtensions(event); break; @@ -1886,3 +1891,17 @@ static void handleVisibilityNotify(XEvent * event) return; wwin-flags.obscured = (event-xvisibility.state == VisibilityFullyObscured); } + +static void handle_selection_clear(XSelectionClearEvent *event) +{ + WScreen *scr = wScreenForWindow(event-window); + + if (!scr) + return; + + if (event-selection != scr-sn_atom) + return; + + wmessage(_(another window manager is replacing us!)); + Shutdown(WSExitMode); +} diff --git a/src/main.c b/src/main.c index 297f3ab..b68c5b6 100644 --- a/src/main.c +++ b/src/main.c @@ -435,6 +435,7 @@ static void print_help(void) puts(_(The Window Maker window manager for the X window system)); puts(); puts(_( -display host:dpy display to use)); + puts(_( --replace replace running window manager)); puts(_( --no-dock do not open the application Dock)); puts(_( --no-clip do not open the workspace Clip)); puts(_( --no-autolaunchdo not autolaunch applications)); @@ -651,6 +652,8 @@ static int real_main(int argc, char **argv) wPreferences.flags.noclip = 1; } else if (strcmp(argv[i], -nodrawer) == 0 || strcmp(argv[i], --no-drawer) == 0) { wPreferences.flags.nodrawer = 1; + } else if (strcmp(argv[i], -replace) == 0 || strcmp(argv[i], --replace) == 0) { + wPreferences.flags.replace = 1; } else if (strcmp(argv[i], -version) == 0 || strcmp(argv[i], --version) == 0) { printf(Window Maker %s\n, VERSION); exit(0); diff --git a/src/screen.c b/src/screen.c index 10a1fc9..1f246c4 100644 --- a/src/screen.c +++ b/src/screen.c @@ -66,6 +66,8 @@ |SubstructureRedirectMask|ButtonPressMask|ButtonReleaseMask\ |KeyPressMask|KeyReleaseMask) +#define REPLACE_WM_TIMEOUT 15 + #define STIPPLE_WIDTH 2 #define STIPPLE_HEIGHT 2 static char STIPPLE_DATA[] = { 0x02, 0x01 }; @@ -91,6 +93,106 @@ static void make_keys(void) } /* + * Support for ICCCM 2.0: Window Manager Replacement protocol + * See: http://www.x.org/releases/X11R7.6/doc/xorg-docs/specs/ICCCM/icccm.html + * + * Basically, user should be able to dynamically change its window manager; this is done + * cooperatively through a special Selection (WM_Sn where 'n' is the X screen number) + * + * This
[PATCH 2/4] wmaker: make the '--replace' de-activable at compile time
As it is really unlikely that in normal use case someone would need this feature, it is now conditional code, which is not enabled by default; the configure scripts now propose a '--enable-wmreplace' option to enable the corresponding code, as people making package for distributions may want to enable the feature to provide users the ability to give a try of all the window managers. Suggested-by: Carlos R. Mafra crma...@gmail.com Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- configure.ac | 14 ++ doc/build/Compilation.texi | 6 ++ src/WindowMaker.h | 2 ++ src/event.c| 8 src/main.c | 4 src/screen.c | 6 ++ src/screen.h | 2 ++ 7 files changed, 42 insertions(+) diff --git a/configure.ac b/configure.ac index 491bdc7..40f76fb 100644 --- a/configure.ac +++ b/configure.ac @@ -526,6 +526,20 @@ AS_IF([test x$enable_xdnd = xyes], AM_CONDITIONAL([USE_DOCK_XDND], [test x$enable_dock_xdnd != xno]) +dnl Support for ICCCM 2.0 Window Manager replacement +dnl +AC_ARG_ENABLE([wmreplace], +[AS_HELP_STRING([--enable-wmreplace], [support for ICCCM window manager replacement])], +[AS_CASE([$enableval], +[yes|no], [], +[AC_MSG_ERROR([bad value '$enableval' for --enable-wmreplace])])], +[enable_wmreplace=no]) +AS_IF([test x$enable_wmreplace = xyes], +[AC_DEFINE([USE_ICCCM_WMREPLACE], [1], + [define to support ICCCM protocol for window manager replacement]) + supported_xext=$supported_xext WMReplace]) + + dnl XShape support dnl == AC_ARG_ENABLE([shape], diff --git a/doc/build/Compilation.texi b/doc/build/Compilation.texi index 095718c..2ab7598 100644 --- a/doc/build/Compilation.texi +++ b/doc/build/Compilation.texi @@ -575,6 +575,12 @@ Disable support for Motif's MWM Window Manager hints. These attributes were introduced by the Motif toolkit to ask for special window appearance requests. Nowadays this is covered by the NetWM/EWMH specification, but there are still applications that rely on MWM Hints. +@item --enable-wmreplace +Add support for the @emph{ICCCM} protocol for cooperative window manager replacement. +This feature is disabled by default because you probably don't need to switch seamlessly the window manager; +if you are making a package for a distribution you'd probably want to enable this because it allows users to give +a try to different window managers without restarting everything for an extra cost that is not really big. + @item --disable-xdnd Disable support for dragging and dropping files on the dock, which launches a user-specified command with that file. diff --git a/src/WindowMaker.h b/src/WindowMaker.h index 606298d..37e3fc0 100644 --- a/src/WindowMaker.h +++ b/src/WindowMaker.h @@ -463,7 +463,9 @@ extern struct WPreferences { char show_clip_title; struct { +#ifdef USE_ICCCM_WMREPLACE unsigned int replace:1; /* replace existing window manager */ +#endif unsigned int nodock:1;/* don't display the dock */ unsigned int noclip:1;/* don't display the clip */ unsigned int clip_merged_in_dock:1; /* disable clip, switch workspaces with dock */ diff --git a/src/event.c b/src/event.c index 1e100f7..71450fc 100644 --- a/src/event.c +++ b/src/event.c @@ -1894,6 +1894,7 @@ static void handleVisibilityNotify(XEvent * event) static void handle_selection_clear(XSelectionClearEvent *event) { +#ifdef USE_ICCCM_WMREPLACE WScreen *scr = wScreenForWindow(event-window); if (!scr) @@ -1904,4 +1905,11 @@ static void handle_selection_clear(XSelectionClearEvent *event) wmessage(_(another window manager is replacing us!)); Shutdown(WSExitMode); +#else + /* +* If the support for ICCCM window manager replacement was not enabled, we should not receive +* this kind of event, so we simply do nothing. +*/ + (void) event; +#endif } diff --git a/src/main.c b/src/main.c index b68c5b6..d7aee3d 100644 --- a/src/main.c +++ b/src/main.c @@ -435,7 +435,9 @@ static void print_help(void) puts(_(The Window Maker window manager for the X window system)); puts(); puts(_( -display host:dpy display to use)); +#ifdef USE_ICCCM_WMREPLACE puts(_( --replace replace running window manager)); +#endif puts(_( --no-dock do not open the application Dock)); puts(_( --no-clip do not open the workspace Clip)); puts(_( --no-autolaunchdo not autolaunch applications)); @@ -652,8 +654,10 @@ static int real_main(int argc, char **argv) wPreferences.flags.noclip = 1; } else if (strcmp(argv[i], -nodrawer) == 0 || strcmp(argv[i
[PATCH 0/5] ICCCM window manager replace protocol
Hello, This series of patch re-introduce the Window Manager Replace protocol that was proposed by Iain in 2013. The first patch is Iain's code, updated to apply on current #next and including a more elaborate comment about it. The second patch is adding a configure option to enable this feature, because as raised by Carlos most users don't care about this, it is mainly for distributions to allow people to give a try to different window managers seamlessly. The third patch adds one little thing from the protocol that was not implemented in first patch. Regards, Christophe. NEWS | 11 + configure.ac | 14 ++ doc/Makefile.am| 1 + doc/build/Compilation.texi | 6 +++ doc/wmaker.in | 3 ++ src/WindowMaker.h | 3 ++ src/event.c| 106 +++ src/main.c | 7 +++ src/screen.c | 120 +++-- src/screen.h | 3 ++ 10 files changed, 269 insertions(+), 5 deletions(-) -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 4/4] doc: describe Iain Patterson's new feature for ICCCM compliance
Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- NEWS| 11 +++ doc/Makefile.am | 1 + doc/wmaker.in | 3 +++ 3 files changed, 15 insertions(+) diff --git a/NEWS b/NEWS index 6561c4e..023ceb1 100644 --- a/NEWS +++ b/NEWS @@ -66,6 +66,17 @@ tell Window Maker to just ignore them. This is done with the new setting called IgnoreGtkHints, which is available in the Expert panel in WPrefs. +Cooperative Window Manager Replacement +-- + +The ICCCM defines a protocol for window managers to ask to replace the currently +running one; Window Maker now supports it. You can ask Window Maker to take the +place of current one by running wmaker --replace, or any other window manager +can ask Window Maker to leave the place for them when started the same way. +Please note that this feature must be explicitely enabled at compile time because +by default it is not compiled in (configure --enable-wmreplace). + + --- 0.95.6 More image format supported diff --git a/doc/Makefile.am b/doc/Makefile.am index fff203f..706158c 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -32,6 +32,7 @@ EXTRA_DIST = wmaker.in wmsetbg.in wmaker.1x: wmaker.in Makefile $(top_builddir)/config.h $(AM_V_GEN)$(top_srcdir)/script/replace-ac-keywords.sh \ --header $(top_builddir)/config.h --filter HAVE_INOTIFY \ + --filter USE_ICCCM_WMREPLACE \ -Dsysconfdir=$(sysconfdir) --replace sysconfdir \ -Dpkgdatadir=$(pkgdatadir) --replace pkgdatadir \ -o wmaker.1x $(srcdir)/wmaker.in diff --git a/doc/wmaker.in b/doc/wmaker.in index dc09ce0..48e2879 100644 --- a/doc/wmaker.in +++ b/doc/wmaker.in @@ -51,6 +51,9 @@ disable the Drawers in the Dock @!HAVE_INOTIFY@.TP @!HAVE_INOTIFY@.B \-\-no\-polling @!HAVE_INOTIFY@disable the periodic check on the configuration file to reload it automatically +@USE_ICCCM_WMREPLACE@.TP +@USE_ICCCM_WMREPLACE@.B \-\-replace +@USE_ICCCM_WMREPLACE@ask the currently running window manager to let Window Maker take his place .TP .B \-\-static do not update or save automatically the configuration -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 3/4] wmaker: support providing ICCCM version, for compliance with the standard
The standard specify that the pseudo-selection which is used to cooperatively replace window managers should actually contain the version of the ICCCM standard which is supported. As this could be handy for compatibility checks in the future, let Window Maker comply. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- src/event.c | 79 + 1 file changed, 79 insertions(+) diff --git a/src/event.c b/src/event.c index 71450fc..a6a5402 100644 --- a/src/event.c +++ b/src/event.c @@ -37,6 +37,7 @@ #include X11/Xlib.h #include X11/Xutil.h +#include X11/Xatom.h #ifdef USE_XSHAPE # include X11/extensions/shape.h #endif @@ -103,6 +104,7 @@ static void handleFocusIn(XEvent *event); static void handleMotionNotify(XEvent *event); static void handleVisibilityNotify(XEvent *event); static void handle_inotify_events(void); +static void handle_selection_request(XSelectionRequestEvent *event); static void handle_selection_clear(XSelectionClearEvent *event); static void wdelete_death_handler(WMagicNumber id); @@ -275,6 +277,10 @@ void DispatchEvent(XEvent * event) #endif break; + case SelectionRequest: + handle_selection_request(event-xselectionrequest); + break; + case SelectionClear: handle_selection_clear(event-xselectionclear); break; @@ -1892,6 +1898,79 @@ static void handleVisibilityNotify(XEvent * event) wwin-flags.obscured = (event-xvisibility.state == VisibilityFullyObscured); } +static void handle_selection_request(XSelectionRequestEvent *event) +{ +#ifdef USE_ICCCM_WMREPLACE + static Atom atom_version = None; + WScreen *scr; + XSelectionEvent notify; + + /* +* This event must be sent to the slection requester to not block him +* +* We create it with the answer 'there is no selection' by default +*/ + notify.type = SelectionNotify; + notify.display = dpy; + notify.requestor = event-requestor; + notify.selection = event-selection; + notify.target = event-target; + notify.property = None; /* This says that there is no selection */ + notify.time = event-time; + + scr = wScreenForWindow(event-owner); + if (!scr) + goto not_our_selection; + + if (event-owner != scr-info_window) + goto not_our_selection; + + if (event-selection != scr-sn_atom) + goto not_our_selection; + + if (atom_version == None) + atom_version = XInternAtom(dpy, VERSION, False); + + if (event-target == atom_version) { + static const long icccm_version[] = { 2, 0 }; + + /* +* This protocol is defined in ICCCM 2.0: +* http://www.x.org/releases/X11R7.7/doc/xorg-docs/icccm/icccm.html +* Communication with the Window Manager by Means of Selections +*/ + + /* +* Setting the property means the content of the selection is available +* According to the ICCCM spec, we need to support being asked for a property +* set to 'None' for compatibility with old clients +*/ + notify.property = (event-property == None)?(event-target):(event-property); + + XChangeProperty(dpy, event-requestor, notify.property, + XA_INTEGER, 32, PropModeReplace, + (unsigned char *) icccm_version, wlengthof(icccm_version)); + } + + not_our_selection: + if (notify.property == None) + wwarning(received SelectionRequest(%s) for target=\%s\ from requestor 0x%lX but we have no answer, +XGetAtomName(dpy, event-selection), XGetAtomName(dpy, event-target), (long) event-requestor); + + /* Send the answer to the requestor */ + XSendEvent(dpy, event-requestor, False, 0L, (XEvent *) notify); + +#else + /* +* If the support for ICCCM window manager replacement was not enabled, we should not receive +* this kind of event, so we just ignore it (Conceptually, we should reply with 'SelectionNotify' +* event with property set to 'None' to tell that we don't have this selection, but that is a bit +* costly for an event that shall never happen). +*/ + (void) event; +#endif +} + static void handle_selection_clear(XSelectionClearEvent *event) { #ifdef USE_ICCCM_WMREPLACE -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 0/9] Fixes and improvements for GNOME applications
Hello, This series of patchs is improving a few fixes in the Window Inspector which should help forcing GNOME application to behave correctly under Window Maker. This have been reported by many people; it may also (or may not) improve the situation with some GNUstep panels that was reported by Germán Arias back in november. Regards, Christophe. FAQ | 25 +- NEWS | 10 + WINGs/WINGs/WINGs.h | 5 +- WINGs/WINGs/WINGsP.h | 10 + WINGs/wbutton.c | 35 ++- WINGs/widgets.c | 69 + WPrefs.app/Expert.c | 3 + src/WindowMaker.h| 6 + src/client.c | 12 +- src/defaults.c | 2 + src/motif.c | 64 ++-- src/startup.c| 6 +- src/window.c | 66 ++-- src/winspector.c | 827 +++ 14 files changed, 613 insertions(+), 527 deletions(-) -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 1/9] wmaker: moved the list of Window Attributes into an array, for the Window Inspector
The Window Inspector is used to let user change the list of attributes for a window. This list of attributes was defined through many hard-coded things; by defining an array with everything at the beginning of the file it is easier to maintain (the code is simpler because it is more generic) and to make it evolve. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- src/winspector.c | 347 ++- 1 file changed, 163 insertions(+), 184 deletions(-) diff --git a/src/winspector.c b/src/winspector.c index 78b5cd0..8413836 100644 --- a/src/winspector.c +++ b/src/winspector.c @@ -60,6 +60,56 @@ #define UPDATE_DEFAULTS1 #define IS_BOOLEAN 2 + +static const struct { + const char *key_name; + WWindowAttributes flag; + const char *caption; + const char *description; +} window_attribute[] = { + { NoTitlebar, { .no_titlebar = 1 }, M_(Disable titlebar), + M_(Remove the titlebar of this window.\n +To access the window commands menu of a window\n +without it's titlebar, press Control+Esc (or the\n +equivalent shortcut, if you changed the default\n +settings).) }, + + { NoResizebar, { .no_resizebar = 1 }, M_(Disable resizebar), + M_(Remove the resizebar of this window.) }, + + { NoCloseButton, { .no_close_button = 1 }, M_(Disable close button), + M_(Remove the `close window' button of this window.) }, + + { NoMiniaturizeButton, { .no_miniaturize_button = 1 }, M_(Disable miniaturize button), + M_(Remove the `miniaturize window' button of the window.) }, + + { NoBorder, { .no_border = 1 }, M_(Disable border), + M_(Remove the 1 pixel black border around the window.) }, + + { KeepOnTop, { .floating = 1 }, M_(Keep on top (floating)), + M_(Keep the window over other windows, not allowing\n +them to cover it.) }, + + { KeepOnBottom, { .sunken = 1 }, M_(Keep at bottom (sunken)), + M_(Keep the window under all other windows.) }, + + { Omnipresent, { .omnipresent = 1 }, M_(Omnipresent), + M_(Make window present in all workspaces.) }, + + { StartMiniaturized, { .start_miniaturized = 1 }, M_(Start miniaturized), + M_(Make the window be automatically miniaturized when it's\n +first shown.) }, + + { StartMaximized, { .start_maximized = 1 }, M_(Start maximized), + M_(Make the window be automatically maximized when it's\n +first shown.) }, + + { FullMaximize, { .full_maximize = 1 }, M_(Full screen maximization), + M_(Make the window use the whole screen space when it's\n + maximized. The titlebar and resizebar will be moved\n + to outside the screen.) } +}; + typedef struct InspectorPanel { struct InspectorPanel *nextPtr; @@ -85,7 +135,7 @@ typedef struct InspectorPanel { /* second page. attributes */ WMFrame *attrFrm; - WMButton *attrChk[11]; + WMButton *attrChk[sizeof(window_attribute) / sizeof(window_attribute[0])]; /* 3rd page. more attributes */ WMFrame *moreFrm; @@ -115,29 +165,28 @@ typedef struct InspectorPanel { } InspectorPanel; static InspectorPanel *panelList = NULL; -static WMPropList *ANoTitlebar = NULL; -static WMPropList *ANoResizebar; -static WMPropList *ANoMiniaturizeButton; -static WMPropList *ANoCloseButton; -static WMPropList *ANoBorder; + +/* + * We are supposed to use the 'key_name' from the the 'window_attribute' structure when we want to + * save the user choice to the database, but as we will need to convert that name into a Property + * List, we use here a Cache of Property Lists, generated only once, which can be reused. It will + * also save on memory because of the re-use of the same storage space instead of allocating a new + * one everytime. + */ +static WMPropList *pl_attribute[sizeof(window_attribute) / sizeof(window_attribute[0])] = { [0] = NULL }; + static WMPropList *ANoHideOthers; static WMPropList *ANoMouseBindings; static WMPropList *ANoKeyBindings; static WMPropList *ANoAppIcon; -static WMPropList *AKeepOnTop; -static WMPropList *AKeepOnBottom; -static WMPropList *AOmnipresent; static WMPropList *ASkipWindowList; static WMPropList *ASkipSwitchPanel; static WMPropList *AKeepInsideScreen; static WMPropList *AUnfocusable; static WMPropList *AFocusAcrossWorkspace; static WMPropList *AAlwaysUserIcon; -static WMPropList *AStartMiniaturized; -static WMPropList *AStartMaximized; static WMPropList *ADontSaveSession; static WMPropList *AEmulateAppIcon; -static WMPropList *AFullMaximize; static WMPropList *ASharedAppIcon; static WMPropList *ANoMiniaturizable; #ifdef XKB_BUTTON_HINT @@ -162,36 +211,81 @@ static void create_tab_window_advanced(WWindow *wwin, InspectorPanel *panel, int static void
[PATCH 2/9] wmaker: moved the list of Advanced Options into an array, for the Window Inspector
The Window Inspector is used to let user change a list of advanced options for a window. This list was defined through many hard-coded things; by defining an array with everything at the beginning of the file it is easier to maintain (the code is simpler because it is more generic) and to make it evolve in the future. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- src/winspector.c | 311 ++- 1 file changed, 98 insertions(+), 213 deletions(-) diff --git a/src/winspector.c b/src/winspector.c index 8413836..16ab168 100644 --- a/src/winspector.c +++ b/src/winspector.c @@ -108,6 +108,60 @@ static const struct { M_(Make the window use the whole screen space when it's\n maximized. The titlebar and resizebar will be moved\n to outside the screen.) } + +}, advanced_option[] = { + { NoKeyBindings, { .no_bind_keys = 1 }, M_(Do not bind keyboard shortcuts), + M_(Do not bind keyboard shortcuts from Window Maker\n +when this window is focused. This will allow the\n +window to receive all key combinations regardless\n +of your shortcut configuration.) }, + + { NoMouseBindings, { .no_bind_mouse = 1 }, M_(Do not bind mouse clicks), + M_(Do not bind mouse actions, such as `Alt'+drag\n +in the window (when Alt is the modifier you have\n +configured).) }, + + { SkipWindowList, { .skip_window_list = 1 }, M_(Do not show in the window list), + M_(Do not list the window in the window list menu.) }, + + { SkipSwitchPanel, { .skip_switchpanel = 1 }, M_(Do not show in the switch panel), + M_(Do not include in switch panel while cycling windows.) }, + + { Unfocusable, { .no_focusable = 1 }, M_(Do not let it take focus), + M_(Do not let the window take keyboard focus when you\n +click on it.) }, + + { KeepInsideScreen, { .dont_move_off = 1 }, M_(Keep inside screen), + M_(Do not allow the window to move itself completely\n +outside the screen. For bug compatibility.\n) }, + + { NoHideOthers, { .no_hide_others = 1 }, M_(Ignore 'Hide Others'), + M_(Do not hide the window when issuing the\n +`HideOthers' command.) }, + + { DontSaveSession, { .dont_save_session = 1 }, M_(Ignore 'Save Session'), + M_(Do not save the associated application in the\n +session's state, so that it won't be restarted\n +together with other applications when Window Maker\n +starts.) }, + + { EmulateAppIcon, { .emulate_appicon = 1 }, M_(Emulate application icon), + M_(Make this window act as an application that provides\n +enough information to Window Maker for a dockable\n +application icon to be created.) }, + + { FocusAcrossWorkspace, { .focus_across_wksp = 1 }, M_(Focus across workspaces), + M_(Allow Window Maker to switch workspace to satisfy\n +a focus request (annoying).) }, + + { NoMiniaturizable, { .no_miniaturizable = 1 }, M_(Do not let it be minimized), + M_(Do not let the window of this application be\n +minimized.\n) } + +#ifdef XKB_BUTTON_HINT + ,{ NoLanguageButton, { .no_language_button = 1 }, M_(Disable language button), + M_(Remove the `toggle language' button of the window.) } +#endif }; typedef struct InspectorPanel { @@ -139,11 +193,7 @@ typedef struct InspectorPanel { /* 3rd page. more attributes */ WMFrame *moreFrm; -#ifdef XKB_BUTTON_HINT - WMButton *moreChk[12]; -#else - WMButton *moreChk[11]; -#endif + WMButton *moreChk[sizeof(advanced_option) / sizeof(advanced_option[0])]; /* 4th page. icon and workspace */ WMFrame *iconFrm; @@ -174,24 +224,11 @@ static InspectorPanel *panelList = NULL; * one everytime. */ static WMPropList *pl_attribute[sizeof(window_attribute) / sizeof(window_attribute[0])] = { [0] = NULL }; +static WMPropList *pl_advoptions[sizeof(advanced_option) / sizeof(advanced_option[0])]; -static WMPropList *ANoHideOthers; -static WMPropList *ANoMouseBindings; -static WMPropList *ANoKeyBindings; static WMPropList *ANoAppIcon; -static WMPropList *ASkipWindowList; -static WMPropList *ASkipSwitchPanel; -static WMPropList *AKeepInsideScreen; -static WMPropList *AUnfocusable; -static WMPropList *AFocusAcrossWorkspace; static WMPropList *AAlwaysUserIcon; -static WMPropList *ADontSaveSession; -static WMPropList *AEmulateAppIcon; static WMPropList *ASharedAppIcon; -static WMPropList *ANoMiniaturizable; -#ifdef XKB_BUTTON_HINT -static WMPropList *ANoLanguageButton; -#endif static WMPropList *AStartWorkspace; static WMPropList *AIcon; @@ -271,26 +308,14 @@ static void make_keys(void) for (i = 0; i wlengthof(window_attribute); i++) pl_attribute[i
[PATCH 4/9] wmaker: fix misuse of 'user_flags' instead of 'client_flags' for window attributes
The structure containing the information on windows contains 2 sets of attributes, client_flags which contains those asked by the application through Hints (like MWM Hints and others) and user_flags which was defined to allow the user to override them. Unfortunately many places of the code was using the wrong structure to save the attributes to (for example by using the WSETUFLAG macro) which was merely ok as the user_flags have priority, but when we want to provide a clean consistent behaviour to users, we need to get things in the right place. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- src/client.c | 12 ++-- src/motif.c | 56 +--- src/window.c | 38 +- src/winspector.c | 4 ++-- 4 files changed, 58 insertions(+), 52 deletions(-) diff --git a/src/client.c b/src/client.c index 9af875c..92912b9 100644 --- a/src/client.c +++ b/src/client.c @@ -524,14 +524,14 @@ void wClientCheckProperty(WWindow * wwin, XPropertyEvent * event) wwin-transient_for = new_owner; if (new_owner == None) { if (WFLAGP(wwin, no_miniaturizable)) { - WSETUFLAG(wwin, no_miniaturizable, 0); - WSETUFLAG(wwin, no_miniaturize_button, 0); + wwin-client_flags.no_miniaturizable = 0; + wwin-client_flags.no_miniaturize_button = 0; if (wwin-frame) wWindowConfigureBorders(wwin); } } else if (!WFLAGP(wwin, no_miniaturizable)) { - WSETUFLAG(wwin, no_miniaturizable, 1); - WSETUFLAG(wwin, no_miniaturize_button, 1); + wwin-client_flags.no_miniaturizable = 1; + wwin-client_flags.no_miniaturize_button = 1; if (wwin-frame) wWindowConfigureBorders(wwin); } @@ -544,7 +544,7 @@ void wClientCheckProperty(WWindow * wwin, XPropertyEvent * event) PropGetProtocols(wwin-client_win, wwin-protocols); - WSETUFLAG(wwin, kill_close, !wwin-protocols.DELETE_WINDOW); + wwin-client_flags.kill_close = !wwin-protocols.DELETE_WINDOW; if (wwin-frame) wWindowUpdateButtonImages(wwin); @@ -572,7 +572,7 @@ void wClientCheckProperty(WWindow * wwin, XPropertyEvent * event) wApplicationDestroy(wapp); while (foo) { if (foo-fake_group foo-fake_group == fPtr) { - WSETUFLAG(foo, shared_appicon, 0); + foo-client_flags.shared_appicon = 0; foo-fake_group = NULL; if (foo-group_id != None) diff --git a/src/motif.c b/src/motif.c index b649f82..6537038 100644 --- a/src/motif.c +++ b/src/motif.c @@ -75,19 +75,21 @@ static void setupMWMHints(WWindow *wwin, MWMHints *mwm_hints) */ if (mwm_hints-flags MWM_HINTS_DECORATIONS) { - WSETUFLAG(wwin, no_titlebar, 1); - WSETUFLAG(wwin, no_close_button, 1); - WSETUFLAG(wwin, no_miniaturize_button, 1); - WSETUFLAG(wwin, no_resizebar, 1); + wwin-client_flags.no_titlebar = 1; + wwin-client_flags.no_close_button = 1; + wwin-client_flags.no_miniaturize_button = 1; + wwin-client_flags.no_resizebar = 1; + wwin-client_flags.no_border = 1; if (mwm_hints-decorations MWM_DECOR_ALL) { - WSETUFLAG(wwin, no_titlebar, 0); - WSETUFLAG(wwin, no_close_button, 0); - WSETUFLAG(wwin, no_closable, 0); - WSETUFLAG(wwin, no_miniaturize_button, 0); - WSETUFLAG(wwin, no_miniaturizable, 0); - WSETUFLAG(wwin, no_resizebar, 0); - WSETUFLAG(wwin, no_resizable, 0); + wwin-client_flags.no_titlebar = 0; + wwin-client_flags.no_close_button = 0; + wwin-client_flags.no_closable = 0; + wwin-client_flags.no_miniaturize_button = 0
[PATCH 6/9] WINGs: create a new type of Tri-State Switch Button (to doc)
There are some times when we need a Switch Button (aka CheckBox) with more than 2 states, generally to express check/uncheck/leave-as-is. This patch extends the Button widget to support the new WBTTriState type, similar to the existing WBTSwitch except it supports a 3rd state which is reported to application as '-1'. The implementation was done in order to not break the binary API. The version have been incremented in the WINGs header to reflect the change, but not the version in the 'configure.ac' because that have already been done in commit c6e323e75d for the next Window Maker release. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- WINGs/WINGs/WINGs.h | 5 ++-- WINGs/WINGs/WINGsP.h | 10 WINGs/wbutton.c | 35 ++ WINGs/widgets.c | 69 4 files changed, 112 insertions(+), 7 deletions(-) diff --git a/WINGs/WINGs/WINGs.h b/WINGs/WINGs/WINGs.h index 4798174..5235c20 100644 --- a/WINGs/WINGs/WINGs.h +++ b/WINGs/WINGs/WINGs.h @@ -26,7 +26,7 @@ #include WINGs/WUtil.h #include X11/Xlib.h -#define WINGS_H_VERSION 20141205 +#define WINGS_H_VERSION 20150508 #ifdef __cplusplus @@ -127,7 +127,8 @@ typedef enum { WBTRadio = 5, WBTMomentaryChange = 6, WBTOnOff = 7, -WBTMomentaryLight = 8 +WBTMomentaryLight = 8, +WBTTriState = 9 } WMButtonType; /* button behaviour masks */ diff --git a/WINGs/WINGs/WINGsP.h b/WINGs/WINGs/WINGsP.h index fc18b1c..4cbe0fc 100644 --- a/WINGs/WINGs/WINGsP.h +++ b/WINGs/WINGs/WINGsP.h @@ -268,6 +268,16 @@ typedef struct W_Screen { struct W_View *modalView; unsigned modalLoop:1; unsigned ignoreNextDoubleClick:1; + +/* + * New stuff in Window Maker 0.95.7 + * Added at the end of the structure to avoid breaking binary compatibility + * with previous versions of the toolkit + */ +W_Pixmap *tristateButtonImageOn; +W_Pixmap *tristateButtonImageOff; +W_Pixmap *tristateButtonImageTri; + } W_Screen; #define W_DRAWABLE(scr)(scr)-rcontext-drawable diff --git a/WINGs/wbutton.c b/WINGs/wbutton.c index 8c8e4dc..c8d78d9 100644 --- a/WINGs/wbutton.c +++ b/WINGs/wbutton.c @@ -17,6 +17,7 @@ typedef struct W_Button { W_Pixmap *image; W_Pixmap *altImage; + W_Pixmap *tsImage; W_Pixmap *dimage; @@ -37,7 +38,7 @@ typedef struct W_Button { WMImagePosition imagePosition:4; WMAlignment alignment:2; - unsigned int selected:1; + unsigned int selected:2; unsigned int enabled:1; @@ -183,6 +184,14 @@ WMButton *WMCreateButton(WMWidget * parent, WMButtonType type) bPtr-altImage = WMRetainPixmap(scrPtr-radioButtonImageOn); break; + case WBTTriState: + bPtr = WMCreateCustomButton(parent, WBBStateChangeMask); + bPtr-flags.bordered = 0; + bPtr-image = WMRetainPixmap(scrPtr-tristateButtonImageOff); + bPtr-altImage = WMRetainPixmap(scrPtr-tristateButtonImageOn); + bPtr-tsImage = WMRetainPixmap(scrPtr-tristateButtonImageTri); + break; + default: case WBTMomentaryLight: bPtr = WMCreateCustomButton(parent, WBBSpringLoadedMask | WBBPushLightMask); @@ -197,7 +206,7 @@ WMButton *WMCreateButton(WMWidget * parent, WMButtonType type) WMSetButtonText(bPtr, DEFAULT_RADIO_TEXT); bPtr-flags.alignment = DEFAULT_RADIO_ALIGNMENT; bPtr-flags.imagePosition = DEFAULT_RADIO_IMAGE_POSITION; - } else if (type == WBTSwitch) { + } else if (type == WBTSwitch || type == WBTTriState) { W_ResizeView(bPtr-view, DEFAULT_SWITCH_WIDTH, DEFAULT_SWITCH_HEIGHT); WMSetButtonText(bPtr, DEFAULT_SWITCH_TEXT); bPtr-flags.alignment = DEFAULT_SWITCH_ALIGNMENT; @@ -371,7 +380,10 @@ void WMSetButtonDisabledTextColor(WMButton * bPtr, WMColor * color) void WMSetButtonSelected(WMButton * bPtr, int isSelected) { - bPtr-flags.selected = isSelected ? 1 : 0; + if ((bPtr-flags.type == WBTTriState) (isSelected 0)) + bPtr-flags.selected = 2; + else + bPtr-flags.selected = isSelected ? 1 : 0; if (bPtr-view-flags.realized) { paintButton(bPtr); @@ -384,6 +396,9 @@ int WMGetButtonSelected(WMButton * bPtr) { CHECK_CLASS(bPtr, WC_Button); + if ((bPtr-flags.type == WBTTriState) (bPtr-flags.selected == 2)) + return -1; + return bPtr-flags.selected; } @@ -558,7 +573,9 @@ static void paintButton(Button * bPtr) if (bPtr-flags.stateChange) { if (bPtr-altCaption) caption = bPtr-altCaption; - if (bPtr-altImage) + if (bPtr-flags.selected == 2
[PATCH 3/9] wmaker: moved the list of Application Attributes into an array, for the Window Inspector
The Window Inspector is used to let user change a list of advanced options for all the windows of an application. This list was defined through many hard-coded things; by defining an array with everything at the beginning of the file it is easier to maintain (the code is simpler because it is more generic) and to make it evolve. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- src/winspector.c | 116 +++ 1 file changed, 57 insertions(+), 59 deletions(-) diff --git a/src/winspector.c b/src/winspector.c index 16ab168..edfa8d0 100644 --- a/src/winspector.c +++ b/src/winspector.c @@ -162,6 +162,20 @@ static const struct { ,{ NoLanguageButton, { .no_language_button = 1 }, M_(Disable language button), M_(Remove the `toggle language' button of the window.) } #endif + +}, application_attr[] = { + { StartHidden, { .start_hidden = 1 }, M_(Start hidden), + M_(Automatically hide application when it's started.) }, + + { NoAppIcon, { .no_appicon = 1 }, M_(No application icon), + M_(Disable the application icon for the application.\n +Note that you won't be able to dock it anymore,\n +and any icons that are already docked will stop\n +working correctly.) }, + + { SharedAppIcon, { .shared_appicon = 1 }, M_(Shared application icon), + M_(Use a single shared application icon for all of\n +the instances of this application.\n) } }; typedef struct InspectorPanel { @@ -207,7 +221,7 @@ typedef struct InspectorPanel { /* 5th page. application wide attributes */ WMFrame *appFrm; - WMButton *appChk[3]; + WMButton *appChk[sizeof(application_attr) / sizeof(application_attr[0])]; unsigned int done:1; unsigned int destroyed:1; @@ -225,15 +239,13 @@ static InspectorPanel *panelList = NULL; */ static WMPropList *pl_attribute[sizeof(window_attribute) / sizeof(window_attribute[0])] = { [0] = NULL }; static WMPropList *pl_advoptions[sizeof(advanced_option) / sizeof(advanced_option[0])]; +static WMPropList *pl_appattrib[sizeof(application_attr) / sizeof(application_attr[0])]; -static WMPropList *ANoAppIcon; static WMPropList *AAlwaysUserIcon; -static WMPropList *ASharedAppIcon; static WMPropList *AStartWorkspace; static WMPropList *AIcon; /* application wide options */ -static WMPropList *AStartHidden; static WMPropList *AnyWindow; static WMPropList *EmptyString; static WMPropList *Yes, *No; @@ -311,11 +323,11 @@ static void make_keys(void) for (i = 0; i wlengthof(advanced_option); i++) pl_advoptions[i] = WMCreatePLString(advanced_option[i].key_name); + for (i = 0; i wlengthof(application_attr); i++) + pl_appattrib[i] = WMCreatePLString(application_attr[i].key_name); + AIcon = WMCreatePLString(Icon); - ANoAppIcon = WMCreatePLString(NoAppIcon); AAlwaysUserIcon = WMCreatePLString(AlwaysUserIcon); - AStartHidden = WMCreatePLString(StartHidden); - ASharedAppIcon = WMCreatePLString(SharedAppIcon); AStartWorkspace = WMCreatePLString(StartWorkspace); @@ -640,15 +652,12 @@ static void saveSettings(WMWidget *button, void *client_data) different |= insertAttribute(dict, winDic, pl_advoptions[i], value, flags); } + /* Attributes... -- Application Specific */ if (wwin-main_window != None wApplicationOf(wwin-main_window) != NULL) { - value = (WMGetButtonSelected(panel-appChk[0]) != 0) ? Yes : No; - different2 |= insertAttribute(dict, appDic, AStartHidden, value, flags); - - value = (WMGetButtonSelected(panel-appChk[1]) != 0) ? Yes : No; - different2 |= insertAttribute(dict, appDic, ANoAppIcon, value, flags); - - value = (WMGetButtonSelected(panel-appChk[2]) != 0) ? Yes : No; - different2 |= insertAttribute(dict, appDic, ASharedAppIcon, value, flags); + for (i = 0; i wlengthof(application_attr); i++) { + value = (WMGetButtonSelected(panel-appChk[i]) != 0) ? Yes : No; + different2 |= insertAttribute(dict, appDic, pl_appattrib[i], value, flags); + } } if (wwin-fake_group) { @@ -780,9 +789,14 @@ static void applySettings(WMWidget *button, void *client_data) /* Can't apply emulate_appicon because it will probably cause problems. */ if (wapp) { /* do application wide stuff */ - WSETUFLAG(wapp-main_window_desc, start_hidden, WMGetButtonSelected(panel-appChk[0])); - WSETUFLAG(wapp-main_window_desc, no_appicon, WMGetButtonSelected(panel-appChk[1])); - WSETUFLAG(wapp-main_window_desc, shared_appicon, WMGetButtonSelected(panel-appChk[2])); + for (i = 0; i wlengthof(application_attr); i
[PATCH 7/9] wmaker: fix clearing of window attribute that was not saved properly
As reported by Nerijus Baliunas, there was a problem when unchecking an attribute in the Window Inspector and saving it. The original code was meant to save an attribute that is being checked by user, but not one that is explicitly unchecked, which means than although it looked ok when using the Apply button, it was not remembered when restarting the application. In continuation to the clean-up started in the previous patches, this one is updating the Window Inspector to display 2 check-boxes, one read-only on the left, displaying the state requested by the application, and a second one which makes use of the new Tri-State button in WINGs to let the user specify if he wants to force-on, force-off, or leave as-is the attribute. The saving to the property list is then updated to take into account this new 3-state when saving to the file, so relaunching the application will remember correctly the user choice. Reported-by: Nerijus Baliunas neri...@users.sourceforge.net Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- src/winspector.c | 61 +++- 1 file changed, 52 insertions(+), 9 deletions(-) diff --git a/src/winspector.c b/src/winspector.c index 9666363..0735caf 100644 --- a/src/winspector.c +++ b/src/winspector.c @@ -203,6 +203,7 @@ typedef struct InspectorPanel { /* second page. attributes */ WMFrame *attrFrm; + WMButton *attrClient[sizeof(window_attribute) / sizeof(window_attribute[0])]; WMButton *attrChk[sizeof(window_attribute) / sizeof(window_attribute[0])]; /* 3rd page. more attributes */ @@ -642,8 +643,27 @@ static void saveSettings(WMWidget *button, void *client_data) /* Attributes... -- Window Attributes */ for (i = 0; i wlengthof(window_attribute); i++) { - value = (WMGetButtonSelected(panel-attrChk[i]) != 0) ? Yes : No; - different |= insertAttribute(dict, winDic, pl_attribute[i], value, flags); + WMPropList *old_value; + int state; + + old_value = WMGetFromPLDictionary(winDic, pl_attribute[i]); + state = WMGetButtonSelected(panel-attrChk[i]); + if (state 0) { + if ((old_value == NULL) || !getBool(old_value)) { + WMPutInPLDictionary(winDic, pl_attribute[i], Yes); + different |= 1; + } + } else if (state == 0) { + if ((old_value == NULL) || getBool(old_value)) { + WMPutInPLDictionary(winDic, pl_attribute[i], No); + different |= 1; + } + } else {/* (state 0) */ + if (old_value != NULL) { + WMRemoveFromPLDictionary(winDic, pl_attribute[i]); + different |= 1; + } + } } /* Attributes... -- Advanced Options */ @@ -726,12 +746,19 @@ static void applySettings(WMWidget *button, void *client_data) /* Attributes... -- Window Attributes */ for (i = 0; i wlengthof(window_attribute); i++) { - if (WMGetButtonSelected(panel-attrChk[i])) + int state; + + state = WMGetButtonSelected(panel-attrChk[i]); + + if (state 0) set_attr_flag(wwin-user_flags, window_attribute[i].flag); else clear_attr_flag(wwin-user_flags, window_attribute[i].flag); - set_attr_flag(wwin-defined_user_flags, window_attribute[i].flag); + if (state 0) + clear_attr_flag(wwin-defined_user_flags, window_attribute[i].flag); + else + set_attr_flag(wwin-defined_user_flags, window_attribute[i].flag); } /* Attributes... -- Advanced Options */ @@ -904,7 +931,7 @@ static void revertSettings(WMWidget *button, void *client_data) if (is_userdef) flag = get_attr_flag(wwin-user_flags, window_attribute[i].flag); else - flag = get_attr_flag(wwin-client_flags, window_attribute[i].flag); + flag = -1; WMSetButtonSelected(panel-attrChk[i], flag); } @@ -1315,15 +1342,31 @@ static void create_tab_window_attributes(WWindow *wwin, InspectorPanel *panel, i for (i = 0; i wlengthof(window_attribute); i++) { int is_userdef, flag; + /* Read-only button to display the state requested by the application */ + flag = get_attr_flag(wwin-client_flags, window_attribute[i].flag); + + panel-attrClient[i] = WMCreateSwitchButton(panel-attrFrm); + WMMoveWidget(panel-attrClient[i], 10, 20 * (i + 1
[PATCH 8/9] doc: describe the GNOME application issue in the FAQ
Now that Window Maker have been fixed to allow the user to properly control and save the title bar/resize bar/other decoration settings on the window, describe the problem reported (first) by Nerijus Baliunas, so more people may find the answer. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- FAQ | 20 +++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/FAQ b/FAQ index 985e861..c458080 100644 --- a/FAQ +++ b/FAQ @@ -60,6 +60,7 @@ Summary of Contents: fonts. 3.10 When I set the root background with wmsetbg by hand it works, but when I do that from the configuration files it doesn't! + 3.11 When I run GNOME application they have no title bar. 4 - Configuration 4.1 What are those files inside my ~/GNUstep directory? @@ -345,7 +346,10 @@ The same is true for CDE. Now, answering the question: Yes, you can use WindowMaker in these environments. To use Window Maker with GNOME, you don't need to do -anything special. To use it with CDE, read the answer for How do I switch +anything special, although you may want to look at the When I run +GNOME application they have no title bar below. + +To use it with CDE, read the answer for How do I switch CDE's window manager to use Window Maker? To use it with KDE, read it's documentation to get rid of kwm (and possibly @@ -724,6 +728,20 @@ These directories will be listed under the Search Path section of WPrefs. +3.11 When I run GNOME application they have no title bar. +-- + +The GNOME toolkit decided to behave his own way, so it draws its own title bar +with buttons, and asks Window Maker to not draw anything (title bar, resize bar, +close and miniaturise button, ...). + +The workaround is, for each application, to ask for Window Maker's window menu +(that is likely Ctrl+Escape if you did not change it), get the Attributes, +and click on the greyed Disable titlebar until it is white (the same can be +done for other decoration attributes). + + + -=-=-=-=-=-=-=- Configuration: -=-=-=-=-=-=-=- -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 9/9] Add a configuration option to ignore Decoration Hints from GTK-based application
As reported by Nerijus Baliunas and Paul Jakma, the GNOME application, which use the GTK toolkit, are asking to have no window decoration. This can be solved by editing the window's attributes in Window Maker, but this can be tedious when there are many GNOME application used. This patch adds a configuration option: Window Maker tries to detect for GTK-based windows and in this case ignore the decoration hints that were provided by the application. Suggested-by: Paul Jakma p...@jakma.org Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- FAQ | 5 + NEWS| 10 ++ WPrefs.app/Expert.c | 3 +++ src/WindowMaker.h | 6 ++ src/defaults.c | 2 ++ src/startup.c | 6 +- src/window.c| 28 7 files changed, 59 insertions(+), 1 deletion(-) diff --git a/FAQ b/FAQ index c458080..79ac476 100644 --- a/FAQ +++ b/FAQ @@ -740,6 +740,11 @@ The workaround is, for each application, to ask for Window Maker's window menu and click on the greyed Disable titlebar until it is white (the same can be done for other decoration attributes). +If you use a lot of GNOME applications, you may want to ask Window Maker to just +ignore the no-titlebar-and-all for all windows at once, which is done from +WPrefs by going to the Expert panel and checking the Ignore decoration hints +for GTK applications button. + -=-=-=-=-=-=-=- diff --git a/NEWS b/NEWS index 172c970..6561c4e 100644 --- a/NEWS +++ b/NEWS @@ -56,6 +56,16 @@ Mini-Preview name. The setting is configurable with WPrefs in the Icon Preferences tab, the size is now expressed in pixels directly. +Ignore Decoration Hints from GNOME applications +--- + +The GNOME applications ask Window Maker to get no title bar and no resize bar to +their windows by using Hints. You can re-add them using the Attribute dialog +in the Window menu, but if you are using many GNOME applications you may want to +tell Window Maker to just ignore them. This is done with the new setting called +IgnoreGtkHints, which is available in the Expert panel in WPrefs. + + --- 0.95.6 More image format supported diff --git a/WPrefs.app/Expert.c b/WPrefs.app/Expert.c index 7268002..6db1dfa 100644 --- a/WPrefs.app/Expert.c +++ b/WPrefs.app/Expert.c @@ -43,6 +43,9 @@ static const struct { { N_(Disable miniwindows (icons for minimized windows). For use with KDE/GNOME.), /* default: */ False, OPTION_WMAKER, DisableMiniwindows }, + { N_(Ignore decoration hints for GTK applications.), + /* default: */ False, OPTION_WMAKER, IgnoreGtkHints }, + { N_(Disable workspace pager.), /* default: */ False, OPTION_WMAKER, DisableWorkspacePager }, diff --git a/src/WindowMaker.h b/src/WindowMaker.h index ccdb6c8..3c2869c 100644 --- a/src/WindowMaker.h +++ b/src/WindowMaker.h @@ -394,6 +394,7 @@ extern struct WPreferences { char dont_confirm_kill;/* do not confirm Kill application */ char disable_miniwindows; char disable_workspace_pager; + char ignore_gtk_decoration_hints; char dont_blink; /* do not blink icon selection */ @@ -558,6 +559,11 @@ extern struct wmaker_global_variables { Atom titlebar_state; } gnustep; + /* Destkop-environment related */ + struct { + Atom gtk_object_path; + } desktop; + /* WindowMaker specific */ struct { Atom menu; diff --git a/src/defaults.c b/src/defaults.c index b6e855c..70fbeb5 100644 --- a/src/defaults.c +++ b/src/defaults.c @@ -518,6 +518,8 @@ WDefaultEntry optionList[] = { wPreferences.panel_only_open, getBool, NULL, NULL, NULL}, {MiniPreviewSize, 128, NULL, wPreferences.minipreview_size, getInt, NULL, NULL, NULL}, + {IgnoreGtkHints, NO, NULL, + wPreferences.ignore_gtk_decoration_hints, getBool, NULL, NULL, NULL}, /* * Backward Compatibility: diff --git a/src/startup.c b/src/startup.c index 5f43cfd..8e633b8 100644 --- a/src/startup.c +++ b/src/startup.c @@ -394,6 +394,8 @@ static char *atomNames[] = { GNUSTEP_WM_MINIATURIZE_WINDOW, GNUSTEP_TITLEBAR_STATE, + _GTK_APPLICATION_OBJECT_PATH, + WM_IGNORE_FOCUS_EVENTS }; @@ -467,7 +469,9 @@ void StartUp(Bool defaultScreenOnly) w_global.atom.gnustep.wm_miniaturize_window = atom[18]; w_global.atom.gnustep.titlebar_state = atom[19]; - w_global.atom.wm.ignore_focus_events = atom[20]; + w_global.atom.desktop.gtk_object_path = atom[20]; + + w_global.atom.wm.ignore_focus_events = atom[21]; #ifdef USE_DOCK_XDND wXDNDInitializeAtoms(); diff --git a/src/window.c b/src/window.c index b1cbd30..532670c 100644 --- a/src/window.c +++ b/src/window.c @@ -288,6 +288,31
[PATCH 07/13] wmaker: reorganisation of the control flow of the function 'findDock'
Changed the code to return as soon as the result is known because it makes the code simpler to understand, which is good for maintainability. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- src/dock.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/dock.c b/src/dock.c index e985152..e72c0c8 100644 --- a/src/dock.c +++ b/src/dock.c @@ -2042,29 +2042,29 @@ static WDock *findDock(WScreen *scr, XEvent *event, int *icon_pos) WDock *dock; int i; - *icon_pos = -1; - dock = scr-dock; if (dock != NULL) { for (i = 0; i dock-max_icons; i++) { - if (dock-icon_array[i] -dock-icon_array[i]-icon-core-window == event-xclient.window) { + if (dock-icon_array[i] + dock-icon_array[i]-icon-core-window == event-xclient.window) { *icon_pos = i; - break; + return dock; } } } - if (*icon_pos 0 (dock = scr-workspaces[scr-current_workspace]-clip) != NULL) { + + dock = scr-workspaces[scr-current_workspace]-clip; + if (dock != NULL) { for (i = 0; i dock-max_icons; i++) { - if (dock-icon_array[i] -dock-icon_array[i]-icon-core-window == event-xclient.window) { + if (dock-icon_array[i] + dock-icon_array[i]-icon-core-window == event-xclient.window) { *icon_pos = i; - break; + return dock; } } } - if (*icon_pos = 0) - return dock; + + *icon_pos = -1; return NULL; } -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 10/13] wmaker: removed dead code related to 'GLOBAL_SUBMENU_FILE'
From: Rodolfo García Peñas (kix) k...@kix.es There was the possibility to include a global sub-menu to the root menu using a dedicated file, but this does not look like it is really useful as this root menu is already defined by a user file, and the root menu is already specific enough that it does not need anything more 'global'. Furthermore, the variable enabling this feature (GLOBAL_SUBMENU_FILE) is not defined anywhere (neither from configure, nor in wconfig.h, ...) and is also not documented at all. Considering it was introduced a very long time ago (1999!) and was not touched anymore, this patch removes the dead code associated with it. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- src/rootmenu.c | 31 +++ 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/src/rootmenu.c b/src/rootmenu.c index 8c0f0c6..499815f 100644 --- a/src/rootmenu.c +++ b/src/rootmenu.c @@ -66,7 +66,7 @@ static WMenu *readMenuPipe(WScreen * scr, char **file_name); static WMenu *readPLMenuPipe(WScreen * scr, char **file_name); static WMenu *readMenuFile(WScreen *scr, const char *file_name); static WMenu *readMenuDirectory(WScreen *scr, const char *title, char **file_name, const char *command); -static WMenu *configureMenu(WScreen * scr, WMPropList * definition, Bool includeGlobals); +static WMenu *configureMenu(WScreen *scr, WMPropList *definition); static void menu_parser_register_macros(WMenuParser parser); typedef struct Shortcut { @@ -602,7 +602,7 @@ static WMenu *constructPLMenu(WScreen *screen, const char *path) if (!pl) return NULL; - menu = configureMenu(screen, pl, False); + menu = configureMenu(screen, pl); WMReleasePropList(pl); @@ -1147,7 +1147,7 @@ static WMenu *readPLMenuPipe(WScreen * scr, char **file_name) if (!plist) return NULL; - menu = configureMenu(scr, plist, False); + menu = configureMenu(scr, plist); WMReleasePropList(plist); @@ -1462,7 +1462,7 @@ static WMenu *makeDefaultMenu(WScreen * scr) * *-- */ -static WMenu *configureMenu(WScreen * scr, WMPropList * definition, Bool includeGlobals) +static WMenu *configureMenu(WScreen *scr, WMPropList *definition) { WMenu *menu = NULL; WMPropList *elem; @@ -1540,23 +1540,6 @@ static WMenu *configureMenu(WScreen * scr, WMPropList * definition, Bool include menu = wMenuCreate(scr, M_(mtitle), False); menu-on_destroy = removeShortcutsForMenu; -#ifdef GLOBAL_SUBMENU_FILE - if (includeGlobals) { - WMenu *submenu; - WMenuEntry *mentry; - - submenu = readMenuFile(scr, GLOBAL_SUBMENU_FILE); - - if (submenu) { - mentry = wMenuAddCallback(menu, submenu-frame-title, NULL, NULL); - wMenuEntrySetCascade(menu, mentry, submenu); - } - } -#else - /* Parameter not used, but tell the compiler that it is ok */ - (void) includeGlobals; -#endif - for (i = 1; i count; i++) { elem = WMGetFromPLArray(definition, i); #if 0 @@ -1575,7 +1558,7 @@ static WMenu *configureMenu(WScreen * scr, WMPropList * definition, Bool include WMenuEntry *mentry; /* submenu */ - submenu = configureMenu(scr, elem, True); + submenu = configureMenu(scr, elem); if (submenu) { mentry = wMenuAddCallback(menu, submenu-frame-title, NULL, NULL); wMenuEntrySetCascade(menu, mentry, submenu); @@ -1670,14 +1653,14 @@ void OpenRootMenu(WScreen * scr, int x, int y, int keyboard) if (definition) { if (WMIsPLArray(definition)) { if (!scr-root_menu || w_global.domain.root_menu-timestamp scr-root_menu-timestamp) { - menu = configureMenu(scr, definition, True); + menu = configureMenu(scr, definition); if (menu) menu-timestamp = w_global.domain.root_menu-timestamp; } else menu = NULL; } else { - menu = configureMenu(scr, definition, True); + menu = configureMenu(scr, definition); } } -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 10/13] wmaker: removed dead code related to 'GLOBAL_SUBMENU_FILE'
From: Rodolfo García Peñas (kix) k...@kix.es There was the possibility to include a global sub-menu to the root menu using a dedicated file, but this does not look like it is really useful as this root menu is already defined by a user file, and the root menu is already specific enough that it does not need anything more 'global'. Furthermore, the variable enabling this feature (GLOBAL_SUBMENU_FILE) is not defined anywhere (neither from configure, nor in wconfig.h, ...) and is also not documented at all. Considering it was introduced a very long time ago (1999!) and was not touched anymore, this patch removes the dead code associated with it. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- src/rootmenu.c | 31 +++ 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/src/rootmenu.c b/src/rootmenu.c index 8c0f0c6..499815f 100644 --- a/src/rootmenu.c +++ b/src/rootmenu.c @@ -66,7 +66,7 @@ static WMenu *readMenuPipe(WScreen * scr, char **file_name); static WMenu *readPLMenuPipe(WScreen * scr, char **file_name); static WMenu *readMenuFile(WScreen *scr, const char *file_name); static WMenu *readMenuDirectory(WScreen *scr, const char *title, char **file_name, const char *command); -static WMenu *configureMenu(WScreen * scr, WMPropList * definition, Bool includeGlobals); +static WMenu *configureMenu(WScreen *scr, WMPropList *definition); static void menu_parser_register_macros(WMenuParser parser); typedef struct Shortcut { @@ -602,7 +602,7 @@ static WMenu *constructPLMenu(WScreen *screen, const char *path) if (!pl) return NULL; - menu = configureMenu(screen, pl, False); + menu = configureMenu(screen, pl); WMReleasePropList(pl); @@ -1147,7 +1147,7 @@ static WMenu *readPLMenuPipe(WScreen * scr, char **file_name) if (!plist) return NULL; - menu = configureMenu(scr, plist, False); + menu = configureMenu(scr, plist); WMReleasePropList(plist); @@ -1462,7 +1462,7 @@ static WMenu *makeDefaultMenu(WScreen * scr) * *-- */ -static WMenu *configureMenu(WScreen * scr, WMPropList * definition, Bool includeGlobals) +static WMenu *configureMenu(WScreen *scr, WMPropList *definition) { WMenu *menu = NULL; WMPropList *elem; @@ -1540,23 +1540,6 @@ static WMenu *configureMenu(WScreen * scr, WMPropList * definition, Bool include menu = wMenuCreate(scr, M_(mtitle), False); menu-on_destroy = removeShortcutsForMenu; -#ifdef GLOBAL_SUBMENU_FILE - if (includeGlobals) { - WMenu *submenu; - WMenuEntry *mentry; - - submenu = readMenuFile(scr, GLOBAL_SUBMENU_FILE); - - if (submenu) { - mentry = wMenuAddCallback(menu, submenu-frame-title, NULL, NULL); - wMenuEntrySetCascade(menu, mentry, submenu); - } - } -#else - /* Parameter not used, but tell the compiler that it is ok */ - (void) includeGlobals; -#endif - for (i = 1; i count; i++) { elem = WMGetFromPLArray(definition, i); #if 0 @@ -1575,7 +1558,7 @@ static WMenu *configureMenu(WScreen * scr, WMPropList * definition, Bool include WMenuEntry *mentry; /* submenu */ - submenu = configureMenu(scr, elem, True); + submenu = configureMenu(scr, elem); if (submenu) { mentry = wMenuAddCallback(menu, submenu-frame-title, NULL, NULL); wMenuEntrySetCascade(menu, mentry, submenu); @@ -1670,14 +1653,14 @@ void OpenRootMenu(WScreen * scr, int x, int y, int keyboard) if (definition) { if (WMIsPLArray(definition)) { if (!scr-root_menu || w_global.domain.root_menu-timestamp scr-root_menu-timestamp) { - menu = configureMenu(scr, definition, True); + menu = configureMenu(scr, definition); if (menu) menu-timestamp = w_global.domain.root_menu-timestamp; } else menu = NULL; } else { - menu = configureMenu(scr, definition, True); + menu = configureMenu(scr, definition); } } -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 04/13] configure: Added option to disable animations
The old behaviour was to expect the user to go modify manually a source file which is not a great idea because that's typically the kind of things in charge of the configure script. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- README | 3 ++- configure.ac | 12 doc/build/Compilation.texi | 4 src/wconfig.h.in | 3 --- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/README b/README index e85083b..7195e5f 100644 --- a/README +++ b/README @@ -201,7 +201,8 @@ while keeping a nice appearance and good functionality, follow the items bellow: - edit wconfig.h and disable the NUMLOCK_HACK and the features you don't use anyway (keep in mind that some of the #defines might not work, as they are not fully supported). Make sure to always keep NumLock and ScrollLock turned off. -- turn on DisableAnimations. You can also #undefine ANIMATIONS in wconfig.h +- turn on DisableAnimations. You can also specify --disable-animation at compile + time to the configure script. - strip down the default IconPath and PixmapPath entries to contain only the paths that you really have in your system. - do not use large images in the root background diff --git a/configure.ac b/configure.ac index 6a02376..491bdc7 100644 --- a/configure.ac +++ b/configure.ac @@ -289,6 +289,18 @@ AC_ARG_WITH(incs-from, AS_HELP_STRING([--with-incs-from], [pass compiler flags t dnl Features Configuration dnl == +AC_ARG_ENABLE([animations], +[AS_HELP_STRING([--disable-animations], [disable permanently animations @:@default=enabled@:@])], +[AS_CASE([$enableval], +[yes|no], [], +[AC_MSG_ERROR([bad value $enableval for --enable-animations])])], +[enable_animations=yes]) +AS_IF([test x$enable_animations = xno], +[unsupported=$unsupported Animations], +[AC_DEFINE([USE_ANIMATIONS], [1], [Defined when user did not request to disable animations]) + supported_core=$supported_core Animations]) + + AC_ARG_ENABLE([mwm-hints], [AS_HELP_STRING([--disable-mwm-hints], [disable support for Motif WM hints @:@default=enabled@:@])], [AS_CASE([$enableval], diff --git a/doc/build/Compilation.texi b/doc/build/Compilation.texi index 4db3ae0..095718c 100644 --- a/doc/build/Compilation.texi +++ b/doc/build/Compilation.texi @@ -566,6 +566,10 @@ screen size. @subsection Feature Selection @table @option +@item --disable-animations +Disable animations permanently, by not compiling the corresponding code into @sc{Window Maker}. +When enabled (the default), you still have a run-time configuration option in @emph{WPrefs}. + @item --disable-mwm-hints Disable support for Motif's MWM Window Manager hints. These attributes were introduced by the Motif toolkit to ask for special window appearance requests. diff --git a/src/wconfig.h.in b/src/wconfig.h.in index be0295c..bac5072 100644 --- a/src/wconfig.h.in +++ b/src/wconfig.h.in @@ -33,9 +33,6 @@ * Also check the features you can enable through configure. */ -/* If you want animations for iconification, shading, icon arrangement etc. */ -#define USE_ANIMATIONS - /* * Undefine BALLOON_TEXT if you don't want balloons for showing extra * information, like window titles that are not fully visible. -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 08/13] wmaker: remove one level of pointers for the function SlideWindows
The function does not need to be passed a array of pointer to windows because it does not change content of the pointers. It is more efficient to directly use an array of windows as the parameter, and simpler also. As 'SlideWindow' is also concerned, it can be simplified and turned into an inlinable function so the compiler can optimise it. Took opportunity to de-CamelCase the name of the functions to comply with the project's coding style. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- src/actions.c | 2 +- src/appicon.c | 6 +++--- src/dock.c| 14 +++--- src/misc.c| 14 -- src/misc.h| 8 ++-- src/wsmap.c | 8 6 files changed, 25 insertions(+), 27 deletions(-) diff --git a/src/actions.c b/src/actions.c index 2349978..299bc78 100644 --- a/src/actions.c +++ b/src/actions.c @@ -1843,7 +1843,7 @@ void wArrangeIcons(WScreen *scr, Bool arrangeAll) if (aicon-x_pos != X || aicon-y_pos != Y) { #ifdef USE_ANIMATIONS if (!wPreferences.no_animations) - SlideWindow(aicon-icon-core-window, aicon-x_pos, aicon-y_pos, X, Y); + slide_window(aicon-icon-core-window, aicon-x_pos, aicon-y_pos, X, Y); #endif /* USE_ANIMATIONS */ } wAppIconMove(aicon, X, Y); diff --git a/src/appicon.c b/src/appicon.c index 14dba97..302066d 100644 --- a/src/appicon.c +++ b/src/appicon.c @@ -967,7 +967,7 @@ Bool wHandleAppIconMove(WAppIcon *aicon, XEvent *event) Bool docked = False; if (ondock) { - SlideWindow(icon-core-window, x, y, shad_x, shad_y); + slide_window(icon-core-window, x, y, shad_x, shad_y); XUnmapWindow(dpy, scr-dock_shadow); if (originalDock == NULL) { // docking an undocked appicon docked = wDockAttachIcon(lastDock, aicon, ix, iy, False); @@ -980,7 +980,7 @@ Bool wHandleAppIconMove(WAppIcon *aicon, XEvent *event) // Also fill the gap left in the drawer wDrawerFillTheGap(lastDock, aicon, False); } - SlideWindow(icon-core-window, x, y, oldX, oldY); + slide_window(icon-core-window, x, y, oldX, oldY); } } else { // moving a docked appicon to a dock @@ -1016,7 +1016,7 @@ Bool wHandleAppIconMove(WAppIcon *aicon, XEvent *event) // Trust the appicon is inserted at exactly the same place, so its oldX/oldY are consistent with its new location? } - SlideWindow(icon-core-window, x, y, oldX, oldY); + slide_window(icon-core-window, x, y, oldX, oldY); wDockReattachIcon(originalDock, aicon, aicon-xindex, aicon-yindex); } else { diff --git a/src/dock.c b/src/dock.c index e72c0c8..2f325e9 100644 --- a/src/dock.c +++ b/src/dock.c @@ -3271,7 +3271,7 @@ void wDockTrackWindowLaunch(WDock *dock, Window window) XMapWindow(dpy, aicon-icon-core-window); aicon-launching = 1; wAppIconPaint(aicon); - SlideWindow(aicon-icon-core-window, x0, y0, icon-x_pos, icon-y_pos); + slide_window(aicon-icon-core-window, x0, y0, icon-x_pos, icon-y_pos); XUnmapWindow(dpy, aicon-icon-core-window); wAppIconDestroy(aicon); } @@ -3834,15 +3834,15 @@ static void handleDockMove(WDock *dock, WAppIcon *aicon, XEvent *event) break; XUngrabPointer(dpy, CurrentTime); if (dock-type == WM_DRAWER) { - Window *wins[dock-icon_count]; + Window wins[dock-icon_count]; for (i = 0; i dock-max_icons; i++) { tmpaicon = dock-icon_array[i]; if (tmpaicon == NULL) continue; - wins[ tmpaicon-xindex + (dock-on_right_side ? dock
[PATCH 02/13] wmaker: fix incorrect type for variable in the global preference structure
As pointed by the new check script, the preference show_clip_title is defined as a Boolean value in the preference loading function, which uses the callback function getBool, which expect a variable of type char, but the variable was not defined with that type. This patch changes the type for the appropriate one to avoid possible problems. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- src/WindowMaker.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/WindowMaker.h b/src/WindowMaker.h index 0a1d81f..ccdb6c8 100644 --- a/src/WindowMaker.h +++ b/src/WindowMaker.h @@ -459,7 +459,7 @@ extern struct WPreferences { union WTexture *wsmbackTexture; - int show_clip_title; + char show_clip_title; struct { unsigned int nodock:1;/* don't display the dock */ -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 09/13] wmaker: do not use strcmp twice on the same thing, in function appiconBalloon
It is not really efficient to call it twice because the strings will not change, and by using the appropriate trick it can make the code smaller, with less redundancy, so less prone to bugs and easier to maintain. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- src/balloon.c | 27 ++- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/balloon.c b/src/balloon.c index 871bcd2..1e05ca7 100644 --- a/src/balloon.c +++ b/src/balloon.c @@ -522,6 +522,7 @@ static void appiconBalloon(WObjDescriptor *object) int len; WApplication *app; unsigned int app_win_cnt = 0; + const char *display_name; if (object-parent_type == WCLASS_DOCK_ICON) { if (aicon-main_window) { @@ -531,28 +532,28 @@ static void appiconBalloon(WObjDescriptor *object) } } - /* Check to see if it is a GNUstep app */ + /* +* Check to see if it is a GNUstep app, because in this case we use the instance +* instead of the class, otherwise the user will not be able to distinguish what +* is being refered. +*/ if (strcmp(aicon-wm_class, GNUstep) == 0) - len = strlen(aicon-command) + strlen(aicon-wm_instance) + 8; + display_name = aicon-wm_instance; else - len = strlen(aicon-command) + strlen(aicon-wm_class) + 8; + display_name = aicon-wm_class; + + len = strlen(aicon-command) + strlen(display_name) + 8; if (app_win_cnt 0) len += 1 + snprintf(NULL, 0, %u, app_win_cnt); tmp = wmalloc(len); - /* Check to see if it is a GNUstep App */ - if (strcmp(aicon-wm_class, GNUstep) == 0) - if (app_win_cnt 0) - snprintf(tmp, len, %u %s\n(%s), app_win_cnt, aicon-wm_instance, aicon-command); - else - snprintf(tmp, len, %s\n(%s), aicon-wm_instance, aicon-command); + if (app_win_cnt 0) + snprintf(tmp, len, %u %s\n(%s), app_win_cnt, display_name, aicon-command); else - if (app_win_cnt 0) - snprintf(tmp, len, %u %s\n(%s), app_win_cnt, aicon-wm_class, aicon-command); - else - snprintf(tmp, len, %s\n(%s), aicon-wm_class, aicon-command); + snprintf(tmp, len, %s\n(%s), aicon-wm_instance, aicon-command); scr-balloon-text = tmp; + } else if (aicon-command) { scr-balloon-text = wstrdup(aicon-command); } else if (aicon-wm_class) { -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 06/13] wmaker: took as much assignation as possible outside 'if' statements
It is generally considered bad practice to place an assignation inside the expression for an if statement because it is often a source of bug, because of possible typos and because it makes reviewing code more complicated. This patch fixes as much cases as possible to make the code easier to read. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- src/appmenu.c | 3 ++- src/dialog.c | 9 ++--- src/dock.c| 30 +- src/event.c | 6 -- src/monitor.c | 3 ++- src/osdep_bsd.c | 9 ++--- src/osdep_linux.c | 6 -- src/screen.c | 21 +++-- src/session.c | 26 ++ src/wdefaults.c | 6 -- src/winspector.c | 6 -- src/workspace.c | 10 ++ 12 files changed, 88 insertions(+), 47 deletions(-) diff --git a/src/appmenu.c b/src/appmenu.c index 3a08e62..bc70896 100644 --- a/src/appmenu.c +++ b/src/appmenu.c @@ -139,7 +139,8 @@ static WMenu *parseMenuCommand(WScreen * scr, Window win, char **slist, int coun } wstrlcpy(title, slist[*index][pos], sizeof(title)); } - if (!(data = malloc(sizeof(WAppMenuData { + data = malloc(sizeof(WAppMenuData)); + if (data == NULL) { wwarning(_(appmenu: out of memory creating menu for window %lx), win); wMenuDestroy(menu, True); return NULL; diff --git a/src/dialog.c b/src/dialog.c index 56cd3db..cb444ee 100644 --- a/src/dialog.c +++ b/src/dialog.c @@ -262,7 +262,8 @@ ScanFiles(const char *dir, const char *prefix, unsigned acceptmask, unsigned dec char *fullfilename, *suffix; prefixlen = strlen(prefix); - if ((d = opendir(dir)) != NULL) { + d = opendir(dir); + if (d != NULL) { while ((de = readdir(d)) != NULL) { if (strlen(de-d_name) prefixlen !strncmp(prefix, de-d_name, prefixlen) @@ -298,12 +299,14 @@ static WMArray *GenerateVariants(const char *complete) while (*complete == ' ') ++complete; - if ((pos = strrchr(complete, ' ')) != NULL) { + pos = strrchr(complete, ' '); + if (pos != NULL) { complete = pos + 1; firstWord = False; } - if ((pos = strrchr(complete, '/')) != NULL) { + pos = strrchr(complete, '/'); + if (pos != NULL) { tmp = wstrndup((char *)complete, pos - complete + 1); if (*tmp == '~' *(tmp + 1) == '/' getenv(HOME)) { dir = wstrdup(getenv(HOME)); diff --git a/src/dock.c b/src/dock.c index d4aca09..e985152 100644 --- a/src/dock.c +++ b/src/dock.c @@ -1530,7 +1530,8 @@ static WMPropList *dockSaveState(WDock *dock) if (!btn || btn-attracted) continue; - if ((icon_info = make_icon_state(dock-icon_array[i]))) { + icon_info = make_icon_state(dock-icon_array[i]); + if (icon_info != NULL) { WMAddToPLArray(list, icon_info); WMReleasePropList(icon_info); } @@ -2042,7 +2043,9 @@ static WDock *findDock(WScreen *scr, XEvent *event, int *icon_pos) int i; *icon_pos = -1; - if ((dock = scr-dock) != NULL) { + + dock = scr-dock; + if (dock != NULL) { for (i = 0; i dock-max_icons; i++) { if (dock-icon_array[i] dock-icon_array[i]-icon-core-window == event-xclient.window) { @@ -2669,7 +2672,8 @@ Bool wDockSnapIcon(WDock *dock, WAppIcon *icon, int req_x, int req_y, int *ret_x * it wants to be (ex_x) and slide them. */ j = 0; for (i = 1; i dock-max_icons; i++) { - if ((aicon = dock-icon_array[ i ]) aicon != icon + aicon = dock-icon_array[i]; + if ((aicon != NULL) (aicon != icon) ((ex_x = aicon-xindex aicon-xindex index_of_hole) || (index_of_hole aicon-xindex aicon-xindex = ex_x))) aicons_to_shift[ j++ ] = aicon; @@ -3048,7 +3052,8 @@ static pid_t execCommand(WAppIcon *btn, const char *command, WSavedState *state) return 0; } - if ((pid = fork()) == 0) { + pid = fork(); + if (pid == 0) { char **args; int i; @@ -3752,7 +3757,9 @@ static void handleDockMove(WDock *dock, WAppIcon *aicon, XEvent *event) { for (i = 0; i dock-max_icons; i++) { int new_y
[PATCH 01/13] wmaker: add script to check the call-back function used when loading configuration
Because the C compiler cannot check the consistency between the type of the variable being pointed to, and the type expected by the call-back function that is used to parse and store the value from the configuration file, there is a risk of mismatch that can cause Window Maker to misbehave due to data corruption, which depends strongly on the configuration values and the architecture on which Window Maker is running. This patch introduces a script that checks the consistency where possible, to raise the issues when performing make check. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- Makefile.am | 1 + script/check-wmaker-loaddef-callbacks.sh | 470 +++ src/Makefile.am | 29 ++ 3 files changed, 500 insertions(+) create mode 100755 script/check-wmaker-loaddef-callbacks.sh diff --git a/Makefile.am b/Makefile.am index 5b52d1a..d0b6688 100644 --- a/Makefile.am +++ b/Makefile.am @@ -40,6 +40,7 @@ EXTRA_DIST = TODO BUGS BUGFORM FAQ INSTALL \ email-clients.txt checkpatch.pl update-changelog.pl \ script/check-cmdline-options-doc.sh \ script/check-translation-sources.sh \ + script/check-wmaker-loaddef-callbacks.sh \ script/generate-mapfile-from-header.sh \ script/generate-po-from-template.sh \ script/generate-txt-from-texi.sh \ diff --git a/script/check-wmaker-loaddef-callbacks.sh b/script/check-wmaker-loaddef-callbacks.sh new file mode 100755 index 000..1cc9541 --- /dev/null +++ b/script/check-wmaker-loaddef-callbacks.sh @@ -0,0 +1,470 @@ +#!/bin/sh +### +# +# Window Maker window manager +# +# Copyright (c) 2015 Christophe CURIS +# Copyright (c) 2015 Window Maker Team +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see http://www.gnu.org/licenses/. +# +### +# +# check-wmaker-loaddef-callbacks.sh: +# Compare the type defined in a variable against the type use for the +# associated call-back function. +# +# To load the configuration file, Window Maker is using a list of the known +# keywords in a structure with the name of the keyword, the call-back +# function that converts the string (from file) into the appropriate type, +# and a pointer to the variable where the result is saved. +# +# Because the structure requires a little bit of genericity to be usefull, +# it is not possible to provide the C compiler with the information to +# check that the variable from the pointer has the same type as what the +# conversion call-back assumes, so this script does that check for us. +# +# Unfortunately, the script cannot be completely generic and smart, but +# it still tries to be, despite being made explicitely for the case of the +# structures staticOptionList and optionList from Window Maker's source +# file src/defaults.c +# +### +# +# For portability, we stick to the same sh+awk constraint as Autotools to +# limit problems, see for example: +# http://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Portable-Shell.html +# +### + +# Report an error on stderr and exit with status 2 to tell make that we could +# not do what we were asked +arg_error() { +echo `basename $0`: $@ 2 +exit 2 +} + +# print help and exit with success status +print_help() { +echo $0: check variable type against call-back expectation for WMaker's defaults.c +echo Usage: $0 options... +echo valid options are: +echo --callback \name=type\ : specify that function 'name' expects a variable of 'type' +echo --field-callback idx : index (from 1) of the callback function in the struct +echo --field-value-ptr idx : index (from 1) of the pointer-to-value in the struct +echo --source file : C source file with the array to check +echo --structure name : name of the variable with the array of struct to check +echo --struct-def name=file : specify to get definition of struct 'name' from 'file' +exit 0 +} + +# Extract command line arguments +while [ $# -gt 0 ]; do +case $1 in +--callback) +shift +deflist=$1
[PATCH 05/13] wmaker: fix warnings from compiler when animations are disabled
The code for animating stuff needs some parameters in a few functions, which are not used when animations are disabled at compile time, so the compiler issues some warnings about them. This patch adds the appropriate statements to disable declaration that are not needed in this case, and tell the compiler it is ok to not use the parameters not needed, thus fixing the warnings. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- src/actions.c | 20 ++-- src/misc.c| 4 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/actions.c b/src/actions.c index d69f900..2349978 100644 --- a/src/actions.c +++ b/src/actions.c @@ -57,6 +57,7 @@ static void find_Maximus_geometry(WWindow *wwin, WArea usableArea, int *new_x, i static void save_old_geometry(WWindow *wwin, int directions); /*** Local Variables ***/ +#ifdef USE_ANIMATIONS static struct { int steps; int delay; @@ -68,10 +69,12 @@ static struct { { SHADE_STEPS_US, SHADE_DELAY_US } }; -#define UNSHADE 0 -#define SHADE 1 #define SHADE_STEPSshadePars[(int)wPreferences.shade_speed].steps #define SHADE_DELAYshadePars[(int)wPreferences.shade_speed].delay +#endif + +#define UNSHADE 0 +#define SHADE 1 static int compareTimes(Time t1, Time t2) { @@ -1061,6 +1064,7 @@ static WWindow *recursiveTransientFor(WWindow *wwin) return wwin; } +#ifdef USE_ANIMATIONS static int getAnimationGeometry(WWindow *wwin, int *ix, int *iy, int *iw, int *ih) { if (wwin-screen_ptr-flags.startup || wPreferences.no_animations @@ -1087,6 +1091,7 @@ static int getAnimationGeometry(WWindow *wwin, int *ix, int *iy, int *iw, int *i } return 1; } +#endif /* USE_ANIMATIONS */ void wIconifyWindow(WWindow *wwin) { @@ -1397,6 +1402,11 @@ static void hideWindow(WIcon *icon, int icon_x, int icon_y, WWindow *wwin, int a wwin-frame-core-width, wwin-frame-core-height, icon_x, icon_y, icon-core-width, icon-core-height); } +#else + /* Tell the compiler it is normal that those parameters are not used in this case */ + (void) icon_x; + (void) icon_y; + (void) animate; #endif wwin-flags.skip_next_animation = 0; @@ -1575,6 +1585,12 @@ static void unhideWindow(WIcon *icon, int icon_x, int icon_y, WWindow *wwin, int wwin-frame_x, wwin-frame_y, wwin-frame-core-width, wwin-frame-core-height); } +#else + /* Tell the compiler it is normal that those parameters are not used in this case */ + (void) icon; + (void) icon_x; + (void) icon_y; + (void) animate; #endif wwin-flags.skip_next_animation = 0; if (wwin-screen_ptr-current_workspace == wwin-frame-workspace) { diff --git a/src/misc.c b/src/misc.c index bc324df..4144c7d 100644 --- a/src/misc.c +++ b/src/misc.c @@ -148,6 +148,10 @@ void move_window(Window win, int from_x, int from_y, int to_x, int to_y) SlideWindow(win, from_x, from_y, to_x, to_y); #else XMoveWindow(dpy, win, to_x, to_y); + + /* Tell the compiler it is normal that those parameters are not used in this case */ + (void) from_x; + (void) from_y; #endif } -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 03/13] Code refactoring: replaced macro 'ANIMATIONS' by 'USE_ANIMATIONS' for consistency
The usual way to define a macro in is to name macro with 'USE_xxx' when they are used to enable a feature 'xxx'. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- src/actions.c| 28 ++-- src/misc.c | 2 +- src/wconfig.h.in | 2 +- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/actions.c b/src/actions.c index 1d46b03..d69f900 100644 --- a/src/actions.c +++ b/src/actions.c @@ -82,7 +82,7 @@ static int compareTimes(Time t1, Time t2) return (diff 6) ? 1 : -1; } -#ifdef ANIMATIONS +#ifdef USE_ANIMATIONS static void shade_animate(WWindow *wwin, Bool what); #else static inline void shade_animate(WWindow *wwin, Bool what) @@ -254,7 +254,7 @@ void wShadeWindow(WWindow *wwin) WMPostNotificationName(WMNChangedState, wwin, shade); -#ifdef ANIMATIONS +#ifdef USE_ANIMATIONS if (!wwin-screen_ptr-flags.startup) { /* Catch up with events not processed while animation was running */ ProcessPendingEvents(); @@ -763,7 +763,7 @@ void wUnfullscreenWindow(WWindow *wwin) } } -#ifdef ANIMATIONS +#ifdef USE_ANIMATIONS static void animateResizeFlip(WScreen *scr, int x, int y, int w, int h, int fx, int fy, int fw, int fh, int steps) { #define FRAMES (MINIATURIZE_ANIMATION_FRAMES_F) @@ -974,7 +974,7 @@ void animateResize(WScreen *scr, int x, int y, int w, int h, int fx, int fy, int break; } } -#endif /* ANIMATIONS */ +#endif /* USE_ANIMATIONS */ static void flushExpose(void) { @@ -1174,7 +1174,7 @@ void wIconifyWindow(WWindow *wwin) unmapTransientsFor(wwin); if (present) { -#ifdef ANIMATIONS +#ifdef USE_ANIMATIONS int ix, iy, iw, ih; #endif XUngrabPointer(dpy, CurrentTime); @@ -1189,7 +1189,7 @@ void wIconifyWindow(WWindow *wwin) wClientSetState(wwin, IconicState, wwin-icon-icon_win); flushExpose(); -#ifdef ANIMATIONS +#ifdef USE_ANIMATIONS if (getAnimationGeometry(wwin, ix, iy, iw, ih)) animateResize(wwin-screen_ptr, wwin-frame_x, wwin-frame_y, wwin-frame-core-width, wwin-frame-core-height, ix, iy, iw, ih); @@ -1231,7 +1231,7 @@ void wIconifyWindow(WWindow *wwin) } else if (wPreferences.focus_mode != WKF_CLICK) { wSetFocusTo(wwin-screen_ptr, NULL); } -#ifdef ANIMATIONS +#ifdef USE_ANIMATIONS if (!wwin-screen_ptr-flags.startup) { /* Catch up with events not processed while animation was running */ Window clientwin = wwin-client_win; @@ -1307,7 +1307,7 @@ void wDeiconifyWindow(WWindow *wwin) /* if the window is in another workspace, do it silently */ if (!netwm_hidden) { -#ifdef ANIMATIONS +#ifdef USE_ANIMATIONS int ix, iy, iw, ih; if (getAnimationGeometry(wwin, ix, iy, iw, ih)) animateResize(wwin-screen_ptr, ix, iy, iw, ih, @@ -1340,7 +1340,7 @@ void wDeiconifyWindow(WWindow *wwin) wSetFocusTo(wwin-screen_ptr, wwin); -#ifdef ANIMATIONS +#ifdef USE_ANIMATIONS if (!wwin-screen_ptr-flags.startup) { /* Catch up with events not processed while animation was running */ Window clientwin = wwin-client_win; @@ -1390,7 +1390,7 @@ static void hideWindow(WIcon *icon, int icon_x, int icon_y, WWindow *wwin, int a wClientSetState(wwin, IconicState, icon-icon_win); flushExpose(); -#ifdef ANIMATIONS +#ifdef USE_ANIMATIONS if (!wwin-screen_ptr-flags.startup !wPreferences.no_animations !wwin-flags.skip_next_animation animate) { animateResize(wwin-screen_ptr, wwin-frame_x, wwin-frame_y, @@ -1568,7 +1568,7 @@ static void unhideWindow(WIcon *icon, int icon_x, int icon_y, WWindow *wwin, int wwin-flags.hidden = 0; -#ifdef ANIMATIONS +#ifdef USE_ANIMATIONS if (!wwin-screen_ptr-flags.startup !wPreferences.no_animations animate) { animateResize(wwin-screen_ptr, icon_x, icon_y, icon-core-width, icon-core-height, @@ -1825,10 +1825,10 @@ void wArrangeIcons(WScreen *scr, Bool arrangeAll) head = wGetHeadForWindow(aicon-icon-owner); if (aicon-x_pos != X || aicon-y_pos != Y) { -#ifdef ANIMATIONS +#ifdef USE_ANIMATIONS if (!wPreferences.no_animations) SlideWindow(aicon-icon-core-window, aicon-x_pos, aicon-y_pos, X, Y); -#endif /* ANIMATIONS */ +#endif /* USE_ANIMATIONS */ } wAppIconMove(aicon, X, Y); vars[head].pi++; @@ -1946,7 +1946,7 @@ void wMakeWindowVisible(WWindow
[PATCH 07/13] wmaker: reorganisation of the control flow of the function 'findDock'
Changed the code to return as soon as the result is known because it makes the code simpler to understand, which is good for maintainability. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- src/dock.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/dock.c b/src/dock.c index e985152..e72c0c8 100644 --- a/src/dock.c +++ b/src/dock.c @@ -2042,29 +2042,29 @@ static WDock *findDock(WScreen *scr, XEvent *event, int *icon_pos) WDock *dock; int i; - *icon_pos = -1; - dock = scr-dock; if (dock != NULL) { for (i = 0; i dock-max_icons; i++) { - if (dock-icon_array[i] -dock-icon_array[i]-icon-core-window == event-xclient.window) { + if (dock-icon_array[i] + dock-icon_array[i]-icon-core-window == event-xclient.window) { *icon_pos = i; - break; + return dock; } } } - if (*icon_pos 0 (dock = scr-workspaces[scr-current_workspace]-clip) != NULL) { + + dock = scr-workspaces[scr-current_workspace]-clip; + if (dock != NULL) { for (i = 0; i dock-max_icons; i++) { - if (dock-icon_array[i] -dock-icon_array[i]-icon-core-window == event-xclient.window) { + if (dock-icon_array[i] + dock-icon_array[i]-icon-core-window == event-xclient.window) { *icon_pos = i; - break; + return dock; } } } - if (*icon_pos = 0) - return dock; + + *icon_pos = -1; return NULL; } -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 13/13] wmaker: moved calculation of internal offset in handleDockMove outside the loop
As pointed by the checkpatch.pl script, one line was too long in respect of the coding style. This line contains the calculation of an offset when storing a value in an array, as this offset is a constant during all the loop, this patch is calculating the offset only once before the loop and then uses this result, which should make the code faster (although gcc may already optimise this kind of things), makes it compliant with coding style, and takes the opportunity to explain the reasons behind this offset. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- src/dock.c | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/dock.c b/src/dock.c index 2f325e9..99c137a 100644 --- a/src/dock.c +++ b/src/dock.c @@ -3835,12 +3835,24 @@ static void handleDockMove(WDock *dock, WAppIcon *aicon, XEvent *event) XUngrabPointer(dpy, CurrentTime); if (dock-type == WM_DRAWER) { Window wins[dock-icon_count]; + int offset_index; + + /* +* When the dock is on the Right side, the index of the icons are negative to +* reflect the fact that they are placed on the other side of the dock; we use +* an offset here so we can have an always positive index for the storage in +* the 'wins' array. +*/ + if (dock-on_right_side) + offset_index = dock-icon_count - 1; + else + offset_index = 0; for (i = 0; i dock-max_icons; i++) { tmpaicon = dock-icon_array[i]; if (tmpaicon == NULL) continue; - wins[ tmpaicon-xindex + (dock-on_right_side ? dock-icon_count - 1 : 0) ] = tmpaicon-icon-core-window; + wins[tmpaicon-xindex + offset_index] = tmpaicon-icon-core-window; } slide_windows(wins, dock-icon_count, (dock-on_right_side ? x - (dock-icon_count - 1) * ICON_SIZE : x), -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 00/13] A bunch of random fixes
Hello, This series of patches is mainly code improvements, no real bug fixes but improvements to the code. Regards, Christophe. Makefile.am | 1 + README | 3 +- configure.ac | 12 + doc/build/Compilation.texi | 4 + script/check-wmaker-loaddef-callbacks.sh | 470 +++ src/Makefile.am | 29 ++ src/WindowMaker.h| 2 +- src/actions.c| 50 ++-- src/appicon.c| 6 +- src/appmenu.c| 3 +- src/balloon.c| 27 +- src/dialog.c | 9 +- src/dock.c | 76 +++-- src/event.c | 6 +- src/misc.c | 20 +- src/misc.h | 8 +- src/monitor.c| 3 +- src/osdep_bsd.c | 9 +- src/osdep_linux.c| 6 +- src/rootmenu.c | 31 +- src/screen.c | 21 +- src/session.c| 26 +- src/wconfig.h.in | 3 - src/wdefaults.c | 6 +- src/winmenu.c| 149 +- src/winspector.c | 6 +- src/workspace.c | 10 +- src/wsmap.c | 8 +- 28 files changed, 793 insertions(+), 211 deletions(-) create mode 100755 script/check-wmaker-loaddef-callbacks.sh -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 12/13] wmaker: moved the definition of the entries for the window menu options to an array
By defining the const array with everything at the beginning of the file, it is easier to maintain and to make evolve. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- src/winmenu.c | 34 ++ 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/src/winmenu.c b/src/winmenu.c index 14cb271..c7da09d 100644 --- a/src/winmenu.c +++ b/src/winmenu.c @@ -106,10 +106,18 @@ enum { WO_KEEP_ON_TOP, WO_KEEP_AT_BOTTOM, - WO_OMNIPRESENT, - WO_ENTRIES + WO_OMNIPRESENT }; +static const char *const menu_options_entries[] = { + [WO_KEEP_ON_TOP]= N_(Keep on top), + [WO_KEEP_AT_BOTTOM] = N_(Keep at bottom), + [WO_OMNIPRESENT]= N_(Omnipresent) +}; + +/* + * Defines the menu entries for the Other maximization sub-menu + */ static const struct { const char *label; unsigned int shortcut_idx; @@ -320,7 +328,7 @@ static void makeShortcutCommand(WMenu * menu, WMenuEntry * entry) { WWindow *wwin = (WWindow *) entry-clientdata; WScreen *scr = wwin-screen_ptr; - int index = entry-order - WO_ENTRIES; + int index = entry-order - wlengthof(menu_options_entries); /* Parameter not used, but tell the compiler that it is ok */ (void) menu; @@ -400,8 +408,8 @@ static void updateMakeShortcutMenu(WMenu * menu, WWindow * wwin) buflen = strlen(_(Set Shortcut)) + 16; buffer = wmalloc(buflen); - for (i = WO_ENTRIES; i smenu-entry_no; i++) { - int shortcutNo = i - WO_ENTRIES; + for (i = wlengthof(menu_options_entries); i smenu-entry_no; i++) { + int shortcutNo = i - wlengthof(menu_options_entries); WMenuEntry *entry = smenu-entries[i]; WMArray *shortSelWindows = wwin-screen_ptr-shortcutWindows[shortcutNo]; @@ -538,17 +546,11 @@ static WMenu *makeOptionsMenu(WScreen * scr) return NULL; } - entry = wMenuAddCallback(menu, _(Keep on top), execWindowOptionCommand, NULL); - entry-flags.indicator = 1; - entry-flags.indicator_type = MI_CHECK; - - entry = wMenuAddCallback(menu, _(Keep at bottom), execWindowOptionCommand, NULL); - entry-flags.indicator = 1; - entry-flags.indicator_type = MI_CHECK; - - entry = wMenuAddCallback(menu, _(Omnipresent), execWindowOptionCommand, NULL); - entry-flags.indicator = 1; - entry-flags.indicator_type = MI_CHECK; + for (i = 0; i wlengthof(menu_options_entries); i++) { + entry = wMenuAddCallback(menu, _(menu_options_entries[i]), execWindowOptionCommand, NULL); + entry-flags.indicator = 1; + entry-flags.indicator_type = MI_CHECK; + } for (i = 0; i MAX_WINDOW_SHORTCUTS; i++) { entry = wMenuAddCallback(menu, , makeShortcutCommand, NULL); -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 10/12] wmaker: converted macro 'SAME' into a static function
There are some risks associated with the way arguments are used in macros, and using a function also allows check on the type of arguments and leaves more room to the compiler for making the best optimisation choice; it also allows writing easier to read code (and thus, to maintain). As a side effect, this should also help Coverity in avoiding false positive bug reports (like #109605 and #109607). Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- src/session.c | 20 +--- src/window.c | 19 --- 2 files changed, 33 insertions(+), 6 deletions(-) diff --git a/src/session.c b/src/session.c index d55732f..2af8fd0 100644 --- a/src/session.c +++ b/src/session.c @@ -415,7 +415,19 @@ static WSavedState *getWindowState(WScreen * scr, WMPropList * win_state) return state; } -#define SAME(x, y) (((x) (y) !strcmp((x), (y))) || (!(x) !(y))) +static inline int is_same(const char *x, const char *y) +{ + if ((x == NULL) (y == NULL)) + return 1; + + if ((x == NULL) || (y == NULL)) + return 0; + + if (strcmp(x, y) == 0) + return 1; + else + return 0; +} void wSessionRestoreState(WScreen *scr) { @@ -503,8 +515,10 @@ void wSessionRestoreState(WScreen *scr) if (dock != NULL) { for (j = 0; j dock-max_icons; j++) { btn = dock-icon_array[j]; - if (btn SAME(instance, btn-wm_instance) - SAME(class, btn-wm_class) SAME(command, btn-command) !btn-launching) { + if (btn is_same(instance, btn-wm_instance) + is_same(class, btn-wm_class) + is_same(command, btn-command) + !btn-launching) { found = 1; break; } diff --git a/src/window.c b/src/window.c index 121cd16..7cbad9c 100644 --- a/src/window.c +++ b/src/window.c @@ -2621,7 +2621,19 @@ WMagicNumber wWindowAddSavedState(const char *instance, const char *class, return wstate; } -#define SAME(x, y) (((x) (y) !strcmp((x), (y))) || (!(x) !(y))) +static inline int is_same(const char *x, const char *y) +{ + if ((x == NULL) (y == NULL)) + return 1; + + if ((x == NULL) || (y == NULL)) + return 0; + + if (strcmp(x, y) == 0) + return 1; + else + return 0; +} WMagicNumber wWindowGetSavedState(Window win) { @@ -2637,8 +2649,9 @@ WMagicNumber wWindowGetSavedState(Window win) if (PropGetWMClass(win, class, instance)) { while (wstate) { - if (SAME(instance, wstate-instance) - SAME(class, wstate-class) SAME(command, wstate-command)) { + if (is_same(instance, wstate-instance) + is_same(class, wstate-class) + is_same(command, wstate-command)) { break; } wstate = wstate-next; -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 05/12] wmaker: fix memory leak in the Workspace Map if there is no workspace (Coverity #109608)
As pointed by Coverity, there is a safety check on the number of workspace which aborts the function, but the storage memory have already been allocated so it would leak this buffer. The case where the number of workspace is 0 is probably not supposed to happen (there should always be at least 1 workspace, the current one), but it is better to keep safety checks, so this patch is moving the check at the beginning so no leak will occur. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- src/wsmap.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/wsmap.c b/src/wsmap.c index e2b6747..3e84c98 100644 --- a/src/wsmap.c +++ b/src/wsmap.c @@ -372,16 +372,18 @@ static void create_mini_workspace(WScreen *scr, WWorkspaceMap *wsmap, W_Workspac static WWorkspaceMap *create_workspace_map(WScreen *scr, W_WorkspaceMap *wsmap_array, int edge) { - WWorkspaceMap *wsmap = wmalloc(sizeof(WWorkspaceMap)); + WWorkspaceMap *wsmap; + + if (scr-workspace_count == 0) + return NULL; + + wsmap = wmalloc(sizeof(*wsmap)); wsmap-border_width = 5; wsmap-edge = edge; wsmap-mini_workspace_width = scr-scr_width / WORKSPACE_MAP_RATIO; wsmap-mini_workspace_height = scr-scr_height / WORKSPACE_MAP_RATIO; - if (scr-workspace_count == 0) - return NULL; - wsmap-scr = scr; wsmap-win = WMCreateWindow(scr-wmscreen, wsmap); wsmap-wswidth = WidthOfScreen(DefaultScreenOfDisplay(dpy)); -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 06/12] wmaker: remove non-necessary allocation (Coverity #109609)
As pointed by Coverity, there was a memory leak because the buffer used to create the wmsetbg command is allocated twice. Because it is not really necessary to call 'wmalloc' for such a small case (it is not efficient and participates to memory fragmentation), this patch replaces the dynamic memory allocation by a buffer on the stack, which also solves to de-allocation issue. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- src/defaults.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/defaults.c b/src/defaults.c index ee027dc..b6e855c 100644 --- a/src/defaults.c +++ b/src/defaults.c @@ -3088,23 +3088,21 @@ static int setWorkspaceBack(WScreen * scr, WDefaultEntry * entry, void *tdata, v } } } else if (WMGetPropListItemCount(value) 0) { - char *command; char *text; char *dither; int len; text = WMGetPropListDescription(value, False); len = strlen(text) + 40; - command = wmalloc(len); dither = wPreferences.no_dithering ? -m : -d; if (!strchr(text, '\'') !strchr(text, '\\')) { - command = wmalloc(len); + char command[len]; + if (wPreferences.smooth_workspace_back) snprintf(command, len, wmsetbg %s -S -p '%s' , dither, text); else snprintf(command, len, wmsetbg %s -p '%s' , dither, text); ExecuteShellCommand(scr, command); - wfree(command); } else wwarning(_(Invalid arguments for background \%s\), text); wfree(text); -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 08/12] WINGs: remove useless function call in WColorPanel (Coverity #109617)
As reported by Coverity, the function 'customSetPalette' is making a call to 'WMGetPopUpButtonSelectedItem', but this function does nothing to the widget but only return a value, which is not used at all, so this patch removes the call to the function. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- WINGs/wcolorpanel.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/WINGs/wcolorpanel.c b/WINGs/wcolorpanel.c index f23c91d..8aea1df 100644 --- a/WINGs/wcolorpanel.c +++ b/WINGs/wcolorpanel.c @@ -2867,8 +2867,6 @@ static void customSetPalette(W_ColorPanel * panel) panel-palXRatio = (double)(panel-customPaletteImg-width) / (double)(customPaletteWidth); panel-palYRatio = (double)(panel-customPaletteImg-height) / (double)(customPaletteHeight); - - WMGetPopUpButtonSelectedItem(panel-customPaletteHistoryBtn); } static void customPalettePositionSelection(W_ColorPanel * panel, int x, int y) -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 09/12] WUtil: fix improper use of de-allocated variable (Coverity #109618)
As pointed by Coverity, the variable 'path_dst' was first free'd, then it was used in the 'unlink' function. This patch fixes the call order to de-allocate the string only when it is no more needed. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- WINGs/findfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WINGs/findfile.c b/WINGs/findfile.c index b5f1b1f..a1e1b02 100644 --- a/WINGs/findfile.c +++ b/WINGs/findfile.c @@ -513,9 +513,9 @@ int wcopy_file(const char *dest_dir, const char *src_file, const char *dest_file werror(_(could not close the file \%s\: %s), path_dst, strerror(errno)); cleanup_and_return_failure: free(buffer); - wfree(path_dst); close(fd_src); unlink(path_dst); + wfree(path_dst); return -1; } -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 07/12] wmaker: remove useless null pointer check (Coverity #109612)
As pointed by Coverity, the pointer in wwin-frame have already been dereferenced many times in the function, so it is useless to include a check later; removing it makes the code smaller thus easier to maintain. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- src/actions.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/actions.c b/src/actions.c index 4e87746..1d46b03 100644 --- a/src/actions.c +++ b/src/actions.c @@ -1155,7 +1155,7 @@ void wIconifyWindow(WWindow *wwin) const char *title; char title_buf[32]; - if (wwin-frame wwin-frame-title) { + if (wwin-frame-title) { title = wwin-frame-title; } else { snprintf(title_buf, sizeof(title_buf), (id=0x%lx), wwin-client_win); -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 11/12] wmaker: fix crash when switching workspace with Affiche.app
As reported by Martin Dietze, when switching workspace (mainly with keyboard shortcut) while the focus was set on a sticky note from the GNUstep application Affiche.app would cause Window Maker to crash. This crash was due to the application creating its menu with an Omnipresent state; Window Maker tried to be smart by smartly setting the focus to this window after the workspace change, unfortunately when removing the window of the note from the screen the application would decide to remove also the omnipresent menu (because it is not necessary anymore). Because we kept a pointer to an outdated WWindow, we would silently corrupt memory, which would later cause a crash in an unrelated place (fortunately in this case it happened quite soon). This patch adds a check to make sure the window we want to focus is still a valid one, and if it is not we just ignore it to fall back on another mechanism already in place for picking the window to focus. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- src/workspace.c | 20 1 file changed, 20 insertions(+) diff --git a/src/workspace.c b/src/workspace.c index 380ffec..69db16c 100644 --- a/src/workspace.c +++ b/src/workspace.c @@ -586,6 +586,26 @@ void wWorkspaceForceChange(WScreen * scr, int workspace) if (!foc) foc = foc2; + /* +* Check that the window we want to focus still exists, because the application owning it +* could decide to unmap/destroy it in response to unmap any of its other window following +* the workspace change, this happening during our 'ProcessPendingEvents' loop. +*/ + if (foc != NULL) { + WWindow *parse; + Bool found; + + found = False; + for (parse = scr-focused_window; parse != NULL; parse = parse-prev) { + if (parse == foc) { + found = True; + break; + } + } + if (!found) + foc = NULL; + } + if (scr-focused_window-flags.mapped !foc) { foc = scr-focused_window; } -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 12/12] wmaker: fix non-portable int argument for printf in error message
The original code assumed that the sizeof returns a long int type, which is true on 64 bits platform but not on 32 bits platforms, as pointed by gcc. The new code does an explicit conversions to 'int' (which should be enough for that case) so the format specifier in printf will always be ok, whatever platform Window Maker is compiled for. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- po/nl.po | 4 ++-- src/dialog.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/po/nl.po b/po/nl.po index 35cb850..674c642 100644 --- a/po/nl.po +++ b/po/nl.po @@ -346,9 +346,9 @@ msgstr #: ../src/dialog.c:594 #, c-format -msgid full path for file \%s\ in \%s\ is longer than %ld bytes, skipped +msgid full path for file \%s\ in \%s\ is longer than %d bytes, skipped msgstr -volledig pad voor bestand \%s\ in \%s\ is langer dan %ld byte, +volledig pad voor bestand \%s\ in \%s\ is langer dan %d byte, overgeslagen #: ../src/dialog.c:628 diff --git a/src/dialog.c b/src/dialog.c index b7b8f53..56cd3db 100644 --- a/src/dialog.c +++ b/src/dialog.c @@ -591,8 +591,8 @@ static void listPixmaps(WScreen *scr, WMList *lPtr, const char *path) if (wstrlcpy(pbuf, apath, sizeof(pbuf)) = sizeof(pbuf) || wstrlcat(pbuf, /, sizeof(pbuf)) = sizeof(pbuf) || wstrlcat(pbuf, dentry-d_name, sizeof(pbuf)) = sizeof(pbuf)) { - wwarning(_(full path for file \%s\ in \%s\ is longer than %ld bytes, skipped), -dentry-d_name, path, sizeof(pbuf) - 1); + wwarning(_(full path for file \%s\ in \%s\ is longer than %d bytes, skipped), +dentry-d_name, path, (int) (sizeof(pbuf) - 1) ); continue; } -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 01/12] wmaker: check return value for XGetWindowAttributes (Coverity #50032)
As reported by Coverity, the return value for XGetWindowAttributes is usually checked in many places, because it is a good practice to ensure that it did work, but it was not checked when called in the function 'wClientCheckProperty'. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- src/client.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client.c b/src/client.c index 99ed445..9af875c 100644 --- a/src/client.c +++ b/src/client.c @@ -483,8 +483,8 @@ void wClientCheckProperty(WWindow * wwin, XPropertyEvent * event) int foo; unsigned bar; - XGetWindowAttributes(dpy, wwin-client_win, attribs); - wClientGetNormalHints(wwin, attribs, False, foo, foo, bar, bar); + if (XGetWindowAttributes(dpy, wwin-client_win, attribs) != 0) + wClientGetNormalHints(wwin, attribs, False, foo, foo, bar, bar); /* TODO: should we check for consistency of the current * size against the new geometry hints? */ } -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 03/12] WINGs: fix memory leak in WMSubtractPLDictionaries (Coverity #50128)
As pointed by Coverity, a temporary proplist is created with the list of keys to be removed from the source proplist, but this temporary proplist was not released at the end, leaking memory. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- WINGs/proplist.c | 1 + 1 file changed, 1 insertion(+) diff --git a/WINGs/proplist.c b/WINGs/proplist.c index 28a3ae2..5f68eac 100644 --- a/WINGs/proplist.c +++ b/WINGs/proplist.c @@ -1213,6 +1213,7 @@ WMPropList *WMSubtractPLDictionaries(WMPropList * dest, WMPropList * source, Boo for (i = 0; i WMGetArrayItemCount(keys-d.array); i++) { WMRemoveFromPLDictionary(dest, WMGetFromArray(keys-d.array, i)); } + WMReleasePropList(keys); return dest; } -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 02/12] Handle NULL pointer as good as possible (Coverity #50099)
As pointed by Coverity, in the Configuration panel of WPrefs there are some images loaded, but if the images cannot be loaded correctly then the returned NULL pointer can crash the application as it is dereferenced in further function calls. To solve this case, this patch is adding a NULL pointer check in the functions RScaleImage (wrlib) and WMCreatePixmapFromRImage (WINGs), so both can accept that NULL pointer to also return NULL, which means the existing check for icon == NULL in the WPrefs code will be useful. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- WINGs/wpixmap.c | 3 +++ wrlib/scale.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/WINGs/wpixmap.c b/WINGs/wpixmap.c index 272e56a..5ad311c 100644 --- a/WINGs/wpixmap.c +++ b/WINGs/wpixmap.c @@ -85,6 +85,9 @@ WMPixmap *WMCreatePixmapFromRImage(WMScreen * scrPtr, RImage * image, int thresh WMPixmap *pixPtr; Pixmap pixmap, mask; + if (image == NULL) + return NULL; + if (!RConvertImageMask(scrPtr-rcontext, image, pixmap, mask, threshold)) { return NULL; } diff --git a/wrlib/scale.c b/wrlib/scale.c index 0f5952c..9461233 100644 --- a/wrlib/scale.c +++ b/wrlib/scale.c @@ -52,6 +52,9 @@ RImage *RScaleImage(RImage * image, unsigned new_width, unsigned new_height) unsigned char *d; RImage *img; + if (image == NULL) + return NULL; + if (new_width == image-width new_height == image-height) return RCloneImage(image); -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 04/12] wmaker: fix incorrect size for memory allocation (Coverity #50207)
As pointed by Coverity, when increasing the size of the array allocated to store the pointers to menus in a cascaded menu, the incorrect value was used in argument to the sizeof which lead to over-allocating memory. This patch replaces the name of the structure (which should have been the pointer type) by the variable actually being used, fixing the size issue and making maintainability easier by tracking the type of the variable which is less prone to bugs in case of change. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- src/menu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/menu.c b/src/menu.c index 8322dbb..83eb804 100644 --- a/src/menu.c +++ b/src/menu.c @@ -312,10 +312,10 @@ void wMenuEntrySetCascade(WMenu * menu, WMenuEntry * entry, WMenu * cascade) if (!done) { entry-cascade = menu-cascade_no; - menu-cascades = wrealloc(menu-cascades, sizeof(WMenu) * (menu-cascade_no + 1)); + menu-cascades = wrealloc(menu-cascades, sizeof(menu-cascades[0]) * (menu-cascade_no + 1)); menu-cascades[menu-cascade_no++] = cascade; - brother-cascades = wrealloc(brother-cascades, sizeof(WMenu) * (brother-cascade_no + 1)); + brother-cascades = wrealloc(brother-cascades, sizeof(brother-cascades[0]) * (brother-cascade_no + 1)); brother-cascades[brother-cascade_no++] = cascade-brother; } -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 00/12] Bug fixes
Hello, This series of patches is fixing many bugs reported by Coverity, the bug reported by Martin which crashes Window Maker with Affiche.app, and a little bit more for portability. Regards, Christophe. WINGs/findfile.c| 2 +- WINGs/proplist.c| 1 + WINGs/wcolorpanel.c | 2 -- WINGs/wpixmap.c | 3 +++ po/nl.po| 4 ++-- src/actions.c | 2 +- src/client.c| 4 ++-- src/defaults.c | 6 ++ src/dialog.c| 4 ++-- src/menu.c | 4 ++-- src/session.c | 20 +--- src/window.c| 19 --- src/workspace.c | 20 src/wsmap.c | 10 ++ wrlib/scale.c | 3 +++ 15 files changed, 78 insertions(+), 26 deletions(-) -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 1/1] doc: re-generate the top directory documentation when make dist is invoked
As pointed by Douglas Torrance, there are some case where the 2 docs INSTALL-WMAKER and README.i18n are not re-generated properly, one of the cases being if the user grabs the sources from Git to make a source package only (ie, without compiling anything). This patch adds a hook to make dist so it will re-generate the docs if needed. Because the dist-hook is run after Automake has copied the files to the temporary directory (distdir) then we also include an explicit copy of the files there to have the latest version. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- doc/build/Makefile.am | 7 +++ 1 file changed, 7 insertions(+) diff --git a/doc/build/Makefile.am b/doc/build/Makefile.am index c80394e..dc656e9 100644 --- a/doc/build/Makefile.am +++ b/doc/build/Makefile.am @@ -7,6 +7,13 @@ EXTRA_DIST = Readme \ # How to re-generate automatically the top-level text files all-local: $(top_srcdir)/INSTALL-WMAKER $(top_srcdir)/README.i18n +# We also re-generate the documentation when make dist is used, because we cannot +# be assured that the doc currently present in the directory is up-to-date, for example +# if the user did not run make (all) for valid reason +dist-hook: $(top_srcdir)/INSTALL-WMAKER $(top_srcdir)/README.i18n + cp -f $(top_srcdir)/INSTALL-WMAKER $(top_distdir)/INSTALL-WMAKER + cp -f $(top_srcdir)/README.i18n $(top_distdir)/README.i18n + $(top_srcdir)/INSTALL-WMAKER: $(srcdir)/Compilation.texi $(top_srcdir)/script/generate-txt-from-texi.sh $(AM_V_GEN)if test ! -e $(top_srcdir)/INSTALL-WMAKER -o -w $(top_srcdir)/INSTALL-WMAKER ; then \ $(top_srcdir)/script/generate-txt-from-texi.sh \ -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 3/3] merge with 418eb1f157c76ffc3db43f9a4fbf1a85f966d55c
--- doc/get-wraster-flags.1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/get-wraster-flags.1 b/doc/get-wraster-flags.1 index 95bd062..8abc35f 100644 --- a/doc/get-wraster-flags.1 +++ b/doc/get-wraster-flags.1 @@ -4,11 +4,11 @@ .PP .SH SYNOPSIS .B pkg-config -.R wrlib +wrlib .I \-\-cflags .br .B pkg-config -.R wrlib +wrlib .I \-\-libs .SH DESCRIPTION \fBget-wraster-flags\fP used to provide the compilation and link flags for programs that use -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 2/3] merge with 4c86603b36ed91da0b1246a4f0b4093d4e75bf08
--- doc/get-wutil-flags.1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/get-wutil-flags.1 b/doc/get-wutil-flags.1 index 1e6641a..635c322 100644 --- a/doc/get-wutil-flags.1 +++ b/doc/get-wutil-flags.1 @@ -4,11 +4,11 @@ .PP .SH SYNOPSIS .B pkg-config -.R WUtil +WUtil .I \-\-cflags .br .B pkg-config -.R WUtil +WUtil .I \-\-libs .SH DESCRIPTION \fBget-wutil-flags\fP used to provide the compilation and link flags for programs that use -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 1/3] merge with 46bc10e27b09cd7f9c149af982063fdf96a1a35f
--- doc/get-wings-flags.1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/get-wings-flags.1 b/doc/get-wings-flags.1 index 7c04894..2ddd8b8 100644 --- a/doc/get-wings-flags.1 +++ b/doc/get-wings-flags.1 @@ -4,11 +4,11 @@ .PP .SH SYNOPSIS .B pkg-config -.R WINGs +WINGs .I \-\-cflags .br .B pkg-config -.R WINGs +WINGs .I \-\-libs .SH DESCRIPTION \fBget-wings-flags\fP used to provide the compilation and link flags for programs that use -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 1/1] merge with ae92bccb14432a8e4ab6619f5171a7b56506e5e6
(fix typo) --- doc/build/Compilation.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/build/Compilation.texi b/doc/build/Compilation.texi index cb19a6d..4db3ae0 100644 --- a/doc/build/Compilation.texi +++ b/doc/build/Compilation.texi @@ -224,7 +224,7 @@ Get the @emph{GNU} version from @uref{http://www.gnu.org/software/gettext/} This library can be used by the @emph{WINGs} toolkit to improve support for @emph{UTF-8} and for languages written in right-to-left direction, in some widgets. -You have to explicitly ask for its support though (@pxref{Configure Options}). +You have to explicitly ask for its support through (@pxref{Configure Options}). You can get it from @uref{http://www.pango.org/Download} @item @emph{libbsd} -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 1/1] texi2txt: add workaround for a known bug in mawk
As reported by Douglas Torrance, the script that generates the plain text documentation from the texinfo source would crash due to the cross- references when the version of awk used is mawk. This is actually a known bug in mawk: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=172774 It looks like the bug have been fixed in mawk, but Debian is still providing a broken version. To avoid problems, this patch is introducing a workaround in the matching pattern that causes the issue every time it is being used. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- script/generate-txt-from-texi.sh | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/script/generate-txt-from-texi.sh b/script/generate-txt-from-texi.sh index 5554e6e..3800c72 100755 --- a/script/generate-txt-from-texi.sh +++ b/script/generate-txt-from-texi.sh @@ -212,12 +212,12 @@ function end_conditional(name, local_i) { # with @value; they can also be defined from command-line (-D) # they are stored in the global array variable[name] function set_variable(line, local_idx, local_name, local_value) { - gsub(/^[ \t]*/, , line); + gsub(/^[ \t]+/, , line); local_idx = match(line, /[ \t]/); if (local_idx 0) { local_name = substr(line, 1, local_idx - 1); local_value = substr(line, local_idx + 1); -gsub(/^[ \t]*/, , local_value); +gsub(/^[ \t]+/, , local_value); } else { local_name = line; local_value = ; @@ -473,7 +473,7 @@ function new_node(args,local_nb, local_arr, local_i) { if ((local_nb 1) || (local_nb 4)) { report_error(bad number of argument local_nb for @node at line NR); } - gsub(/^[ \t]*/, , local_arr[1]); + gsub(/^[ \t]+/, , local_arr[1]); gsub(/[ \t]*$/, , local_arr[1]); if (local_arr[1] == ) { report_error(missing node name for @node at line NR); @@ -572,7 +572,7 @@ function generate_cross_reference(args, cmd, local_nb, local_arr, local local_arr[1] = execute_commands(local_arr[1]); for (local_i = 1; local_i = local_nb; local_i++) { -gsub(/^[ \t]*/, , local_arr[local_i]); +gsub(/^[ \t]+/, , local_arr[local_i]); gsub(/[ \t]*$/, , local_arr[local_i]); } -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 00/23] documentation updates
Hello, This series of patches try to improve man documentations - for devs (WRaster WINGs compilation options); - most command-line options in the man pages; - the compilation installation manual; - and add some doc checks as part of make check Regards, Christophe. .gitignore | 4 +- INSTALL-WMAKER | 385 -- Makefile.am | 27 +- WINGs/Makefile.am | 25 +- WINGs/get-wings-flags | 33 ++ WINGs/get-wings-flags.in| 31 -- WINGs/get-wutil-flags | 33 ++ WINGs/get-wutil-flags.in| 31 -- autogen.sh | 3 +- configure.ac| 24 +- doc/Makefile.am | 89 - doc/WPrefs.1x | 14 +- doc/build/Compilation.texi | 777 doc/build/Makefile.am | 12 +- doc/get-wings-flags.1 | 40 +- doc/get-wraster-flags.1 | 42 +- doc/get-wutil-flags.1 | 40 +- doc/geticonset.1x | 18 +- doc/getstyle.1x | 67 ++-- doc/seticons.1x | 10 +- doc/setstyle.1x | 55 +-- doc/wdread.1| 31 -- doc/wdread.1x | 43 ++ doc/wdwrite.1x | 8 +- doc/wmagnify.1x | 34 +- doc/wmaker.1x | 161 doc/wmaker.in | 166 doc/wmgenmenu.1 | 24 +- doc/wmsetbg.1x | 85 doc/wmsetbg.in | 110 + doc/wxcopy.1x | 30 +- doc/wxpaste.1x | 23 +- script/check-cmdline-options-doc.sh | 216 ++ script/generate-txt-from-texi.sh| 246 +++- script/replace-ac-keywords.sh | 167 src/Makefile.am | 10 +- src/appicon.c | 8 +- src/appicon.h | 2 +- src/dialog.c| 4 +- src/dock.c | 30 +- src/dock.h | 2 +- src/dockedapp.c | 8 +- src/event.c | 8 +- src/main.c | 2 + src/misc.c | 4 +- src/motif.c | 4 - src/screen.h| 2 +- src/startup.c | 4 +- src/wconfig.h.in| 3 - src/window.c| 6 +- src/xdnd.c | 14 +- util/seticons.c | 2 +- util/wmagnify.c | 8 +- util/wmsetbg.c | 2 +- util/wxpaste.c | 4 +- wrlib/Makefile.am | 13 +- wrlib/get-wraster-flags | 33 ++ wrlib/get-wraster-flags.in | 31 -- 58 files changed, 2247 insertions(+), 1061 deletions(-) delete mode 100644 INSTALL-WMAKER create mode 100755 WINGs/get-wings-flags delete mode 100644 WINGs/get-wings-flags.in create mode 100755 WINGs/get-wutil-flags delete mode 100644 WINGs/get-wutil-flags.in create mode 100644 doc/build/Compilation.texi delete mode 100644 doc/wdread.1 create mode 100644 doc/wdread.1x delete mode 100644 doc/wmaker.1x create mode 100644 doc/wmaker.in delete mode 100644 doc/wmsetbg.1x create mode 100644 doc/wmsetbg.in create mode 100755 script/check-cmdline-options-doc.sh create mode 100755 script/replace-ac-keywords.sh create mode 100755 wrlib/get-wraster-flags delete mode 100644 wrlib/get-wraster-flags.in -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 03/23] WINGs: mark the script 'get-wings-flags' as deprecated
This script should have been removed a long time ago, in favour of pkg-config which has to be present anyway to compile Window Maker. This patch makes the script print a warning about it, and now calls itself pkg-config, instead of being generated; the man page was also updated accordingly (and spell-checked). Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- .gitignore | 1 - WINGs/Makefile.am| 17 +++-- WINGs/get-wings-flags| 33 + WINGs/get-wings-flags.in | 31 --- doc/get-wings-flags.1| 40 5 files changed, 56 insertions(+), 66 deletions(-) create mode 100755 WINGs/get-wings-flags delete mode 100644 WINGs/get-wings-flags.in diff --git a/.gitignore b/.gitignore index a27a3b0..0e94104 100644 --- a/.gitignore +++ b/.gitignore @@ -76,7 +76,6 @@ WINGs/Tests/testmywidget WINGs/Tests/wmfile WINGs/Tests/wmquery WINGs/Tests/wtest -WINGs/get-wings-flags WPrefs.app/WPrefs diff --git a/WINGs/Makefile.am b/WINGs/Makefile.am index 1e4d8e9..79e6752 100644 --- a/WINGs/Makefile.am +++ b/WINGs/Makefile.am @@ -8,7 +8,7 @@ DIST_SUBDIRS = $(SUBDIRS) Tests Examples Extras libWINGs_la_LDFLAGS = -version-info @WINGS_VERSION@ libWUtil_la_LDFLAGS = -version-info @WUTIL_VERSION@ -bin_SCRIPTS = get-wings-flags get-wutil-flags +dist_bin_SCRIPTS = get-wings-flags get-wutil-flags lib_LTLIBRARIES = libWUtil.la libWINGs.la @@ -17,7 +17,7 @@ LDADD= libWUtil.la libWINGs.la $(top_builddir)/wrlib/libwraster.la @INTLIBS@ libWINGs_la_LIBADD = libWUtil.la $(top_builddir)/wrlib/libwraster.la @XLIBS@ @XFTLIBS@ @FCLIBS@ @LIBM@ @PANGOLIBS@ libWUtil_la_LIBADD = @LIBBSD@ -EXTRA_DIST = BUGS make-rgb Examples Extras Tests get-wings-flags.in get-wutil-flags +EXTRA_DIST = BUGS make-rgb Examples Extras Tests # wbutton.c @@ -98,7 +98,7 @@ AM_CPPFLAGS = -DRESOURCE_PATH=\$(datadir)/WINGs\ \ pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = WINGs.pc WUtil.pc -DISTCLEANFILES = $(pkgconfig_DATA) get-wings-flags +DISTCLEANFILES = $(pkgconfig_DATA) WINGs.pc: Makefile @echo Generating $@ @@ -110,17 +110,6 @@ WINGs.pc: Makefile @echo 'Libs.private: $(XFTLIBS) $(PANGOLIBS) $(XLIBS) -lm $(INTLIBS)' $@ @echo 'Cflags: $(inc_search_path)' $@ -get-wings-flags: get-wings-flags.in Makefile - @echo Generating $@ - @$(SED) -e 's#$${inc_search_path}#$(inc_search_path)#;' \ - -e 's#$${lib_search_path}#$(lib_search_path)#;' \ - -e 's#$${GFXLIBS}#$(GFXLIBS)#;' \ - -e 's#$${XFTLIBS}#$(XFTLIBS)#;' \ - -e 's#$${PANGOLIBS}#$(PANGOLIBS)#;' \ - -e 's#$${INTLIBS}#$(INTLIBS)#;' \ - -e 's#$${XLIBS}#$(XLIBS)#;' $(abs_srcdir)/get-wings-flags.in $@ - @chmod 755 $@ - WUtil.pc: Makefile @echo Generating $@ @echo 'Name: WUtil' $@ diff --git a/WINGs/get-wings-flags b/WINGs/get-wings-flags new file mode 100755 index 000..c7342a0 --- /dev/null +++ b/WINGs/get-wings-flags @@ -0,0 +1,33 @@ +#!/bin/sh + +# [Christophe CURIS, 2015/01/31] +# This script is now reporting itself as deprecated (this should have been done +# a long time ago), so it should be kept for at least 2 years from now in order +# to allow users to update their scripts, and then removed. + +if test $# -eq 0; then + echo Error: $0 is deprecated, please use 'pkg-config WINGs ...' 2 + exit 1 +fi + +while test $# -gt 0; do + case $1 in +--cflags) +echo Warning: $0 is deprecated, please use 'pkg-config WINGs --cflags' 2 + pkg-config WINGs --cflags +;; +--ldflags|--lflags) + echo Warning: $0 is deprecated, please use 'pkg-config WINGs --libs' 2 +pkg-config WINGs --libs-only-L +;; +--libs) + echo Warning: $0 is deprecated, please use 'pkg-config WINGs --libs' 2 +pkg-config WINGs --libs +;; +*) + echo Error: $0 is deprecated, please use 'pkg-config WINGs ...' 2 + exit 1 + ;; + esac + shift +done diff --git a/WINGs/get-wings-flags.in b/WINGs/get-wings-flags.in deleted file mode 100644 index 7218e00..000 --- a/WINGs/get-wings-flags.in +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh - -WCFLAGS=${inc_search_path} -WLFLAGS=${lib_search_path} -WLIBS=-lWINGs -lWUtil -lwraster ${GFXLIBS} ${XFTLIBS} ${XLIBS} -lm ${INTLIBS} ${PANGOLIBS} - -usage=Usage: get-wings-flags [--cflags] [--ldflags] [--libs] - -if test $# -eq 0; then - echo ${usage} 12 - exit 1 -fi - -while test $# -gt 0; do - case $1 in ---cflags) - echo $WCFLAGS -;; ---ldflags|--lflags) - echo $WLFLAGS -;; ---libs) - echo $WLIBS -;; -*) - echo ${usage} 12 - exit 1 - ;; - esac - shift -done diff --git a/doc/get-wings-flags.1 b/doc/get-wings-flags.1 index 86675f3..fd8eb4d 100644 --- a/doc/get-wings-flags.1 +++ b/doc/get-wings-flags.1
[PATCH 01/23] wrlib: mark the script 'get-wraster-flags' as deprecated
This script should have been removed a long time ago, in favour of pkg-config which has to be present anyway to compile Window Maker. This patch makes the script print a warning about it, and now calls itself pkg-config, instead of being generated; the man page was also updated accordingly (and spell-checked). Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- .gitignore | 1 - doc/get-wraster-flags.1| 42 ++ wrlib/Makefile.am | 13 +++-- wrlib/get-wraster-flags| 33 + wrlib/get-wraster-flags.in | 31 --- 5 files changed, 58 insertions(+), 62 deletions(-) create mode 100755 wrlib/get-wraster-flags delete mode 100644 wrlib/get-wraster-flags.in diff --git a/.gitignore b/.gitignore index 79d7aff..7f81a87 100644 --- a/.gitignore +++ b/.gitignore @@ -61,7 +61,6 @@ util/wmsetup util/wxcopy util/wxpaste -wrlib/get-wraster-flags wrlib/tests/testdraw wrlib/tests/testgrad wrlib/tests/testrot diff --git a/doc/get-wraster-flags.1 b/doc/get-wraster-flags.1 index 08075b4..5b9b105 100644 --- a/doc/get-wraster-flags.1 +++ b/doc/get-wraster-flags.1 @@ -1,32 +1,34 @@ .TH get-wraster-flags 1 22 March 2005 .SH NAME -\fBget-wraster-flags\fR \- output libwraster compile and linker flags +\fBget-wraster-flags\fP \- output libwraster compiler and linker flags (deprecated) .PP .SH SYNOPSIS -.B get-wraster-flags \fR[ \fI\-\-cflags \fR] [ \fI\-\-ldflags \fR] -[ \fI\-\-libs \fR] -.PP +.B pkg-config +.R wrlib +.I \-\-cflags +.br +.B pkg-config +.R wrlib +.I \-\-libs .SH DESCRIPTION -\fBget-wraster-flags \fR\- output include path, library search path or -library archive names needed to compile and link with libwraster. -.PP -.SH OPTIONS +\fBget-wraster-flags\fP used to provide the compilation and link flags for programs that use +the \fIWRaster\fP library, before \fBpkg-config\fP became the universal way to handle these +developer configurations. The script is now deprecated and you should use instead: .TP -.B \-\-cflags -\fRoutput include file search path to find all header files needed to compile -source code using libwraster functions. +.BR pkg-config wrlib \fI\-\-cflags\fP +to get the flags for the compiler .TP -.B \-\-ldflags -\fRoutput library search path required to find all library archives needed to -link object files with libwraster. -.TP -.B \-\-libs -\fRoutput library archive names required to link object filed with libwraster. -.PP +.BR pkg-config wrlib \fI\-\-libs\fP +to get the flags for the linker +.SH IMPORTANT NOTE +As with every deprecated stuff, the script \fBget-wraster-flags\fR will be removed soon, +so you should update your script quickly while you know about it. .SH AUTHOR -get-wraster-flags is a part of Window Maker, wich was written by +get-wraster-flags is part of Window Maker, which was written by Alfredo K. Kojima koj...@windowmaker.info and Dan Pascu d...@windowmaker.info, with contributions from many people around the Internet. .PP -This manpage was written by Frederik Schueler fschue...@gmx.net for the +This man page was written by Frederik Schueler fschue...@gmx.net for the Debian GNU/Linux system (but may be used by others). +.SH SEE ALSO +.BR pkg-config (1) diff --git a/wrlib/Makefile.am b/wrlib/Makefile.am index 575a815..ee1c04d 100644 --- a/wrlib/Makefile.am +++ b/wrlib/Makefile.am @@ -5,7 +5,7 @@ DIST_SUBDIRS = $(SUBDIRS) tests AUTOMAKE_OPTIONS = -EXTRA_DIST = tests get-wraster-flags.in +EXTRA_DIST = tests lib_LTLIBRARIES = libwraster.la @@ -17,7 +17,7 @@ EXTRA_libwraster_la_DEPENDENCIES = libwraster.map CLEANFILES = libwraster.map endif -bin_SCRIPTS = get-wraster-flags +dist_bin_SCRIPTS = get-wraster-flags include_HEADERS = wraster.h @@ -84,7 +84,7 @@ libwraster_la_LIBADD = @LIBRARY_SEARCH_PATH@ @GFXLIBS@ @MAGICKLIBS@ @XLIBS@ @LIB pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = wrlib.pc -DISTCLEANFILES = $(pkgconfig_DATA) get-wraster-flags +DISTCLEANFILES = $(pkgconfig_DATA) wrlib.pc: Makefile @echo Generating $@ @@ -95,13 +95,6 @@ wrlib.pc: Makefile @echo 'Libs.private: $(GFXLIBS) $(MAGICKLIBS) $(XLIBS) -lm' $@ @echo 'Cflags: $(inc_search_path)' $@ -get-wraster-flags: get-wraster-flags.in Makefile - @echo Generating $@ - @$(SED) -e 's#$${inc_search_path}#$(inc_search_path)#;' \ - -e 's#$${lib_search_path}#$(lib_search_path)#;' \ - -e 's#$${GFXLIBS}#$(GFXLIBS)#;' \ - -e 's#$${XLIBS}#$(XLIBS)#;' $(abs_srcdir)/get-wraster-flags.in $@ - @chmod 755 $@ if HAVE_LD_VERSION_SCRIPT libwraster.map: $(include_HEADERS) $(top_srcdir)/script/generate-mapfile-from-header.sh diff --git a/wrlib/get-wraster-flags b/wrlib/get-wraster-flags new file mode 100755 index 000..ed245b9 --- /dev/null +++ b/wrlib/get-wraster-flags @@ -0,0 +1,33 @@ +#!/bin/sh + +# [Christophe CURIS, 2015/01/31] +# This script
[PATCH 05/23] wmaker: improve the documentation for the command-line options
There were 2 options that were not documented at all, which are now listed in the 'wmaker --help'; The man page have been updated according to the 'check-cmdline-opts' script feedback, including: - adding 2 options that were missing (global_def_path, no-drawer); - removed 2 options that do not exist anymore (no-cpp, create-stdcmap); - sorting the options, to make them easier to search for. In addition, took opportunity to: - remove the double description for 'visual-id'; - improve a number of descriptions to make them clearer; - fix minor stuff (typo, spaces at end of lines). Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- doc/wmaker.1x | 62 ++- src/main.c| 2 ++ 2 files changed, 34 insertions(+), 30 deletions(-) diff --git a/doc/wmaker.1x b/doc/wmaker.1x index cfa8405..bf2320e 100644 --- a/doc/wmaker.1x +++ b/doc/wmaker.1x @@ -1,5 +1,5 @@ .\ Hey, Emacs! This is an -*- nroff -*- source file. -.TH Window Maker 1x January 1999 +.TH Window Maker 1x February 2015 .SH NAME wmaker \- X11 window manager with a NEXTSTEP look .SH SYNOPSIS @@ -11,53 +11,54 @@ emulate NeXT's look as much as possible, but it deviates from it as necessary. .SH OPTIONS .TP -.B \-display host:display.screen +.BI \-display host:display.screen specify display to use. On multiheaded machines, Window Maker will automatically manage all screens. If you want Window Maker to manage only a specific screen, you must supply -the screen number you want to have managed with the +the screen number you want to have managed with the .B \-display command line argument. For example, if you want Window Maker to manage only screen 1, start it as: -.B wmaker -display :0.1 +.EX +wmaker -display :0.1 +.EE .TP -.B \-\-no\-cpp -disable preprocessing of configuration files +.B \-\-dont\-restore +do not restore saved session .TP -.B \-\-no\-dock -do not show the application Dock +.B \-\-global_defaults_path +print the path where the files for the default configuration are installed and exit .TP -.B \-\-no\-clip -do not show the workspace Clip +.B \-\-help +print the list of command line options supported, one per line, and exit .TP -.B \-\-no\-autolaunch -do not autolaunch applications +.BI \-\-locale locale +specify the locale (i18n language) to use; Window Maker will also set the variable +.B LANG +which will be inherited by all applications started from Window Maker .TP -.B \-\-dont\-restore -do not restore saved session +.B \-\-no\-autolaunch +do not launch at start-up the applications that were marked in the configuration as autolanched .TP -.B \-\-locale locale -specify the locale to use +.B \-\-no\-clip +do not show the workspace Clip .TP -.B \-\-create-stdcmap -create the standard colormap hint in PseudoColor visuals +.B \-\-no\-dock +do not show the application Dock .TP -.B \-\-visual\-id -visual id of visual to use +.B \-\-no\-drawer +disable the Drawers in the Dock .TP .B \-\-static -do not update or save configurations +do not update or save automatically the configuration .TP .B \-\-version -display version number and exit +display Window Maker's version number and exit .TP .B \-\-visual\-id -specify the ID of the visual to use. See +specify the ID of the visual to use; see .BR xdpyinfo (1x) -for a list of visuals available in your display. -.TP -.B \-\-help -print a brief help message +for a list of visuals available in your display .PP .SH FILES .TP @@ -88,7 +89,7 @@ files, user's files will be written to. This script is automatically executed when Window Maker is started. .TP .B ~/GNUstep/Library/WindowMaker/exitscript -This script is automatically executed immediately before Window Maker is +This script is automatically executed immediately before Window Maker is exited. .B Note: If you need to run something that requires the X server to be running @@ -129,7 +130,7 @@ Guess... ;-) .IP GNUSTEP_USER_ROOT specifies the initial path for the Defaults directory. Defaults/ is appended to this variable to determine the actual location of the -databases. If the varialbe is not set, it defaults to ~/GNUstep +databases. If the variable is not set, it defaults to ~/GNUstep .IP GNUSTEP_LOCAL_ROOT specifies the location of the system-wide \fBlocal\fP GNUstep directory (this is useful, for example, in those cases where the @@ -158,4 +159,5 @@ Window Maker was written by Alfredo K. Kojima koj...@windowmaker.info, Dan Pascu d...@windowmaker.info with contributions from many people around the Internet. .PP -This manual page was written by Marcelo E. Magallon, mmaga...@debian.org. +This manual page was created by Marcelo E. Magallon, mmaga...@debian.org +and is maintained by the Window Maker team. diff --git a/src/main.c b/src/main.c index 9024aca..96c44e2 100644 --- a/src/main.c +++ b/src/main.c @@ -438,6 +438,7 @@ static void print_help(void) puts(_( --no-dock do not open the application Dock
[PATCH 07/23] doc: changed section for man page of wdread to 1x for consistency
All the man pages for our tools that interact with Window Maker are placed in the 1x section, but the wdread page was an exception for no known reason. For consistency, this patch renames the file to the same 1x section. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- doc/Makefile.am | 2 +- doc/wdread.1| 31 --- doc/wdread.1x | 31 +++ 3 files changed, 32 insertions(+), 32 deletions(-) delete mode 100644 doc/wdread.1 create mode 100644 doc/wdread.1x diff --git a/doc/Makefile.am b/doc/Makefile.am index d667153..139b65c 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -11,7 +11,7 @@ dist_man_MANS = \ seticons.1x \ setstyle.1x \ upgrade-windowmaker-defaults.8 \ - wdread.1 \ + wdread.1x \ wdwrite.1x \ WindowMaker.1x \ wmagnify.1x \ diff --git a/doc/wdread.1 b/doc/wdread.1 deleted file mode 100644 index d3ad358..000 --- a/doc/wdread.1 +++ /dev/null @@ -1,31 +0,0 @@ -.TH wdread 1 15 August 2011 -.SH NAME -\fBwdread\fR \- read value from defaults database -.PP -.SH SYNOPSIS -.B wdread \fR[ \fI\-\-options \fR] -.PP -.SH DESCRIPTION -\fBwdread \fR\- read value from defaults database -.PP -.SH OPTIONS -.TP -.B \-\-help -\fRdisplay this help and exit -.TP -.B \-\-version -\fRoutput version information and exit -.TP -.B \-\-h -\fRlike \-\-help -.TP -.B \-\-v -\fRlike \-\-version -.PP -.SH AUTHOR -Window Maker was written by Alfredo K. Kojima koj...@windowmaker.info, -wdread is a part of Window Maker, was cowardly remade from wdwrite.c; -by judas@hell on Jan 26 2001 -.PP -This manpage was written by Rodolfo García Peñas (kix) for the -Debian GNU/Linux system (but may be used by others). diff --git a/doc/wdread.1x b/doc/wdread.1x new file mode 100644 index 000..e0c5cb2 --- /dev/null +++ b/doc/wdread.1x @@ -0,0 +1,31 @@ +.TH wdread 1x 15 August 2011 +.SH NAME +\fBwdread\fR \- read value from defaults database +.PP +.SH SYNOPSIS +.B wdread \fR[ \fI\-\-options \fR] +.PP +.SH DESCRIPTION +\fBwdread \fR\- read value from defaults database +.PP +.SH OPTIONS +.TP +.B \-\-help +\fRdisplay this help and exit +.TP +.B \-\-version +\fRoutput version information and exit +.TP +.B \-\-h +\fRlike \-\-help +.TP +.B \-\-v +\fRlike \-\-version +.PP +.SH AUTHOR +Window Maker was written by Alfredo K. Kojima koj...@windowmaker.info, +wdread is a part of Window Maker, was cowardly remade from wdwrite.c; +by judas@hell on Jan 26 2001 +.PP +This manpage was written by Rodolfo García Peñas (kix) for the +Debian GNU/Linux system (but may be used by others). -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 04/23] wmaker: created script to check program's options against documentation
In order to ease the job of keeping the documentations up to date, there is a new script 'check-cmdline-options' that checks a program's options (with the '--help' option) and compare them with its documentation (the manual page) to make sure everything is aligned. This is triggered with make check for wmaker. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- Makefile.am | 1 + doc/Makefile.am | 13 +++ script/check-cmdline-options-doc.sh | 156 3 files changed, 170 insertions(+) create mode 100755 script/check-cmdline-options-doc.sh diff --git a/Makefile.am b/Makefile.am index 2357d24..071d13f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -38,6 +38,7 @@ EXTRA_DIST = TODO BUGS BUGFORM FAQ INSTALL \ The-perfect-Window-Maker-patch.txt \ README COPYING.WTFPL autogen.sh \ email-clients.txt checkpatch.pl update-changelog.pl \ + script/check-cmdline-options-doc.sh \ script/check-translation-sources.sh \ script/generate-mapfile-from-header.sh \ script/generate-po-from-template.sh \ diff --git a/doc/Makefile.am b/doc/Makefile.am index f39079c..db69f90 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -25,3 +25,16 @@ man_MANS = \ EXTRA_DIST = $(man_MANS) +# Create a 'silent rule' for our make check the same way automake does +AM_V_CHKOPTS = $(am__v_CHKOPTS_$(V)) +am__v_CHKOPTS_ = $(am__v_CHKOPTS_$(AM_DEFAULT_VERBOSITY)) +am__v_CHKOPTS_0 = @echo CHK $@ ; +am__v_CHKOPTS_1 = + +check-local: wmaker-args + +wmaker-args: + $(AM_V_CHKOPTS)$(top_srcdir)/script/check-cmdline-options-doc.sh \ + --program $(top_builddir)/src/wmaker --man-page $(top_srcdir)/doc/wmaker.1x + +.PHONY: wmaker-args diff --git a/script/check-cmdline-options-doc.sh b/script/check-cmdline-options-doc.sh new file mode 100755 index 000..d2aa173 --- /dev/null +++ b/script/check-cmdline-options-doc.sh @@ -0,0 +1,156 @@ +#!/bin/sh +### +# +# Window Maker window manager +# +# Copyright (c) 2015 Christophe CURIS +# Copyright (c) 2015 Window Maker Team +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +### +# +# check-cmdline-options-doc.sh: +# Compare the options listed in a program's --help text against its +# documentation, check that all options are described and that there are +# not deprecated options in the doc. +# +# A know limitation is that it assumes the help text from the program is +# in line with what the program actually supports, because it would be too +# complicated to actually check also in the sources the supported options. +# +### +# +# For portability, we stick to the same sh+sed constraint as Autotools to +# limit problems, see for example: +# http://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Portable-Shell.html +# +### + +# Report an error on stderr and exit with status 2 to tell make that we could +# not do what we were asked +arg_error() { +echo `basename $0`: $@ 2 +exit 2 +} + +# print help and exit with success status +print_help() { +echo $0: check program's list of options against its documentation +echo Usage: $0 options... +echo valid options are: +echo --man-page file : program's documentation file, in man format +echo --program name: name of the program to run with '--help' +exit 0 +} + +# Extract command line arguments +while [ $# -gt 0 ]; do +case $1 in + --man-page) +shift +[ -z $man_page ] || arg_error only 1 documentation file can be used (option: --man-page) +man_page=$1 + ;; + + --program) +shift +[ -z $prog_name ] || arg_error only 1 program can be used (option: --program) +prog_name=$1 + ;; + +-h|-help|--help) print_help ;; +-*) arg_error unknow option '$1' ;; + +*) +arg_error argument '$1' is not understood + ;; +esac +shift +done + +# Check
[PATCH 23/23] Code refactoring: replaced macro 'XDND' by 'USE_DOCK_XDND' for consistency
The usual way to define a macro in is to name macro with 'USE_xxx' when they are used to enable a feature 'xxx'. As the feature concerns the Dock and not DnD in general (WINGs support is not disabled), make it a bit more clear in the macro name and document the configure flag in the Installation Manual. Took opportunity to compile the corresponding file only when the feature is not disabled. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- configure.ac | 7 --- doc/build/Compilation.texi | 5 + src/Makefile.am| 4 +++- src/appicon.c | 8 src/appicon.h | 2 +- src/dialog.c | 2 +- src/dock.c | 30 +++--- src/dock.h | 2 +- src/dockedapp.c| 8 src/event.c| 8 src/misc.c | 4 ++-- src/screen.h | 2 +- src/startup.c | 4 ++-- src/xdnd.c | 14 +++--- 14 files changed, 54 insertions(+), 46 deletions(-) diff --git a/configure.ac b/configure.ac index 4e55a94..6a02376 100644 --- a/configure.ac +++ b/configure.ac @@ -502,15 +502,16 @@ AS_IF([test x$enable_modelock = xyes], dnl XDND Drag-nd-Drop support dnl = AC_ARG_ENABLE([xdnd], -[AS_HELP_STRING([--disable-xdnd], [disable Drag-nd-Drop support])], +[AS_HELP_STRING([--disable-xdnd], [disable support for Drag-and-Drop on the dock @:@default=enabled@:@])], [AS_CASE([$enableval], [yes|no], [], [AC_MSG_ERROR([bad value $enableval for --disable-xdnd]) ]) ], [enable_xdnd=yes]) AS_IF([test x$enable_xdnd = xyes], -[supported_xext=$supported_xext XDnD - AC_DEFINE([XDND], [1], [whether Drag-nd-Drop support should be enabled])], +[supported_core=$supported_core XDnD + AC_DEFINE([USE_DOCK_XDND], [1], [whether Drag-and-Drop on the dock should be enabled])], [unsupported=$unsupported XDnd]) +AM_CONDITIONAL([USE_DOCK_XDND], [test x$enable_dock_xdnd != xno]) dnl XShape support diff --git a/doc/build/Compilation.texi b/doc/build/Compilation.texi index bffad76..cb19a6d 100644 --- a/doc/build/Compilation.texi +++ b/doc/build/Compilation.texi @@ -571,6 +571,11 @@ Disable support for Motif's MWM Window Manager hints. These attributes were introduced by the Motif toolkit to ask for special window appearance requests. Nowadays this is covered by the NetWM/EWMH specification, but there are still applications that rely on MWM Hints. +@item --disable-xdnd +Disable support for dragging and dropping files on the dock, which launches a user-specified command +with that file. +Starting from version 0.65.6 this feature is enabled by default. + @item --enable-ld-version-script This feature is auto-detected, and you should not use this option. When compiling a library (@file{wrlib}, ...), @emph{gcc} has the possibility to filter the list of diff --git a/src/Makefile.am b/src/Makefile.am index 56ebe08..7fe9db7 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -84,7 +84,6 @@ wmaker_SOURCES = \ usermenu.c \ usermenu.h \ xdnd.h \ - xdnd.c \ xinerama.h \ xinerama.c \ xmodifier.h \ @@ -108,6 +107,9 @@ wmaker_SOURCES =\ wsmap.c \ wsmap.h +if USE_DOCK_XDND +wmaker_SOURCES += xdnd.c +endif if USE_MWM_HINTS wmaker_SOURCES += motif.h motif.c endif diff --git a/src/appicon.c b/src/appicon.c index ed03ffc..14dba97 100644 --- a/src/appicon.c +++ b/src/appicon.c @@ -51,7 +51,7 @@ #include placement.h #include misc.h #include event.h -#ifdef XDND +#ifdef USE_DOCK_XDND #include xdnd.h #endif @@ -130,7 +130,7 @@ WAppIcon *wAppIconCreateForDock(WScreen *scr, const char *command, const char *w tile = TILE_CLIP; aicon-icon = icon_create_for_dock(scr, command, wm_instance, wm_class, tile); -#ifdef XDND +#ifdef USE_DOCK_XDND wXDNDMakeAwareness(aicon-icon-core-window); #endif @@ -309,7 +309,7 @@ static WAppIcon *wAppIconCreate(WWindow *leader_win) aicon-wm_instance = wstrdup(leader_win-wm_instance); aicon-icon = icon_create_for_wwindow(leader_win); -#ifdef XDND +#ifdef USE_DOCK_XDND wXDNDMakeAwareness(aicon-icon-core-window); #endif @@ -332,7 +332,7 @@ void wAppIconDestroy(WAppIcon * aicon) wIconDestroy(aicon-icon); if (aicon-command) wfree(aicon-command); -#ifdef XDND +#ifdef USE_DOCK_XDND if (aicon-dnd_command) wfree(aicon-dnd_command); #endif diff --git a/src/appicon.h b/src/appicon.h index 2456ba2..eb1904b 100644 --- a/src/appicon.h +++ b/src/appicon.h @@ -37,7 +37,7 @@ typedef struct WAppIcon { WIcon *icon; int x_pos, y_pos; /* absolute screen coordinate */ char *command; /* command used to launch app */ -#ifdef XDND +#ifdef USE_DOCK_XDND char
[PATCH 13/23] texi2txt: add support for the @table command
The texinfo format provides a command '@table' which is useful to provide a list of object (function, variables, options, ...) with their associated description. As this will be very handy for the Installation Manual, this patch implements the command in the script. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- script/generate-txt-from-texi.sh | 65 +++- 1 file changed, 64 insertions(+), 1 deletion(-) diff --git a/script/generate-txt-from-texi.sh b/script/generate-txt-from-texi.sh index 74f17b2..e56d78a 100755 --- a/script/generate-txt-from-texi.sh +++ b/script/generate-txt-from-texi.sh @@ -468,6 +468,28 @@ function start_item_list(mark, type, default_mark) { write_line(); } +# One item in a Table +function generate_item_in_table(line) { + if (line !~ /^[ \t]*@itemx?[ \t]/) { +report_error(bas usage for @item inside a @table, should be at start of line and followed by its value); + } + + generate_paragraph(); + if (list_item_wants_sepline !list_is_first_item) { +write_line(); + } + + # Apply the global table style to this item + gsub(/^[ \t]*@itemx?[ \t]*/, , line); + line = execute_commands(item_list_mark { line }); + + # Cancel the indentation added for the 2nd column for that line + line = substr(line_prefix, 1, length(line_prefix)-5) line; + write_line(line); + + list_item_wants_sepline = 0; +} + # Generate Underline string with the specified length function gen_underline(id, len, local) { if (id == -1) { local = ; } else @@ -578,6 +600,13 @@ function generate_paragraph( local_prefix, local_line, local_length, } } + } else if (par_mode == table) { +if (list_item_wants_sepline !list_is_first_item) { + write_line(); +} +list_is_first_item = 0; +list_item_wants_sepline = 0; + } else if (par_mode == titlepage) { write_line(); @@ -712,6 +741,9 @@ function execute_commands(line, replaced_line, command) { replaced_line = replaced_line '`LANG=C date '+%d %B %Y' | sed -e 's,^0,,' `'; # Commands to display text in a special style ## +} else if (command == asis) { + line = cmdargs line; + } else if (command == b) { # bold line = * cmdargs * line; @@ -812,6 +844,11 @@ function process_end(line) { par_mode_pop(quotation); par_indent = 1; + } else if ((line == table) || (line == ftable) || (line == vtable)) { +generate_paragraph(); +par_mode_pop(table); +par_indent = 1; + } else if (line == titlepage) { generate_page_break(); par_mode_pop(titlepage); @@ -988,6 +1025,28 @@ BEGIN { } next; +} else if ((command == table) || + (command == ftable) || + (command == vtable)) { + # ftable and vtable are the same as table except they are adding automatically + # the item to the appropriate Index (respectively Function and Variable indexes). + # As we do not generate index in the text file, we just treat them identically + if (cond_state) { +generate_paragraph(); +par_mode_push(table); +list_is_first_item = 1; +list_item_wants_sepline = 0; +par_indent = 1; +line_prefix = line_prefix ; +gsub(/[ \t]/, , line); +if (line !~ /^@[a-z][a-z]*$/) { + report_error(invalid usage of @table, expecting a single style-changing command); +} +item_list_mark = line; +write_line(); + } + next; + } else if (command == titlepage) { generate_title_page(); next; @@ -1123,7 +1182,10 @@ BEGIN { # We treat @item specially because it may generate more than 1 paragraph if (!cond_state) { next; } - if ((par_mode != list) (par_mode != enum)) { + if (par_mode == table) { +generate_item_in_table($0); +next; + } else if ((par_mode != list) (par_mode != enum)) { report_error(found @item at line NR but not inside an @itemize); } @@ -1154,6 +1216,7 @@ BEGIN { if ((par_mode == list) || (par_mode == enum) || (par_mode == par) || + (par_mode == table) || (par_mode == titlepage) || (par_mode == quotation)) { if (/^[ \t]*$/) { -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 14/23] texi2txt: add support for making cross-references in the document
The texinfo format provides 3 commands @ref, @xref and @pxref to make cross references to existing @nodes in the document; it also provides a command @anchor to place arbitrary targets for cross-reference. Because these will be handy for the Installation Manual that already does some references, this patch implements the 4 commands: - change the '@node' command, that did nothing, to now track potential reference points; - add the '@anchor' command to register a new target for x-ref; - implement the 3 '@*ref' commands with similar behaviour as the texinfo format states, with support for all arguments, generating a temporary @x##@ pattern for the line target; - generate a new file (*.xrf, a sed script) at the end with the replacement for x-ref patterns with the correct line number, and perform a few consistency checks; - during the final search-and-replace used to insert the Table of Content, include the x-ref replacement. The current script has some limitations: - because we cannot know in advance the target line number for the x-ref, we insert it with a constant size of 5 characters to avoid breaking the justification alignment when doing the replace; - there is a strict order to respect between @node and @chapter/@section, which is needed because we have to include a line offset to get it right when using the order given in the texinfo manual. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- script/generate-txt-from-texi.sh | 129 +-- 1 file changed, 125 insertions(+), 4 deletions(-) diff --git a/script/generate-txt-from-texi.sh b/script/generate-txt-from-texi.sh index e56d78a..5554e6e 100755 --- a/script/generate-txt-from-texi.sh +++ b/script/generate-txt-from-texi.sh @@ -60,6 +60,10 @@ # - There are 2 blank lines instead of 1 before chapter/section to make # them stand out more # +# - when making cross-references, generate a decent-looking string with +# the target line number, instead of the crypting *Note: label (inherited +# from info format) that looks out of place +# # - the line length is set to 76 instead of 72 # # - there are some difference in what characters are added when a style is @@ -73,6 +77,13 @@ # - not all commands are implemented, some because they were not needed # so far, probably a few because they would be too complex to implement # +# +# There are a few limitations due to Texinfo being a cheesy format: +# +# - the @node should be followed immediately by its @chapter/@section +# command, otherwise you may have mismatch on the line number if you make a +# cross-reference to that @node +# ### # # Please note that this script is writen in sh+awk on purpose: this script @@ -157,6 +168,7 @@ done # Create the temp file in the current directory temp_file=`echo $input_file | sed -e 's,^.*/\([^/]*\)$,\1, ; s,\.[^.]*$,,' `.tmp toc_file=`echo $temp_file | sed -e 's,\.[^.]*$,,' `.toc +xref_file=`echo $temp_file | sed -e 's,\.[^.]*$,,' `.xrf # Run awk for 1st pass, but if it fails stop now without deleting temp files awk ' @@ -448,6 +460,36 @@ function new_section(level, title, is_numbered, local_i, local_line) { par_indent = 0; } +# Do not generate anything for Node command, but keep the line information so +# the nodes can be cross-referenced +function new_node(args,local_nb, local_arr, local_i) { + if (!cond_state) { return; } + + # Dump the current paragraph now + generate_paragraph(); + + # The command takes many arguments, separate them because we care only for the 1st + local_nb = split(args, local_arr, ,); + if ((local_nb 1) || (local_nb 4)) { +report_error(bad number of argument local_nb for @node at line NR); + } + gsub(/^[ \t]*/, , local_arr[1]); + gsub(/[ \t]*$/, , local_arr[1]); + if (local_arr[1] == ) { +report_error(missing node name for @node at line NR); + } + + # Consistency check + if (node_address[local_arr[1]] != ) { +report_error(node \ local_arr[1] \ is redefined at line NR , previous definition at line node_defline[local_arr[1]]); + } + + # Add a +3 offset to compensate for the position of the real location that will be the + # chapter/section that should be following + node_address[local_arr[1]] = line_number + 3; + node_defline[local_arr[1]] = NR; +} + # List of Items function start_item_list(mark, type, default_mark) { par_mode_push(type); @@ -521,6 +563,48 @@ function generate_url_reference(args, local_nb, local_arr) { } } +# Generate text for a Cross-Reference into the document +function generate_cross_reference(args, cmd, local_nb, local_arr, local_i) { + local_nb = split(args, local_arr, ,); + if ((local_nb 1) || (local_nb 5)) { +report_error(bad number of argument local_nb for @ cmd at line NR); + } + + local_arr[1] = execute_commands(local_arr[1]); + for (local_i = 1; local_i = local_nb
[PATCH 18/23] check the configure option list against the INSTALL-WMAKER documentation
In order to ease the job of keeping the documentation aligned against the sources, this patch adds a check of the list of options returned by configure --help against the options that are listed in the INSTALL-WMAKER file. The check is ran as part of make check, which also implies it will break a make distcheck operation when not in line. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- Makefile.am | 14 script/check-cmdline-options-doc.sh | 43 ++--- 2 files changed, 54 insertions(+), 3 deletions(-) diff --git a/Makefile.am b/Makefile.am index 84493cb..a6221e9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -85,3 +85,17 @@ else endif .PHONY: update-lang + +# Create a 'silent-rule' for our make check the same way automake does +AM_V_CHKOPTS = $(am__v_CHKOPTS_$(V)) +am__v_CHKOPTS_ = $(am__v_CHKOPTS_$(AM_DEFAULT_VERBOSITY)) +am__v_CHKOPTS_0 = @echo CHK $@ ; +am__v_CHKOPTS_1 = + +check-local: configure-documentation + +configure-documentation: + $(AM_V_CHKOPTS)$(top_srcdir)/script/check-cmdline-options-doc.sh \ + --program $(top_srcdir)/configure --text-doc $(top_srcdir)/INSTALL-WMAKER + +.PHONY: configure-documentation diff --git a/script/check-cmdline-options-doc.sh b/script/check-cmdline-options-doc.sh index d2aa173..76ad9f7 100755 --- a/script/check-cmdline-options-doc.sh +++ b/script/check-cmdline-options-doc.sh @@ -53,6 +53,7 @@ print_help() { echo valid options are: echo --man-page file : program's documentation file, in man format echo --program name: name of the program to run with '--help' +echo --text-doc file : program's documentation file, in plain text format exit 0 } @@ -61,7 +62,7 @@ while [ $# -gt 0 ]; do case $1 in --man-page) shift -[ -z $man_page ] || arg_error only 1 documentation file can be used (option: --man-page) +[ -z $man_page$text_doc ] || arg_error only 1 documentation file can be used (option: --man-page) man_page=$1 ;; @@ -71,6 +72,12 @@ while [ $# -gt 0 ]; do prog_name=$1 ;; +--text-doc) +shift +[ -z $man_page$text_doc ] || arg_error only 1 documentation file can be used (option: --text-doc) +text_doc=$1 + ;; + -h|-help|--help) print_help ;; -*) arg_error unknow option '$1' ;; @@ -83,9 +90,10 @@ done # Check consistency of command-line [ -z $prog_name ] arg_error no program given (option: --program) -[ -z $man_page ] arg_error no documentation given +[ -z $man_page$text_doc ] arg_error no documentation given [ -z $man_page ] || [ -r $man_page ] || arg_error man page file '$man_page' is not readable (option: --man-page) +[ -z $text_doc ] || [ -r $text_doc ] || arg_error text file '$text_doc' is not readable (option: --text-doc) # Make sure the program will not be searched in $PATH if ! echo $prog_name | grep '/' /dev/null ; then @@ -125,11 +133,40 @@ fi # If no problem is found, we will exit with status OK exit_status=0 + +if [ -n $text_doc ]; then + # In the plain-text format, there is no specific identification for the options, + # as they may be described anywhere in the document. So we first try to get + # everything that looks like a long option: + sed_script=':restart + /^\(.*[^-A-Za-z_0-9]\)*--[A-Za-z0-9]/ { +h +s/^.*--/--/ +s/[^-A-Z_a-z0-9].*$// +p + +g +s/^\(.*\)--[A-Za-z0-9][-A-Z_a-z0-9]*/\1/ +b restart + }' + doc_options=`sed -n $sed_script $text_doc ` + + # then we also explicitely search for the short options we got from the program + for opt in `echo $prog_options | grep '^-[^-]' ` + do +if grep ^\\(.*[^-A-Za-z_0-9]\\)*$opt\\([^-A-Za-z_0-9].*\\)\$ $text_doc /dev/null ; then + doc_options=$doc_options +$opt +fi + done +fi + + # Check that all program options are documented for opt in $prog_options do if ! echo $doc_options | grep ^$opt\$ /dev/null ; then -echo Error: program option '$opt' is not in the documentation '$man_page' +echo Error: program option '$opt' is not in the documentation '$man_page$text_doc' exit_status=1 fi done -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 20/23] check-doc: add an option to ignore some explicit options from the command's help
There are a few rare cases where some options listed in the program's built-in help page may not be documented for a valid reason. This patch provides an option to the checking script to not complain about them, but: - the listed options must include a comment about why, to ensure that the user thinks twice about it and because it is better for maintainability; - the listed option must be part of the options listed by the application to ensure the command line invocation of the script will remain up to date. This new option is then used for the check of the configure options because for a few of them the right place to document them is in the INSTALL file provided by Autoconf and not in our Window Maker specific doc. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- Makefile.am | 11 ++- script/check-cmdline-options-doc.sh | 23 +++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index a6221e9..5b52d1a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -96,6 +96,15 @@ check-local: configure-documentation configure-documentation: $(AM_V_CHKOPTS)$(top_srcdir)/script/check-cmdline-options-doc.sh \ - --program $(top_srcdir)/configure --text-doc $(top_srcdir)/INSTALL-WMAKER + --program $(top_srcdir)/configure --text-doc $(top_srcdir)/INSTALL-WMAKER \ + --ignore-prg 'with-PACKAGE,without-PACKAGE # only template names from Autoconf' \ + --ignore-prg 'program-prefix,program-suffix,program-transform-name # in INSTALL' \ + --ignore-prg 'version,quiet,srcdir,build,host,cache-file,no-create # in INSTALL' \ + --ignore-prg 'enable-silent-rules,disable-silent-rules # should be in INSTALL' \ + --ignore-prg 'enable-dependency-tracking,disable-dependency-tracking # in INSTALL' \ + --ignore-prg 'enable-shared,enable-static # should be in INSTALL' \ + --ignore-prg 'disable-option-checking,enable-fast-install # should be in INSTALL' \ + --ignore-prg 'disable-libtool-lock,with-pic,with-gnu-ld,with-sysroot # for libtool' \ + --ignore-prg 'with-x # no use, it would not work without X' .PHONY: configure-documentation diff --git a/script/check-cmdline-options-doc.sh b/script/check-cmdline-options-doc.sh index 76ad9f7..ff4a4be 100755 --- a/script/check-cmdline-options-doc.sh +++ b/script/check-cmdline-options-doc.sh @@ -51,6 +51,8 @@ print_help() { echo $0: check program's list of options against its documentation echo Usage: $0 options... echo valid options are: +echo --ignore-prg arg : ignore option '--arg' from program's output +echo (syntax: 'arg1,arg2,... # reason', args without leading '--') echo --man-page file : program's documentation file, in man format echo --program name: name of the program to run with '--help' echo --text-doc file : program's documentation file, in plain text format @@ -60,6 +62,16 @@ print_help() { # Extract command line arguments while [ $# -gt 0 ]; do case $1 in +--ignore-prg) +shift +echo $1 | grep '#' /dev/null || echo Warning: no reason provided for --ignore-prg on \$1\ 2 +for arg in `echo $1 | sed -e 's/#.*$// ; s/,/ /g' ` +do +ignore_arg_program=$ignore_arg_program +--$arg +done + ;; + --man-page) shift [ -z $man_page$text_doc ] || arg_error only 1 documentation file can be used (option: --man-page) @@ -112,6 +124,17 @@ prog_options=`$prog_name --help | sed -n '/^[ \t]*-/ { s/^[ \t]*// ; s/^-[^-],[ [ x$prog_options = x ] arg_error program '$prog_name --help' did not return any option +# We filter options that user wants us to, but we warn if the user asked to filter an option that is +# not actually present, to make sure his command line invocation stays up to date +for filter in $ignore_arg_program +do + if echo $prog_options | grep ^$filter\$ /dev/null ; then +prog_options=`echo $prog_options | grep -v ^$filter\$ ` + else +echo Warning: program's option does not contain \$filter\, specified in \--ignore-prg\ + fi +done + if [ -n $man_page ]; then # In the man page format, the options must be grouped in the section OPTIONS -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 17/23] doc: removed a few deprecated stuff from the Installation Manual
Setting LANG/LINGUAS to en_RN should not be a problem with the current configure script, so don't mention it; Removed the section about the WindowMaker-extra package, because this things looks to be deprecated; Removed the 2 errors related to configure, because as the Autotool versions is now specified in the configure.ac this situation should not arise. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- doc/build/Compilation.texi | 31 --- 1 file changed, 31 deletions(-) diff --git a/doc/build/Compilation.texi b/doc/build/Compilation.texi index 79376bd..51d53d7 100644 --- a/doc/build/Compilation.texi +++ b/doc/build/Compilation.texi @@ -456,9 +456,6 @@ If you use it, be sure to follow the steps below or @sc{Window Maker} will not w if you installed the @sc{Window Maker} that comes with @emph{RedHat}, uninstall it before upgrading; @item -make sure you don't have the @env{LANG} and @env{LINGUAS} environment variables set to @code{en_RN}; - -@item make sure you have @file{/usr/local/bin} in your @env{PATH} environment variable; @item @@ -489,16 +486,6 @@ Or use a different X server. @end itemize -@section Installing the extras package - -Unpack @file{WindowMaker-extra-@emph{version-number}.tar.gz} in @file{/usr/local/share} - -You can get the file at @uref{http://windowmaker.org/pub/source/release/}. -This file is optional and only have a few icons, and themes. -Look for the latest @emph{version-number} available. -Also there is a @file{WindowMaker-extra.readme} to instruct you where that package should go. - - @section I don't have the @emph{root} password :( @anchor{No Root Password} @@ -550,19 +537,6 @@ or try rebuilding without NLS support, which is done with: @end example -@section Error when configuring - -@example -ltconfig: unrecognized option `--no-reexec' -Try `ltconfig --help' for more information. -configure: error: libtool configure failed -@end example - -remove the @option{--no-reexec} option from @file{aclocal.m4} and reconfigure. -Also make sure the @emph{autoconf}, @emph{automake} and @emph{libtool} versions you have installed are in line with the versions -listed in @ref{Special Dependencies}. - - @section configure doesn't detect @emph{libtiff}, or other graphic libraries Delete @file{config.cache}, then rerun configure adding the following options to @command{configure} @@ -606,10 +580,5 @@ You should check the output of @command{wmaker} for an error, it may be visible @file{.xsession-errors} file. -@section checking lex output file root... configure: error: cannot find output from true; giving up - -Read the @ref{Software Dependencies}. - - @c - The End --- @bye -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 08/23] doc: add check of the program options against their man pages
The program WPrefs and most of the programs in the util/ directory have a man page, this patch adds the appropriate call to the checking script when make check is used. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- doc/Makefile.am | 54 -- 1 file changed, 52 insertions(+), 2 deletions(-) diff --git a/doc/Makefile.am b/doc/Makefile.am index 139b65c..904e3d8 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -42,10 +42,60 @@ am__v_CHKOPTS_ = $(am__v_CHKOPTS_$(AM_DEFAULT_VERBOSITY)) am__v_CHKOPTS_0 = @echo CHK $@ ; am__v_CHKOPTS_1 = -check-local: wmaker-args +check-local: wmaker-args WPrefs-args wmagnify-args geticonset-args getstyle-args seticons-args setstyle-args \ + wdread-args wdwrite-args wmgenmenu-args wmsetbg-args wxcopy-args wxpaste-args wmaker-args: $(AM_V_CHKOPTS)$(top_srcdir)/script/check-cmdline-options-doc.sh \ --program $(top_builddir)/src/wmaker --man-page wmaker.1x -.PHONY: wmaker-args +WPrefs-args: + $(AM_V_CHKOPTS)$(top_srcdir)/script/check-cmdline-options-doc.sh \ + --program $(top_builddir)/WPrefs.app/WPrefs --man-page $(top_srcdir)/doc/WPrefs.1x + +wmagnify-args: + $(AM_V_CHKOPTS)$(top_srcdir)/script/check-cmdline-options-doc.sh \ + --program $(top_builddir)/util/wmagnify --man-page $(top_srcdir)/doc/wmagnify.1x + +geticonset-args: + $(AM_V_CHKOPTS)$(top_srcdir)/script/check-cmdline-options-doc.sh \ + --program $(top_builddir)/util/geticonset --man-page $(top_srcdir)/doc/geticonset.1x + +getstyle-args: + $(AM_V_CHKOPTS)$(top_srcdir)/script/check-cmdline-options-doc.sh \ + --program $(top_builddir)/util/getstyle --man-page $(top_srcdir)/doc/getstyle.1x + +seticons-args: + $(AM_V_CHKOPTS)$(top_srcdir)/script/check-cmdline-options-doc.sh \ + --program $(top_builddir)/util/seticons --man-page $(top_srcdir)/doc/seticons.1x + +setstyle-args: + $(AM_V_CHKOPTS)$(top_srcdir)/script/check-cmdline-options-doc.sh \ + --program $(top_builddir)/util/setstyle --man-page $(top_srcdir)/doc/setstyle.1x + +wdread-args: + $(AM_V_CHKOPTS)$(top_srcdir)/script/check-cmdline-options-doc.sh \ + --program $(top_builddir)/util/wdread --man-page $(top_srcdir)/doc/wdread.1x + +wdwrite-args: + $(AM_V_CHKOPTS)$(top_srcdir)/script/check-cmdline-options-doc.sh \ + --program $(top_builddir)/util/wdwrite --man-page $(top_srcdir)/doc/wdwrite.1x + +wmgenmenu-args: + $(AM_V_CHKOPTS)$(top_srcdir)/script/check-cmdline-options-doc.sh \ + --program $(top_builddir)/util/wmgenmenu --man-page $(top_srcdir)/doc/wmgenmenu.1 + +wmsetbg-args: + $(AM_V_CHKOPTS)$(top_srcdir)/script/check-cmdline-options-doc.sh \ + --program $(top_builddir)/util/wmsetbg --man-page $(top_srcdir)/doc/wmsetbg.1x + +wxcopy-args: + $(AM_V_CHKOPTS)$(top_srcdir)/script/check-cmdline-options-doc.sh \ + --program $(top_builddir)/util/wxcopy --man-page $(top_srcdir)/doc/wxcopy.1x + +wxpaste-args: + $(AM_V_CHKOPTS)$(top_srcdir)/script/check-cmdline-options-doc.sh \ + --program $(top_builddir)/util/wxpaste --man-page $(top_srcdir)/doc/wxpaste.1x + +.PHONY: wmaker-args WPrefs-args wmagnify-args geticonset-args getstyle-args seticons-args setstyle-args \ + wdread-args wdwrite-args wmgenmenu-args wmsetbg-args wxcopy-args wxpaste-args -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 10/23] doc: the man page for wmsetbg is now processed by a script
Because the tool's help page changes whether Xinerama support was compiled or not, its man page have to reflect this, so instead of being simply copied the file is processed with the 'replace-ac-keywords' script. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- doc/Makefile.am | 15 +--- doc/wmsetbg.1x | 110 doc/wmsetbg.in | 110 3 files changed, 120 insertions(+), 115 deletions(-) delete mode 100644 doc/wmsetbg.1x create mode 100644 doc/wmsetbg.in diff --git a/doc/Makefile.am b/doc/Makefile.am index 904e3d8..fff203f 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -17,17 +17,17 @@ dist_man_MANS = \ wmagnify.1x \ wmgenmenu.1 \ wmmenugen.1 \ - wmsetbg.1x \ WPrefs.1x \ wxcopy.1x \ wxpaste.1x man_MANS = \ - wmaker.1x + wmaker.1x \ + wmsetbg.1x -MOSTLYCLEANFILES = wmaker.1x +MOSTLYCLEANFILES = wmaker.1x wmsetbg.1x -EXTRA_DIST = wmaker.in +EXTRA_DIST = wmaker.in wmsetbg.in wmaker.1x: wmaker.in Makefile $(top_builddir)/config.h $(AM_V_GEN)$(top_srcdir)/script/replace-ac-keywords.sh \ @@ -36,6 +36,11 @@ wmaker.1x: wmaker.in Makefile $(top_builddir)/config.h -Dpkgdatadir=$(pkgdatadir) --replace pkgdatadir \ -o wmaker.1x $(srcdir)/wmaker.in +wmsetbg.1x: wmsetbg.in Makefile $(top_builddir)/config.h + $(AM_V_GEN)$(top_srcdir)/script/replace-ac-keywords.sh \ + --header $(top_builddir)/config.h --filter USE_XINERAMA \ + -o wmsetbg.1x $(srcdir)/wmsetbg.in + # Create a 'silent rule' for our make check the same way automake does AM_V_CHKOPTS = $(am__v_CHKOPTS_$(V)) am__v_CHKOPTS_ = $(am__v_CHKOPTS_$(AM_DEFAULT_VERBOSITY)) @@ -87,7 +92,7 @@ wmgenmenu-args: wmsetbg-args: $(AM_V_CHKOPTS)$(top_srcdir)/script/check-cmdline-options-doc.sh \ - --program $(top_builddir)/util/wmsetbg --man-page $(top_srcdir)/doc/wmsetbg.1x + --program $(top_builddir)/util/wmsetbg --man-page wmsetbg.1x wxcopy-args: $(AM_V_CHKOPTS)$(top_srcdir)/script/check-cmdline-options-doc.sh \ diff --git a/doc/wmsetbg.1x b/doc/wmsetbg.1x deleted file mode 100644 index 2125ad0..000 --- a/doc/wmsetbg.1x +++ /dev/null @@ -1,110 +0,0 @@ -.\ Hey, Emacs! This is an -*- nroff -*- source file. -.TH wmsetbg 1x April 2015 -.SH NAME -wmsetbg \- sets the background on the X11 display -.SH SYNOPSIS -.B wmsetbg -.RI [ \-display display] -.RI [ \-\-update-domain domain| \-\-update-wmaker ] -.RI [ options ] -.RI [ image ] -.SH DESCRIPTION -.B wmsetbg -reads the specified -.I image -(in any format supported by the -.I WRaster -library) and puts it on the root window. It can -either scale the image or tile it to make it fit the root -window. Window Maker uses this command internally to set the root -window image on start up. -.SH OPTIONS -.TP -.BR \-\-back\-color | \-b \fIcolor\fP -the specified \fIcolor\fP is used as the background color for the -\fItexture\fP. Window Maker temporary sets the background to this -color while loading and processing the texture. You can specify colors -using their X11 names or as an RGB triplet (either as rgb:RR/GG/BB or -#RRGGBB) (reference to appropriate manpage should be here). In the -later case \fIcolor\fB is a quoted string. -.TP -.BR \-\-center | \-e -centers the \fIimage\fP in the screen -.TP -.BR \-\-colors | \-c \fIcount\fP -limit the number of colors per channel to use for the image -.TP -.BR \-display \fIdisplay\fP -connect to the X \fIdisplay\fP -.TP -.BR \-\-dither | \-d -enable color dithering on \fIimage\fP -.TP -.BR \-\-fillscale | \-f -scales the specified \fIimage\fP to fill screen while preserving aspect ratio -.TP -.BR \-\-help | \-h -print a help message with the list of options -.TP -.BR \-\-match | \-m -use the best-matching-color algorithm when converting image to indexed color palette -.TP -.BR \-\-maxscale | \-a -scales the specified \fIimage\fP to fit inside the screen preserving its aspect ratio -.TP -.BR \-\-parse | \-p \fItexture\fP -parses the specified \fItexture\fP as a \fIproplist style texture\fP -.TP -.BR \-\-scale | \-s -scales the specified \fIimage\fP to fill the screen (default) -.TP -.BR \-\-smooth | \-S -use a smooth scaling algorithm when resizing \fIimage\fP -.TP -.BR \-\-tile | \-t -tiles the specified \fIimage\fP -.TP -.BR \-\-update\-domain | \-D \fIdomain\fP -updates the specified \fIdomain\fP database -.TP -.BR \-\-update\-wmaker | \-u -updates the Window Maker defaults database -.TP -.BR \-\-version | \-v -print the version of Window Maker from which the program comes -.TP -.BR \-\-workspace | \-w \fIworkspace\fP -update background only for the specified \fIworkspace\fP -.TP -.BR \-\-xinerama | \-X -stretch image across Xinerama heads -.SH INDEXED COLOR SCREENS -If your screen is not in a \fBTrue Color\fP configuration
[PATCH 09/23] doc: updated man pages for many tools
This patch perform simple fixes to the man pages and tool help page: - minor style updates, to get cleaner pages - option re-ordering, to have them in alphabetic order (easier to search for) - consistency updates for descriptions and number of dash - spell-checking The biggest changes are: - wmagnify: the option 'vdisplay' was not documented at all; - getstyle: the list of attributes that are taken for the Style are now described in their own section to clarify the page; - setstyle: the help page left thinking that the file argument was optional, which is not the case; - wdread: as the Exit Code may be useful, and it is not unusable, it is now documented; - wmgenmenu: added information about how the content of the menu is generated; - wmsetbg: added a section about dithering/best-match because as nowadays most screens are in True Color, the reason for the option may not be clear. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- doc/WPrefs.1x | 14 +++ doc/geticonset.1x | 18 + doc/getstyle.1x | 67 + doc/seticons.1x | 10 +++-- doc/setstyle.1x | 55 ++- doc/wdread.1x | 32 +++- doc/wdwrite.1x| 8 ++-- doc/wmagnify.1x | 34 ++--- doc/wmgenmenu.1 | 24 ++-- doc/wmsetbg.1x| 109 +- doc/wxcopy.1x | 30 +-- doc/wxpaste.1x| 23 +++- util/seticons.c | 2 +- util/wmagnify.c | 8 ++-- util/wmsetbg.c| 2 +- util/wxpaste.c| 4 +- 16 files changed, 254 insertions(+), 186 deletions(-) diff --git a/doc/WPrefs.1x b/doc/WPrefs.1x index 551ec5b..cddf90a 100644 --- a/doc/WPrefs.1x +++ b/doc/WPrefs.1x @@ -1,9 +1,9 @@ -.TH Window Maker 1x March 2001 Debian Project +.TH WPrefs 1x March 2001 .SH NAME WPrefs \- Window Maker configuration tool .SH SYNOPSIS .B WPrefs -.I [-options] +.RI [ options ] .SH DESCRIPTION WPrefs.app is the preferences editor for the WindowMaker window manager. It can be used to set most of the preference options of WindowMaker and define @@ -18,14 +18,14 @@ of WindowMaker that are not related to configuration. system-wide configuration file is saved.\fP .SH OPTIONS .TP -.B \-display host:display.screen +.BI \-display host:display.screen specify display to use. .TP -.B \-\-version -display version number and exit -.TP .B \-\-help -display help message and exit +print a help message with the list of options +.TP +.B \-\-version +print the version of Window Maker from which the program comes .SH FILES .TP .B ~/GNUstep/Defaults/WindowMaker diff --git a/doc/geticonset.1x b/doc/geticonset.1x index 03cb92b..812f82d 100644 --- a/doc/geticonset.1x +++ b/doc/geticonset.1x @@ -1,27 +1,29 @@ .\ Hey, Emacs! This is an -*- nroff -*- source file. .TH geticonset 1x January 1999 .SH NAME -geticonset \- gets the current Window Maker iconset +geticonset \- gets the current Window Maker icon set .SH SYNOPSIS .B geticonset -.I [options] [iconsetfile] +.RI [ options ] +.RI [ iconsetfile ] .SH DESCRIPTION .B geticonset -reads the WMWindowAttributes domain, and writes the iconset found -there either to stdout or to -.I iconsetfile. +reads the +.I WMWindowAttributes +domain, and writes the icon set found there either to stdout or to the file +.IR iconsetfile . .SH OPTIONS .TP .B \-\-help -print a help message +print a help message with the list of options .TP .B \-\-version -print version number +print the version of Window Maker from which the program comes .SH ENVIRONMENT .IP GNUSTEP_USER_ROOT specifies the initial path for the Defaults directory. Defaults/ is appended to this variable to determine the actual location of the -databases. If the varialbe is not set, it defaults to ~/GNUstep +databases. If the variable is not set, it defaults to ~/GNUstep .SH FILES .IP GNUSTEP_USER_ROOT/Defaults/WMWindowAttributes is the actual file that's read. diff --git a/doc/getstyle.1x b/doc/getstyle.1x index decf02b..12681c0 100644 --- a/doc/getstyle.1x +++ b/doc/getstyle.1x @@ -1,55 +1,58 @@ .\ Hey, Emacs! This is an -*- nroff -*- source file. -.TH getstyle 1x January 1999 +.TH getstyle 1x April 2015 .SH NAME getstyle \- dumps the current Window Maker style related configuration or creates a theme pack. .SH SYNOPSIS .B getstyle -[[\-t|\-\-theme-options] [\-p|\-\-pack] [style file]] +.RI [ \-t | \-\-theme-options ] [ \-p | \-\-pack ] [ style file ] .SH DESCRIPTION .B getstyle can either dump the current Window Maker style related configuration information to a file/stdout or create a self-contained theme pack. A theme -pack is a directory that contains everything that is needed by a +pack is a directory that contains everything that is needed for a redistributable theme, including the style information and pixmaps used by it. Note that style information stored in the global configuration of the system is not read
[PATCH 11/23] texi2txt: fix support embedded item lists to allow nested lists
There are some cases where it can be useful to embed a list of item into another list; the script was almost ready to handle this case, this patch brings the missing stuff to get it to work properly. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- script/generate-txt-from-texi.sh | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/script/generate-txt-from-texi.sh b/script/generate-txt-from-texi.sh index 59821f1..8c51855 100755 --- a/script/generate-txt-from-texi.sh +++ b/script/generate-txt-from-texi.sh @@ -239,6 +239,7 @@ function par_mode_push(mode, local_i) { par_mode_save_length[par_mode_count] = line_length; par_mode_save_prefix[par_mode_count] = line_prefix; par_mode_save_justify[par_mode_count] = par_justify; + par_mode_save_itemmark[par_mode_count] = item_list_mark; par_mode = mode; # Check for quality of output @@ -256,6 +257,7 @@ function par_mode_pop(mode, local_i) { line_length = par_mode_save_length[par_mode_count]; line_prefix = par_mode_save_prefix[par_mode_count]; par_justify = par_mode_save_justify[par_mode_count]; + item_list_mark = par_mode_save_itemmark[par_mode_count]; par_mode_count--; } @@ -452,7 +454,12 @@ function start_item_list(mark) { list_is_first_item = 1; list_item_wants_sepline = 0; par_indent = 1; - line_prefix = ; + if (line_prefix == ) { +# First level of enumeration get one mode indentation space +line_prefix = ; + } else { +line_prefix = line_prefix ; + } if (mark == ) { item_list_mark = *; } else { -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 16/23] doc: update information in the Installation Manual
- update the list of supported platforms according to current known status; - updated URL links to all dependencies to the current known URL; - moved the dependency on Autotools to a dedicated section, because it is not supposed to be necessary for people compiling from the distributed source archive, and updated the version according to current status; - extended the chapter on getting the sources to contain all info that could be needed; - added a note about compiler requirement to ease understanding the actual requirements; - documented some long-time known dependancies (libbsd, inotify, boehm gc); - fixed a few strings here and there; - made an appropriate reference to the README.i18n for the troubleshooting of NLS. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- doc/build/Compilation.texi | 127 - 1 file changed, 91 insertions(+), 36 deletions(-) diff --git a/doc/build/Compilation.texi b/doc/build/Compilation.texi index 61e1e18..79376bd 100644 --- a/doc/build/Compilation.texi +++ b/doc/build/Compilation.texi @@ -107,7 +107,9 @@ This manual is for Window Maker, version @value{version}. @section Supported Platforms @itemize - -@item Intel GNU/Linux Systems in general +@item Intel GNU/Linux Systems in general, @t{ix86} and @t{x86_64} but other architectures should work +@item BSD systems +@item Solaris, at least on release 10 and 11 @end itemize Patches to make it work on other platforms are welcome. @@ -132,38 +134,52 @@ the server. @item Basic obvious stuff @itemize -@item @emph{gcc} (or some other ANSI C compiler) +@item @emph{gcc} (or some other ANSI C compiler, supporting some C99 extensions) @item @emph{glibc} development files (usually @file{glibc-devel} in Linux distributions) @item @emph{X} development files (@file{XFree86-devel} or something similar) @end itemize -@item @emph{autoconf}, @emph{automake} and @emph{libtool} -@itemize -@item autoconf 2.54 -@item automake 1.4 -@item libtool 1.4.2 -@end itemize - @item @emph{Xft2} and its dependencies Dependencies include @emph{freetype2} and @emph{fontconfig}. You will also need the development files for them (@file{xft2-devel}). +Sources are available at: @uref{http://www.freedesktop.org/wiki/Software/Xft/} + +@end itemize + +@noindent @b{Note}: +@sc{Window Maker} is known to compile with @emph{gcc} and @emph{clang}; +the code source is mostly ANSI C (also known as C89 and C90) but is uses very few of the C99 +novelties; +it also uses a few attributes introduced in the C11 standard but those are detected automatically, +so most compilers should work. + +@section Special Dependencies +@anchor{Special Dependencies} + + +If you want to compile using the sources from the git repository instead of the distribution +package, you will also need: +@itemize +@item @emph{git} +@item @emph{autoconf} 2.69 +@item @emph{automake} 1.11 +@item @emph{libtool} 1.4.2 @end itemize @section Optional Dependencies These libraries are not required to make @sc{Window Maker} work, but they are supported in case you -want to use them. Version numbers are those that I have (and therefore, guaranteed to work), but -other versions might work too. +want to use them. Version numbers are indicative, but other versions might work too. @itemize - @item @emph{libXPM} 4.7 or newer Older versions may not work! -Available at @uref{ftp://sunsite.unc.edu/pub/Linux/libs/X/} +Available from @uref{http://xlibs.freedesktop.org/release/} There is built-in support for @emph{XPM} files, but it will not load images in some uncommon encodings. @@ -171,28 +187,60 @@ load images in some uncommon encodings. @item @emph{libpng} 0.96 or newer and @emph{zlib} For @emph{PNG} image support, -@uref{http://www.cdrom.com/pub/png/} +@uref{http://www.libpng.org/pub/png/libpng.html} @item @emph{libtiff} 3.4 or newer For @emph{TIFF} image support, -You can get it at @uref{ftp://ftp.sgi.com/graphics/tiff} +@uref{http://www.libtiff.org/} @item @emph{libjpeg} 6.0.1 or newer For @emph{JPEG} image support, @uref{http://www.ijg.org/} +Note that if you don't have it, @command{configure} will issue a big warning in the end, +this is because JPEG images are often used in themes and for background images +so you probably want this format supported. + @item @emph{libgif} 2.2 or @emph{libungif} For @emph{GIF} image support, -@uref{ftp://prtr-13.ucsc.edu/pub/libungif/} +@uref{http://giflib.sourceforge.net/} @item @emph{GNU xgettext} If you want to use translated messages, you will need @emph{GNU gettext}. Other versions of @emph{gettext} are not compatible and will not work. -Get the @emph{GNU} version from @uref{ftp://ftp.gnu.org} +Get the @emph{GNU} version from @uref{http://www.gnu.org/software/gettext/} + +@item @emph{libbsd} + +This library can be used by the @emph{WINGs} utility library to make use of @command{strlcat} and +@command{strlcpy} instead of using built
[PATCH 22/23] configure: Added option to disable Motif WM Hints support
The old behaviour was to expect the user to go modify manually a source file which is not a great idea because that's typically the kind of things in charge of the configure script. As a side effect, we can now use an automake conditional to avoid compiling the source file in charge of the feature when not used, instead of trying to compile an empty-looking file. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- configure.ac | 17 + doc/build/Compilation.texi | 4 +++- src/Makefile.am| 6 -- src/motif.c| 4 src/wconfig.h.in | 3 --- 5 files changed, 24 insertions(+), 10 deletions(-) diff --git a/configure.ac b/configure.ac index fac385a..4e55a94 100644 --- a/configure.ac +++ b/configure.ac @@ -237,6 +237,7 @@ AX_PTHREAD dnl Tracking on what is detected for final status dnl = unsupported= +supported_core= supported_xext= supported_gfx= @@ -286,6 +287,21 @@ AC_ARG_WITH(incs-from, AS_HELP_STRING([--with-incs-from], [pass compiler flags t [inc_search_path=$withval $inc_search_path]) +dnl Features Configuration +dnl == +AC_ARG_ENABLE([mwm-hints], +[AS_HELP_STRING([--disable-mwm-hints], [disable support for Motif WM hints @:@default=enabled@:@])], +[AS_CASE([$enableval], +[yes|no], [], +[AC_MSG_ERROR([bad value $enableval for --enable-mwm-hints])])], +[enable_mwm_hints=yes]) +AS_IF([test x$enable_mwm_hints = xno], +[unsupported=$unsupported MWMHints], +[AC_DEFINE([USE_MWM_HINTS], [1], [Defined when used did not request to disable Motif WM hints]) + supported_core=$supported_core MWMHints]) +AM_CONDITIONAL([USE_MWM_HINTS], [test x$enable_mwm_hints != xno]) + + dnl Boehm GC dnl AC_ARG_ENABLE([boehm-gc], @@ -887,6 +903,7 @@ echo Installation path prefix: $prefix echo Installation path for binaries : $_bindir echo Installation path for libraries : $libdir echo Installation path for WPrefs.app: $wprefs_base_dir | sed -e 's|\${prefix}|'$prefix| +echo Supported core features::$supported_core echo Supported X extensions: :$supported_xext echo Supported graphic format libraries :$supported_gfx echo Unsupported features:$unsupported diff --git a/doc/build/Compilation.texi b/doc/build/Compilation.texi index cccacf4..bffad76 100644 --- a/doc/build/Compilation.texi +++ b/doc/build/Compilation.texi @@ -566,8 +566,10 @@ screen size. @subsection Feature Selection @table @option -@item --disable-motif +@item --disable-mwm-hints Disable support for Motif's MWM Window Manager hints. +These attributes were introduced by the Motif toolkit to ask for special window appearance requests. +Nowadays this is covered by the NetWM/EWMH specification, but there are still applications that rely on MWM Hints. @item --enable-ld-version-script This feature is auto-detected, and you should not use this option. diff --git a/src/Makefile.am b/src/Makefile.am index e149f7d..56ebe08 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -52,8 +52,6 @@ wmaker_SOURCES = \ misc.h \ monitor.c \ monitor.h \ - motif.c \ - motif.h \ moveres.c \ pixmap.c \ pixmap.h \ @@ -110,6 +108,10 @@ wmaker_SOURCES = \ wsmap.c \ wsmap.h +if USE_MWM_HINTS +wmaker_SOURCES += motif.h motif.c +endif + if WM_OSDEP_BSD wmaker_SOURCES += osdep_bsd.c endif diff --git a/src/motif.c b/src/motif.c index 55afdac..b649f82 100644 --- a/src/motif.c +++ b/src/motif.c @@ -21,8 +21,6 @@ #include wconfig.h -#ifdef USE_MWM_HINTS - #include X11/Xlib.h #include X11/Xutil.h #include stdlib.h @@ -200,5 +198,3 @@ void wMWMCheckClientHints(WWindow *wwin) if (getMWMHints(wwin-client_win, hints)) setupMWMHints(wwin, hints); } - -#endif /* USE_MWM_HINTS */ diff --git a/src/wconfig.h.in b/src/wconfig.h.in index 49bb11d..4a56e04 100644 --- a/src/wconfig.h.in +++ b/src/wconfig.h.in @@ -36,9 +36,6 @@ /* If you want animations for iconification, shading, icon arrangement etc. */ #define ANIMATIONS -/* support for Motif window manager (mwm) window hints */ -#define USE_MWM_HINTS - /* * Undefine BALLOON_TEXT if you don't want balloons for showing extra * information, like window titles that are not fully visible. -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 02/23] WUtil: mark the script 'get-wutil-flags' as deprecated
This script should have been removed a long time ago, in favour of pkg-config which has to be present anyway to compile Window Maker. This patch makes the script print a warning about it, and now calls itself pkg-config, instead of being generated; the man page was also updated accordingly (and spell-checked). Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- .gitignore | 1 - WINGs/Makefile.am| 12 ++-- WINGs/get-wutil-flags| 33 + WINGs/get-wutil-flags.in | 31 --- doc/get-wutil-flags.1| 40 5 files changed, 55 insertions(+), 62 deletions(-) create mode 100755 WINGs/get-wutil-flags delete mode 100644 WINGs/get-wutil-flags.in diff --git a/.gitignore b/.gitignore index 7f81a87..a27a3b0 100644 --- a/.gitignore +++ b/.gitignore @@ -77,7 +77,6 @@ WINGs/Tests/wmfile WINGs/Tests/wmquery WINGs/Tests/wtest WINGs/get-wings-flags -WINGs/get-wutil-flags WPrefs.app/WPrefs diff --git a/WINGs/Makefile.am b/WINGs/Makefile.am index 14b27f8..1e4d8e9 100644 --- a/WINGs/Makefile.am +++ b/WINGs/Makefile.am @@ -17,7 +17,7 @@ LDADD= libWUtil.la libWINGs.la $(top_builddir)/wrlib/libwraster.la @INTLIBS@ libWINGs_la_LIBADD = libWUtil.la $(top_builddir)/wrlib/libwraster.la @XLIBS@ @XFTLIBS@ @FCLIBS@ @LIBM@ @PANGOLIBS@ libWUtil_la_LIBADD = @LIBBSD@ -EXTRA_DIST = BUGS make-rgb Examples Extras Tests get-wings-flags.in get-wutil-flags.in +EXTRA_DIST = BUGS make-rgb Examples Extras Tests get-wings-flags.in get-wutil-flags # wbutton.c @@ -98,7 +98,7 @@ AM_CPPFLAGS = -DRESOURCE_PATH=\$(datadir)/WINGs\ \ pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = WINGs.pc WUtil.pc -DISTCLEANFILES = $(pkgconfig_DATA) get-wings-flags get-wutil-flags +DISTCLEANFILES = $(pkgconfig_DATA) get-wings-flags WINGs.pc: Makefile @echo Generating $@ @@ -129,11 +129,3 @@ WUtil.pc: Makefile @echo 'Libs: -L$(libdir) -lWUtil' $@ @echo 'Libs.private: $(INTLIBS)' $@ @echo 'Cflags: -I$(includedir)' $@ - -get-wutil-flags: get-wutil-flags.in Makefile - @echo Generating $@ - @$(SED) -e 's#$${includedir}#$(includedir)#;' \ - -e 's#$${libdir}#$(libdir)#;' \ - -e 's#$${INTLIBS}#$(INTLIBS)#;' $(abs_srcdir)/get-wutil-flags.in $@ - @chmod 755 $@ - diff --git a/WINGs/get-wutil-flags b/WINGs/get-wutil-flags new file mode 100755 index 000..c913a17 --- /dev/null +++ b/WINGs/get-wutil-flags @@ -0,0 +1,33 @@ +#!/bin/sh + +# [Christophe CURIS, 2015/01/31] +# This script is now reporting itself as deprecated (this should have been done +# a long time ago), so it should be kept for at least 2 years from now in order +# to allow users to update their scripts, and then removed. + +if test $# -eq 0; then + echo Error: $0 is deprecated, please use 'pkg-config WUtil ...' 2 + exit 1 +fi + +while test $# -gt 0; do + case $1 in +--cflags) +echo Warning: $0 is deprecated, please use 'pkg-config WUtil --cflags' 2 + pkg-config WUtil --cflags +;; +--ldflags|--lflags) + echo Warning: $0 is deprecated, please use 'pkg-config WUtil --libs' 2 +pkg-config WUtil --libs-only-L +;; +--libs) + echo Warning: $0 is deprecated, please use 'pkg-config WUtil --libs' 2 +pkg-config WUtil --libs +;; +*) + echo Error: $0 is deprecated, please use 'pkg-config WUtil ...' 2 + exit 1 + ;; + esac + shift +done diff --git a/WINGs/get-wutil-flags.in b/WINGs/get-wutil-flags.in deleted file mode 100644 index 026cf59..000 --- a/WINGs/get-wutil-flags.in +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh - -WCFLAGS=-I${includedir} -WLFLAGS=-L${libdir} -WLIBS=-lWUtil ${INTLIBS} - -usage=Usage: get-wutil-flags [--cflags] [--ldflags] [--libs] - -if test $# -eq 0; then - echo ${usage} 12 - exit 1 -fi - -while test $# -gt 0; do - case $1 in ---cflags) - echo $WCFLAGS -;; ---ldflags|--lflags) - echo $WLFLAGS -;; ---libs) - echo $WLIBS -;; -*) - echo ${usage} 12 - exit 1 - ;; - esac - shift -done diff --git a/doc/get-wutil-flags.1 b/doc/get-wutil-flags.1 index c66bd05..05ed66a 100644 --- a/doc/get-wutil-flags.1 +++ b/doc/get-wutil-flags.1 @@ -1,32 +1,32 @@ .TH get-wutil-flags 1 22 March 2005 .SH NAME -\fBget-wutil-flags\fR \- output libwutil compile and linker flags +\fBget-wutil-flags\fP \- output libwutil compiler and linker flags (deprecated) .PP .SH SYNOPSIS -.B get-wutil-flags \fR[ \fI\-\-cflags \fR] [ \fI\-\-ldflags \fR] -[ \fI\-\-libs \fR] -.PP +.B pkg-config +.R WUtil +.I \-\-cflags +.br +.B pkg-config +.R WUtil +.I \-\-libs .SH DESCRIPTION -\fBget-wutil-flags \fR\- output include path, library search path or -library archive names needed to compile and link with libWUtil. -.PP -.SH OPTIONS +\fBget-wutil-flags\fP used to provide the compilation and link
[PATCH 19/23] doc: describe the new options to the configure script
As there are many options, they have been split into 5 sections; added documentation for all the legacy Window Maker options that were missing and for the new ones; added documentation for a few of the autotools standard options that can be considered interesting. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- doc/build/Compilation.texi | 204 +++-- 1 file changed, 195 insertions(+), 9 deletions(-) diff --git a/doc/build/Compilation.texi b/doc/build/Compilation.texi index 51d53d7..cccacf4 100644 --- a/doc/build/Compilation.texi +++ b/doc/build/Compilation.texi @@ -170,6 +170,7 @@ package, you will also need: @section Optional Dependencies +@anchor{Optional Dependencies} These libraries are not required to make @sc{Window Maker} work, but they are supported in case you want to use them. Version numbers are indicative, but other versions might work too. @@ -208,12 +209,24 @@ so you probably want this format supported. For @emph{GIF} image support, @uref{http://giflib.sourceforge.net/} +@item @emph{WebP} 0.4.1 or newer + +The reference library from @emph{Google} for their image format, +@uref{https://developers.google.com/speed/webp/download} + @item @emph{GNU xgettext} If you want to use translated messages, you will need @emph{GNU gettext}. Other versions of @emph{gettext} are not compatible and will not work. Get the @emph{GNU} version from @uref{http://www.gnu.org/software/gettext/} +@item @emph{Pango} 1.36.8 or newer + +This library can be used by the @emph{WINGs} toolkit to improve support for @emph{UTF-8} and for +languages written in right-to-left direction, in some widgets. +You have to explicitly ask for its support though (@pxref{Configure Options}). +You can get it from @uref{http://www.pango.org/Download} + @item @emph{libbsd} This library can be used by the @emph{WINGs} utility library to make use of @command{strlcat} and @@ -234,6 +247,12 @@ The needed header comes with the kernel, typical packages names include: @item @file{linux-glibc-devel} for @emph{OpenSuSE} @end itemize +@item @emph{MagickWand} 6.8.9-9 or newer + +If found, then the library @emph{WRaster} can use the @emph{ImageMagick} library to let +@sc{Window Maker} support more image formats, like @emph{SVG}, @emph{BMP}, @emph{TGA}, ... +You can get it from @uref{http://www.imagemagick.org/} + @item @emph{Boehm GC} This library can be used by the @emph{WINGs} utility toolkit to use a @@ -386,22 +405,100 @@ Normally, you won't need any of them. To get the list of all options, run @command{./configure --help} + +@subsection Installation Directory + +The default installation path will be in the @file{/usr/local} hierarchy; +a number of option can customise this: + @table @option +@item --prefix=@i{PREFIX} +@itemx --exec-prefix=@i{EPREFIX} +@itemx --bindir=@i{DIR} +@itemx --sysconfdir=@i{DIR} +@itemx --libdir=@i{DIR} +@itemx --includedir=@i{DIR} +@itemx --datarootdir=@i{DIR} +@itemx --datadir=@i{DIR} +@itemx --localedir=@i{DIR} +@itemx --mandir=@i{DIR} +Standard options from @emph{autoconf} to define target paths, +you probably want to read @ref{Installation Names,,,INSTALL,@file{INSTALL}}. + +@item --sbindir=@i{DIR} +@itemx --libexecdir=@i{DIR} +@itemx --sharedstatedir=@i{DIR} +@itemx --localstatedir=@i{DIR} +@itemx --oldincludedir=@i{DIR} +@itemx --infodir=@i{DIR} +@itemx --docdir=@i{DIR} +@itemx --htmldir=@i{DIR} +@itemx --dvidir=@i{DIR} +@itemx --pdfdir=@i{DIR} +@itemx --psdir=@i{DIR} +More standard options from @emph{autoconf}, today these are not used by @sc{Window Maker}; +they are provided automatically by @emph{autoconf} for consistency. + +@item --with-gnustepdir=@i{PATH} +Specific to @sc{Window Maker}, defines the directory where @file{WPrefs.app} will be installed, +if you want to install it like a @emph{GNUstep} applications. +If not specified, it will be installed like usual programs. + +@item --with-pixmapdir=@i{DIR} +Specific to @sc{Window Maker}, this option defines an additional path where @emph{pixmaps} will be +searched. Nothing will be installed there; the default path taken is @file{@emph{DATADIR}/pixmaps}, +where @var{DATADIR} is the path defined from @option{--datadir}. + +@end table + + +@subsection External Libraries + +Unless specifically written, @command{configure} will try to detect automatically for the libraries; +if you explicitly provide @option{--enable-@emph{FEATURE}} then it will break with an error message +if the library cannot be linked; +if you specify @option{--disable-@emph{FEATURE}} then it will not try to search for the library. +You can find more information about the libraries in the +@ref{Optional Dependencies}. + +@table @option +@item --enable-boehm-gc +Never enabled by default, use Boehm GC instead of the default @emph{libc} @command{malloc()} + @item --disable-gif -disable use of @emph{GIF} library +Disable GIF support in @emph{WRaster} library; when enabled use @file{libgif
[PATCH 2/2] txt-from-texi: remove use of the 'switch' statement for portability
This 'switch' control statement is actually a GNU extension, so it is not portable to other awk implementations. This patch replace them with the traditional 'if...else' sequence which will work everywhere. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- script/generate-txt-from-texi.sh | 275 --- 1 file changed, 112 insertions(+), 163 deletions(-) diff --git a/script/generate-txt-from-texi.sh b/script/generate-txt-from-texi.sh index 664e41e..59821f1 100755 --- a/script/generate-txt-from-texi.sh +++ b/script/generate-txt-from-texi.sh @@ -217,17 +217,14 @@ function set_variable(line, local_idx, local_name, local_value) { function write_line(line) { if (!cond_state) { return; } - switch (redirect_out) { - case no: + if (redirect_out == no) { print line; line_number++; -break; - case copyright: + } else if (redirect_out == copyright) { copyright_lines[copyright_count++] = line; -break; - default: + } else { report_error(redirect output mode \ redirect_out \ is not supported (line NR )); } } @@ -466,14 +463,12 @@ function start_item_list(mark) { # Generate Underline string with the specified length function gen_underline(id, len, local) { - switch (id) { -case -1: local = ; break; -case 1: local = **; break; -case 2: local = ==; break; -case 3: local = --; break; -case 4: local = ..; break; -default: local = ~~; break; - } + if (id == -1) { local = ; } else + if (id == 1) { local = **; } else + if (id == 2) { local = ==; } else + if (id == 3) { local = --; } else + if (id == 4) { local = ..; } + else { local = ~~; } while (length(local) len) { local = local local; } @@ -483,17 +478,16 @@ function gen_underline(id, len, local) { # Generate text for an URL link function generate_url_reference(args, local_nb, local_arr) { local_nb = split(args, local_arr, ,); - switch (local_nb) { - case 1: + if (local_nb == 1) { return local_arr[1]; - case 2: + } else if (local_nb == 2) { return execute_commands(local_arr[2]) ( local_arr[1] ); - case 3: + } else if (local_nb == 3) { return execute_commands(local_arr[3]); - default: + } else { report_error(bad number of argument local_nb for @uref at line NR); } } @@ -507,24 +501,21 @@ function generate_author_line(name, local_offset, local_attach_to_par) generate_paragraph(); - switch (par_mode) { - case titlepage: + if (par_mode == titlepage) { name = -- name --; local_offset = int((76 - length(name)) / 2); if (local_offset 2) { local_offset = 2; } write_line(); write_line(gen_underline(-1, local_offset) name); -break; - case quotation: + } else if (par_mode == quotation) { name = -- name; local_offset = int((line_length - length(line_prefix) - length(name)) * 2/3); if (local_offset length(line_prefix) + 2) { local_offset = length(line_prefix) + 2; } if (!local_attach_to_par) { write_line(); } write_line(line_prefix gen_underline(-1, local_offset) name); -break; - default: + } else { report_error(command @author used in an inappropriate mode ( par_mode ) at line NR); } } @@ -546,8 +537,7 @@ function generate_paragraph( local_prefix, local_line, local_length, local_line = line_prefix; - switch (par_mode) { - case list: + if (par_mode == list) { if (list_item_wants_sepline !list_is_first_item) { write_line(); } @@ -558,25 +548,21 @@ function generate_paragraph( local_prefix, local_line, local_length, while (length(local_prefix) 5) { local_prefix = local_prefix; } local_line = substr(local_line, 1, length(local_line) - 5) local_prefix; } -break; - case titlepage: + } else if (par_mode == titlepage) { write_line(); -break; - case par: + } else if (par_mode == par) { write_line(); if (par_indent) { local_line = local_line; } -break; - case quotation: + } else if (par_mode == quotation) { write_line(); # There is no extra indentation of paragraphs in this mode -break; - default: + } else { report_error(paragraph mode \ par_mode \ is not supported in generate_paragraph (line NR )); } @@ -675,103 +661,81 @@ function execute_commands(line, replaced_line, command) { sub(/^[ \t]+/, , line); } -# Process the command -switch (command) { - # Commands generating special characters # -case @: +if (command == @) { replaced_line = replaced_line @; - break; -case bullet: +} else if (command == bullet) { replaced_line = replaced_line *; - break; -case copyright: +} else
[PATCH 1/2] txt-from-texi: fixed use of awk 'match' function to be portable
As reported by Doug Torrance, the 3rd argument to the 'match' function is actually a GNU extension, so it breaks compatibility when run with another version of awk, for instance mawk. This script changes the code to stuck to the 2 arguments version which is posix. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- script/generate-txt-from-texi.sh | 71 ++-- 1 file changed, 40 insertions(+), 31 deletions(-) diff --git a/script/generate-txt-from-texi.sh b/script/generate-txt-from-texi.sh index 4aaafb6..664e41e 100755 --- a/script/generate-txt-from-texi.sh +++ b/script/generate-txt-from-texi.sh @@ -199,11 +199,18 @@ function end_conditional(name, local_i) { # the texinfo standard allows to have variables set with @set and used # with @value; they can also be defined from command-line (-D) # they are stored in the global array variable[name] -function set_variable(line, local_split, local_idx) { - local_idx = match(line, /^([^ \t]+)([ \t]*)(.*)$/, local_split); +function set_variable(line, local_idx, local_name, local_value) { + gsub(/^[ \t]*/, , line); + local_idx = match(line, /[ \t]/); if (local_idx 0) { -variable[ local_split[1] ] = local_split[3]; +local_name = substr(line, 1, local_idx - 1); +local_value = substr(line, local_idx + 1); +gsub(/^[ \t]*/, , local_value); + } else { +local_name = line; +local_value = ; } + variable[ local_name ] = local_value; } # Write a single line to the output @@ -631,15 +638,16 @@ function generate_paragraph( local_prefix, local_line, local_length, } # Replace commands by text in the line, return the result -function execute_commands(line, replaced_line) { +function execute_commands(line, replaced_line, command) { replaced_line = ; while (1) { -idx = match(line, /@([a-zA-Z]+|.)/, command) +idx = match(line, /@([a-zA-Z]+|.)/); if (idx == 0) { break; } # Separate the command and its arguments from the rest of the line replaced_line = replaced_line substr(line, 1, idx - 1); -line = substr(line, idx + 1 + length(command[1])); +command = substr(line, idx + 1, RLENGTH - 1); +line = substr(line, idx + RLENGTH); if (line ~ /^\{/) { # Command has argument(s), extract them @@ -654,7 +662,7 @@ function execute_commands(line, replaced_line) { } } if (brace_count != 0) { -report_error(closing brace not found for command \ command[1] \, at line NR); +report_error(closing brace not found for command \@ command \, at line NR); } cmdargs = substr(line, 2, i-2); @@ -668,7 +676,7 @@ function execute_commands(line, replaced_line) { } # Process the command -switch (command[1]) { +switch (command) { # Commands generating special characters # case @: @@ -764,7 +772,7 @@ function execute_commands(line, replaced_line) { break; default: - report_error(unknow command @ command[1] at line NR); + report_error(unknow command @ command at line NR); } } @@ -862,13 +870,14 @@ BEGIN { /^[ \t]*@/ { # Treat the special commands that are supposed to be on a line by themselves - idx = match($0, /^@([a-zA-Z]+)/, command); + idx = match($0, /^@([a-zA-Z]+)/); if (idx != 0) { # Remove the command from current line -line = substr($0, idx + 1 + length(command[1])); +command = substr($0, idx + 1, RLENGTH - 1); +line = substr($0, idx + 1 + RLENGTH); sub(/^[ \t]+/, , line); -switch (command[1]) { +switch (command) { # Commands for structuring the document case chapter: @@ -963,7 +972,7 @@ BEGIN { case menu: generate_paragraph(); - discard_block(command[1]); + discard_block(command); next; case quotation: @@ -1030,22 +1039,22 @@ BEGIN { next; # Variable and Conditional commands -case ifdocbook: start_conditional(command[1], 0); line = ; next; -case ifhtml: start_conditional(command[1], 0); line = ; next; -case ifinfo: start_conditional(command[1], 1); line = ; next; # for historical compatibility -case ifplaintext: start_conditional(command[1], 1); line = ; next; -case iftex: start_conditional(command[1], 0); line = ; next; -case ifxml: start_conditional(command[1], 0); line = ; next; - -case ifnotdocbook: start_conditional(command[1], 1); line = ; next; -case ifnothtml: start_conditional(command[1], 1); line = ; next; -case ifnotinfo: start_conditional(command[1], 0); line = ; next; # for historical compatibility -case ifnotplaintext: start_conditional(command[1], 0); line = ; next; -case ifnottex: start_conditional(command[1
[PATCH 18/23] configure: add possibility to list available languages with LINGUAS=list
Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- doc/build/Translations.texi | 28 m4/wm_i18n.m4 | 7 +++ 2 files changed, 35 insertions(+) diff --git a/doc/build/Translations.texi b/doc/build/Translations.texi index 60f705f..f7a7d66 100644 --- a/doc/build/Translations.texi +++ b/doc/build/Translations.texi @@ -115,6 +115,34 @@ The installation directory can be changed with the standard option @option{--loc @file{@emph{prefix}/share/locale/@emph{lang}/LC_MESSAGES}). +@c - List of supported Languages --- +@section Getting the list of supported languages + +The naming convention for the languages follows the @cite{ISO 639-1} standard, +for which you can find a summary list in the +@uref{https://www.gnu.org/software/gettext/manual/html_node/Usual-Language-Codes.html, GNU gettext manual}. + +But as @sc{Window Maker} does not support all of them, the @command{configure} script will print a +warning for each language you specify that it does not know, and sum up at the end the list of +enabled languages that will be installed. + +There is a non-standard possibility to set @env{LINGUAS} to @code{list}, in which case the +@command{configure} script will provide you the list of languages it supports, and stop: + +@example +./configure LINGUAS=list +@end example + +There is also another non-standard possibility to enable all the languages that @sc{Window Maker} +supports by setting @env{LINGUAS} to @code{*}. +This is an internal trick implemented so the development team can have the command +@command{make distcheck} include some checks on translations: + +@example +./configure LINGUAS='*' +@end example + + @c -- Translations for Menus --- @section Translations for Menus diff --git a/m4/wm_i18n.m4 b/m4/wm_i18n.m4 index e7f52f8..eb742e6 100644 --- a/m4/wm_i18n.m4 +++ b/m4/wm_i18n.m4 @@ -38,6 +38,13 @@ AC_DEFUN_ONCE([WM_I18N_LANGUAGES], [list of language translations to support (I18N), use 'list' to get the list of supported languages, default: none])dnl AC_DEFUN([WM_ALL_LANGUAGES], [m4_esyscmd([( ls WINGs/po/ ; ls po/ ; ls WPrefs.app/po/ ; ls util/po/ ) | sed -n -e '/po$/{s,\.po,,;p}' | sort -u | tr '\n' ' '])])dnl +dnl We 'divert' the macro to have it executed as soon as the option list have +dnl been processed, so the list of locales will be printed after the configure +dnl options have been parsed, but before any test have been run +m4_divert_text([INIT_PREPARE], +[AS_IF([test x$LINGUAS = xlist], +[AS_ECHO([Supported languages: WM_ALL_LANGUAGES]) + AS_EXIT([0])]) ])dnl AS_IF([test x$LINGUAS != x], [wm_save_LIBS=$LIBS AC_SEARCH_LIBS([gettext], [intl], [], -- 2.1.4 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.
[PATCH 14/23] configure: rewrote the support for option '--with-menu-textdomain'
The idea is to include consistency check to warn the user if he is not using it properly, instead of silently misbehaving; Updated code style to use Autoconf macros for consistency. Took opportunity to remove the hacky setting inside 'config-paths.h' where it is a bit out of place, in favour of a standard DEFINE in the 'config.h'. Include in the i18n documentation the explanation on how Window Maker translates the menus, both when the 'menu-textdomain' option is used and when it is not. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- Makefile.am | 7 --- configure.ac| 11 +-- doc/build/Translations.texi | 37 + m4/wm_i18n.m4 | 22 ++ 4 files changed, 60 insertions(+), 17 deletions(-) diff --git a/Makefile.am b/Makefile.am index af8a64d..351d0db 100644 --- a/Makefile.am +++ b/Makefile.am @@ -12,13 +12,6 @@ config-paths.h: Makefile @echo Generating $@ @echo '/* this is a generated file - do not edit */' $@ @echo '' $@ - @echo '/* gettext domain used for menu translations */' $@ - @if test -z $(menutextdomain); then \ - echo '/* #undef MENU_TEXTDOMAIN $(menutextdomain) */' $@; \ - else \ - echo '#define MENU_TEXTDOMAIN $(menutextdomain)' $@; \ - fi - @echo '' $@ @echo '/* define where the translations are stored */' $@ @echo '#define LOCALEDIR $(localedir)' $@ @echo '' $@ diff --git a/configure.ac b/configure.ac index b13d3b4..53e95b4 100644 --- a/configure.ac +++ b/configure.ac @@ -418,6 +418,7 @@ dnl Detect the language for translations to be installed and check dnl that the gettext environment works WM_I18N_LANGUAGES WM_I18N_XGETTEXT +WM_I18N_MENUTEXTDOMAIN dnl 2014/12/29: The option is deprecated, we should keep this message for at dnl least 2 years to ensure users see it and update their build scripts @@ -425,16 +426,6 @@ AC_ARG_WITH([nlsdir], [], [AC_MSG_ERROR([option '--with-nlsdir' is deprecated, please use autoconf's standard '--localedir' instead])]) -menutextdomain= -AC_ARG_WITH(menu-textdomain, AS_HELP_STRING([--with-menu-textdomain=DOMAIN], [specify gettext domain used for menu translations]), - [if test x$withval != xno; then - menutextdomain=$withval -fi]) -AC_SUBST(menutextdomain) - -AC_SUBST(NLSDIR) - - dnl === dnlStuff that uses X dnl === diff --git a/doc/build/Translations.texi b/doc/build/Translations.texi index 995da7a..64168f5 100644 --- a/doc/build/Translations.texi +++ b/doc/build/Translations.texi @@ -114,6 +114,43 @@ The installation directory can be changed with the standard option @option{--loc @file{@emph{prefix}/share/locale/@emph{lang}/LC_MESSAGES}). +@c -- Translations for Menus --- +@section Translations for Menus + +In order to propose an @emph{Application Menu} (also called @emph{Root Menu}) that is also +translated in the language of the interface, @sc{Window Maker} implements two complementary +mechanisms: + +The first, always enabled when i18n support is enabled, is to look for the menu file containing the +name of the locale. +For example, if the file is called @file{menu} and the language is set as @env{LANG=fr_FR.utf-8}, +then @sc{Window Maker} will search for, and use the first match found: + +@itemize +@item @code{menu.fr_FR.utf-8} +@item @code{menu.fr_FR} +@item @code{menu.fr} +@item @code{menu} +@end itemize + +The second possibility, which is not enabled by default, is to be able to use a custom @file{po} +file which contains the translations for the text of the menu. +This feature is enabled at compile time, using the option @option{--with-menu-textdomain} to the +@command{configure} script. For example, if you specify: + +@example +./configure --with-menu-textdomain=WMMenu +@end example + +@noindent then the translations for the menu will be searched in the file @file{WMMenu.mo} located +at the standard location, the default path being +@file{@emph{prefix}/share/locale/@emph{lang}/LC_MESSAGES/@emph{WMMenu}.mo}. + +If you do not enable the feature (the default behaviour, or with an explicit +@option{--without-menu-textdomain}), then @sc{Window Maker} will @b{not} try to translate the +strings, even using its own domain file (@file{WindowMaker.mo}). + + @c - LINGUAS at system level --- @section Setting @env{LINGUAS} at system level diff --git a/m4/wm_i18n.m4 b/m4/wm_i18n.m4 index 88dc70e..41cb84d 100644 --- a/m4/wm_i18n.m4 +++ b/m4/wm_i18n.m4 @@ -113,3 +113,25 @@ AS_IF([test x$XGETTEXT != x], XGETTEXT=])) AM_CONDITIONAL([HAVE_XGETTEXT], [test x$XGETTEXT != x])dnl ]) + + +# WM_I18N_MENUTEXTDOMAIN
[PATCH 13/23] configure: replaced option '--with-nls' by autoconf's '--localedir'
Autoconf have been providing the option '--localedir' for a long time now, so this patch removes the deprecated '--with-nls' option and makes use of the standard '--localedir' instead. Took opportunity to define the path in the 'config-paths.h' in the same way the other paths are defined to be consistent, which also simplify the compilation commands. Signed-off-by: Christophe CURIS christophe.cu...@free.fr --- Makefile.am | 3 +++ WINGs/Makefile.am | 2 +- WINGs/po/Makefile.am| 8 +++- WPrefs.app/Makefile.am | 2 +- WPrefs.app/po/Makefile.am | 8 +++- configure.ac| 17 - doc/build/Translations.texi | 4 po/Makefile.am | 8 +++- src/Makefile.am | 3 +-- util/Makefile.am| 2 +- util/po/Makefile.am | 8 +++- 11 files changed, 27 insertions(+), 38 deletions(-) diff --git a/Makefile.am b/Makefile.am index e2807bf..af8a64d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -19,6 +19,9 @@ config-paths.h: Makefile echo '#define MENU_TEXTDOMAIN $(menutextdomain)' $@; \ fi @echo '' $@ + @echo '/* define where the translations are stored */' $@ + @echo '#define LOCALEDIR $(localedir)' $@ + @echo '' $@ @echo '/* define an extra path for pixmaps */' $@ @echo '#define PIXMAPDIR $(pixmapdir)' $@ @echo '' $@ diff --git a/WINGs/Makefile.am b/WINGs/Makefile.am index 017f1d7..14b27f8 100644 --- a/WINGs/Makefile.am +++ b/WINGs/Makefile.am @@ -91,7 +91,7 @@ libWUtil_la_SOURCES = \ AM_CFLAGS = -AM_CPPFLAGS = -DLOCALEDIR=\$(NLSDIR)\ -DRESOURCE_PATH=\$(datadir)/WINGs\ \ +AM_CPPFLAGS = -DRESOURCE_PATH=\$(datadir)/WINGs\ \ -I$(top_srcdir)/WINGs/WINGs -I$(top_srcdir)/wrlib -I$(top_srcdir)/src \ @XFTFLAGS@ @HEADER_SEARCH_PATH@ diff --git a/WINGs/po/Makefile.am b/WINGs/po/Makefile.am index 076c116..7c5d6ce 100644 --- a/WINGs/po/Makefile.am +++ b/WINGs/po/Makefile.am @@ -1,7 +1,5 @@ DOMAIN = WINGs -nlsdir = $(NLSDIR) - CATALOGS = @WINGSMOFILES@ CLEANFILES = $(CATALOGS) $(DOMAIN).pot @@ -93,12 +91,12 @@ endif install-data-local: $(CATALOGS) - $(mkinstalldirs) $(DESTDIR)$(nlsdir) + $(mkinstalldirs) $(DESTDIR)$(localedir) for n in $(CATALOGS) __DuMmY ; do \ if test $$n -a $$n != __DuMmY ; then \ l=`basename $$n .mo`; \ - $(mkinstalldirs) $(DESTDIR)$(nlsdir)/$$l/LC_MESSAGES; \ - $(INSTALL_DATA) -m 644 $$n $(DESTDIR)$(nlsdir)/$$l/LC_MESSAGES/$(DOMAIN).mo; \ + $(mkinstalldirs) $(DESTDIR)$(localedir)/$$l/LC_MESSAGES; \ + $(INSTALL_DATA) -m 644 $$n $(DESTDIR)$(localedir)/$$l/LC_MESSAGES/$(DOMAIN).mo; \ fi; \ done diff --git a/WPrefs.app/Makefile.am b/WPrefs.app/Makefile.am index f77ddd4..f13aeee 100644 --- a/WPrefs.app/Makefile.am +++ b/WPrefs.app/Makefile.am @@ -47,7 +47,7 @@ WPrefs_SOURCES = \ AM_CFLAGS = -AM_CPPFLAGS = -DLOCALEDIR=\$(NLSDIR)\ -DRESOURCE_PATH=\$(wpdatadir)\ -DWMAKER_RESOURCE_PATH=\$(pkgdatadir)\ \ +AM_CPPFLAGS = -DRESOURCE_PATH=\$(wpdatadir)\ -DWMAKER_RESOURCE_PATH=\$(pkgdatadir)\ \ -I$(top_srcdir)/wrlib -I$(top_srcdir)/WINGs @HEADER_SEARCH_PATH@ WPrefs_DEPENDENCIES = $(top_builddir)/WINGs/libWINGs.la diff --git a/WPrefs.app/po/Makefile.am b/WPrefs.app/po/Makefile.am index cd5123f..4fad9aa 100644 --- a/WPrefs.app/po/Makefile.am +++ b/WPrefs.app/po/Makefile.am @@ -2,8 +2,6 @@ DOMAIN = WPrefs CATALOGS = @WPREFSMOFILES@ -nlsdir = $(NLSDIR) - CLEANFILES = $(DOMAIN).pot $(CATALOGS) EXTRA_DIST = bg.po ca.po cs.po de.po es.po et.po fi.po fr.po hr.po hu.po \ @@ -59,12 +57,12 @@ endif install-data-local: $(CATALOGS) - $(mkinstalldirs) $(DESTDIR)$(nlsdir) + $(mkinstalldirs) $(DESTDIR)$(localedir) for n in $(CATALOGS) __DuMmY ; do \ if test $$n -a $$n != __DuMmY ; then \ l=`basename $$n .mo`; \ - $(mkinstalldirs) $(DESTDIR)$(nlsdir)/$$l/LC_MESSAGES; \ - $(INSTALL_DATA) -m 644 $$n $(DESTDIR)$(nlsdir)/$$l/LC_MESSAGES/$(DOMAIN).mo; \ + $(mkinstalldirs) $(DESTDIR)$(localedir)/$$l/LC_MESSAGES; \ + $(INSTALL_DATA) -m 644 $$n $(DESTDIR)$(localedir)/$$l/LC_MESSAGES/$(DOMAIN).mo; \ fi; \ done diff --git a/configure.ac b/configure.ac index d1161b5..b13d3b4 100644 --- a/configure.ac +++ b/configure.ac @@ -419,18 +419,11 @@ dnl that the gettext environment works WM_I18N_LANGUAGES WM_I18N_XGETTEXT +dnl 2014/12/29: The option is deprecated, we should keep this message for at +dnl least 2 years to ensure users see it and update their build scripts +AC_ARG_WITH([nlsdir], [], +[AC_MSG_ERROR([option '--with-nlsdir' is deprecated, please use autoconf's standard '--localedir' instead])]) -dnl