The header "wraster.h" needs different behaviour depending on whether the
support for X Shared Memory extension was enabled or not; but the related
macro USE_XSHM is defined by WindowMaker's configure. After this header
have been installed, the macro is no more useable.
This patch makes the "wraster.h" a generated file, so it will be different
depending on USE_XSHM, but will not make use of the macro itself.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
As reported by Coverity (CID #50181, #50182 and #50183) the strings allocated by parse_wmconfig_line were not freed after use.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
As reported by Coverity (CID #50146), if the function getLocalizedStringValue
returns without matching the entry, the storage for the entry's locale was
leaked.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
I noticed one instance of this while looking at the code the other day,
and after a quick grep, realized it happened a *lot*! One of the many
frustrating things about the English language is that we use apostrophes
to make pretty much everything possessive *except* the pronoun "it".
In that case, we use "its". "It's" is reserved for the contraction
meaning "it is" or "it has".
From the comments at the top of wmmenugen_parse_xdg.c:
Since there is no passing of file name arguments or anything of the
sort to applications from the menu, execname is determined as follows:
- If `TryExec' is present, use that;
- else use `Exec' with any switches stripped
However, Exec used to be preferred. Changed code to prefer TryExec.
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Exec fields in desktop-files may include field-codes which act as
place-holders for command-line arguments. Previously the Exec arguments
were being passed through intact. However, since Window Maker has no
support for expanding the field-codes, we now remove them and preserve
the remaining arguments.
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
This patch removes the indentation problem. The patch includes a long comment about the change.
wmiv.c: In function ‘main’:
wmiv.c:843:4: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
if (e.xclient.data.l[0] == delWindow)
^~
wmiv.c:845:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
break;
^~~~~
Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
This patch removes the format-truncation warning. The problem is because buf and comm are arrays with the same size (PATH_MAX). In the snprintf, comm is copied to buf, more some extra characters. The patch reduces the size for the array comm in the extra characters. Without the patch, the comm array is truncated. With the patch, the same characters are copied, without the warning.
wmgenmenu.c: In function ‘find_and_write’:
wmgenmenu.c:436:41: warning: ‘snprintf’ output may be truncated before the last format character [-Wformat-truncation=]
snprintf(buf, sizeof(buf), "%s -e %s", terminal ? terminal : "xterm" , comm);
^
wmgenmenu.c:436:5: note: ‘snprintf’ output 5 or more bytes (assuming 4105) into a destination of size 4104
snprintf(buf, sizeof(buf), "%s -e %s", terminal ? terminal : "xterm" , comm);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
As reported in Debian bug #922284 [1]:
As evident from the prefix, GNUSTEP_USER_ROOT is a GNUstep variable and
Window Maker should not set it. Furthemore, it has been deprecated for
12 years already. As of gnustep-make/2.7.0-4 the GNUstep build system
is configured in strict v2 mode which makes it impossible to compile
GNUstep software. In a terminal started from a Window Maker session:
yavor@aneto:/tmp/gorm.app-1.2.24$ make
This is gnustep-make 2.7.0. Type 'make print-gnustep-make-help' for help.
Running in gnustep-make version 2 strict mode.
rm -f InterfaceBuilder; \
ln -s GormLib InterfaceBuilder
/usr/share/GNUstep/Makefiles/config-noarch.make:121: *** GNUSTEP_USER_ROOT
is obsolete. Stop.
It is also impossible to build gnustep-make from pristine upstream
source:
yavor@aneto:/tmp$ wget -q
ftp://ftp.gnustep.org/pub/gnustep/core/gnustep-make-2.7.0.tar.gz
yavor@aneto:/tmp$ tar xzf gnustep-make-2.7.0.tar.gz
yavor@aneto:/tmp$ cd gnustep-make-2.7.0/
yavor@aneto:/tmp/gnustep-make-2.7.0$ ./configure
...
yavor@aneto:/tmp/gnustep-make-2.7.0$ make
config-noarch.make:121: *** GNUSTEP_USER_ROOT is obsolete. Stop.
Note that the majority of GNUstep users use Window Maker as their window
manager and many of them build GNUstep software from source, mostly
because of the GNUstep Objective-C runtime which depends on Clang
(Debian packages use GCC and the GCC/GNU runtime).
Our solution is to replace the GNUSTEP_USER_ROOT environment variable with our
own environment variable, WMAKER_USER_ROOT. This is documented in NEWS.
[1] https://bugs.debian.org/922284
Many of the menu files contain the macro #wmdatadir# as a placeholder for
the data directory containing Window Maker themes, styles, background
pixmaps, etc. This macro is replaced by the the actual path to the data
directory (by default /usr/local/share/WindowMaker) by the wmaker.inst
script, but only when copying WMRootMenu to the user's home directory.
Instead, we replace the macro during the build. This way, *every* menu
file has the correct path.
Note that several of the files in question were not previously generated
during build. These have been renamed with a .in extension.
From https://standards.freedesktop.org/menu-spec/latest/apa.html:
Category-based menus based on the Main Categories listed in this
specification do not provide a complete ontology for all available
applications. Category-based menu implementations SHOULD therefore provide
a "catch-all" submenu for applications that cannot be appropriately placed
elsewhere.
Emphasis on *submenu*. By using 'Applications', these menu entries were
sorted into the top level.
From https://standards.freedesktop.org/menu-spec/latest/apas03.html:
Reserved Categories have a desktop-specific meaning that has not been
standardized (yet). Desktop entry files that use a reserved category MUST
also include an appropriate OnlyShowIn= entry to restrict themselves to
those environments that properly support the reserved category as used.
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 <ametzler@bebt.de>
Some (presumably stale) calls to wcopy_file used what appears to
be an incorrect destination which did not always exist. This patch
forces assets to be copied under <themedir>/<asset>, rather than
<themedir><absolute path of asset>. It works by first getting the
"new" path (i.e. the one that will be inserted in the property
list), which is relative to <themedir> (and appears to be always
in the root directory, too); it then copies the file to that path.
This *may* have been the original intended behaviour, as the one
it replaces clutters the path and leaks configuration data. In
addition, the style file seems to store only the file's name, not
the path relative to <themedir>, even when the file is copied with
its full hierarchy.
Signed-off-by: Alexandru Lazar <alazar@startmail.com>
In particular, we add entries for the two command line options for `make
check` to work, add some whitespace for readability, and enclose the keys
in brackets so `make check` doesn't think the - key is one of the command
line options. We also capitalize Esc and the letter keys for readability.
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.curis@free.fr>
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.curis@free.fr>
With the new target, it is now easy to update all translations in the
project for a language against latest code with the simple command, run
from the top directory:
make update-lang PO=<lang>
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Removed the information dispatched in the many po/README files and created
a more elaborate chapter in the README.i18n file to explain the process
involved to participate.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
When support for translated languages was enabled, the localisation files
were installed, but make uninstall did not take care to remove them. This
patch fixes this by properly removing them.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
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.curis@free.fr>
The program may not be installed because it is not needed for non-dev
activities, so it is better to check at the beginning than to let the
compilation fail later. The check is done only if the user has specified
that he wants to install translations.
Took the opportunity to make the generation of "mo" file follow the silent
rules in Makefiles if user enabled them.
Signed-off-by: Christophe <curis@Ares.blacknet.hell>
The main change is to use Autoconf's syntax for consistency;
Now the detected program is used in the makefiles (user has the possibility
to change the name of the command);
A conditional is used to avoid enabling make targets that would fail if
the command does not exist.
Took opportunity to implement the silent-rules compliance to POT generation
rules.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Having the name of the domain hard-coded in many places in the makefiles
makes it harder to maintain them, specially because much code is duplicated
between the makefiles that handle po files.
There is now the variable DOMAIN that is set once in each concerned
makefile, and the rest of the makefile makes use of it.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
The permissions are already set correctly by the installation script, so it
it not necessary to re-do it afterwards, it makes the code more complex and
error prone, so this patch removes these chmods.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
As pointed by gcc, this macro is not used anywhere in the 2 files. Because
the code also suggests that they should be inherited from any other place
anyway, remove them from the file to prevent them from being used in the
future.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
A few files are generated using custom commands, which so far did not
follow the silent rule as the compilation stuff.
This patch adds the needed stuff so they will also be silent if the user
wants so, leading to a cleaner build process where warning/error messages
are more visible.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
The memory was allocated with wmalloc, so for consistency it should be
freed using wfree. This could be a problem if the user compiled with
support for Boehm GC, or if we later decide to add support for other malloc
libraries.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
As pointed by Coverity, the function handles the case where the file to be
copied is not found by properly warning the user and the deleting the
currently built theme directory, but then it continued executing the file
copy that would crash on the null pointer.
This patch just adds the missing return that will avoid the crash.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Catch-up and some cosmetic changes of the Dutch .po files
Recently added msgid's were translated, plus a few really minor
changes. Kept some entries for last stable release.
As reported by Milan Čermák, using this variable breaks compilation on
Solaris, because it is a hack which is not standard. To ensure portability,
we now rely on main's argv[0] which is always available.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Previously, the directory was expected to already exist, but as now it is
automatically created it is a good idea in case of problem to have the
message clearer.
Took opportunity to indent properly that part of code.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>