This starts to establish the structure for an in-place rewrite of WINGs. An
actual redesign of WINGs may follow, but for now there are no plans to alter the
structure of WINGs substantially.
This is a bit of a red herring, since WMTree is only used in wmmenugen, which I
don't think I've ever directly used. See notes at the top of tree.rs for more
musings on whether this should be in wutil-rs at all.
WMTreeWalk is only called once, with depthFirst set to true, so we might as well
just hard-code that behavior.
Also, this parameter appears to have been misnamed (since the search is always DFS)
and should properly be named to indicate that it controls if this is a pre- or
post-order traversal.
This fixes a lot of memory bugs which arose as a result of doing something
different from the system malloc/free when allocators were rewritten in Rust.
These changes originate from a different approach to writing the allocator in
Rust:
https://git.sdf.org/vitrine/wmaker/pulls/1/files#diff-04a0fd2319b9969373b75377716e45c836d22869
There are other function calls (to XFree) that need to be fixed, but that can be
done in another commit. This one is already getting large.
While this large change has some unit tests, it has not been integration tested
thoroughly. Removing the global case insensitivity flag may be an issue in
particular.
A few of PropList API functions have been modified (mostly to get rid of
varargs). The definition of one such function has been left in C for cleanup
later.
This is another utility that should not be used in any new (Rust) code. (We
should prefer Vec or something similar.) This should be removed once dependents
are ported to Rust.
This is not a bug-for-bug reimplementation, and it may need some shaking down to
ensure that everything still works. Once their dependents are ported, it would
be appropriate to dispose of them.
This patch adds sr.po files to Makefile.am files throughout the repository
where needed. It also adds credits for Serbian localization in README files as
needed.
Signed-off-by: Страхиња Радић <contact@strahinja.org>
Currently, menu definitions created by wmgenmenu don't include the closing
parenthesis in vgradient constructs. This patch adds the missing closing
parentheses.
Signed-off-by: Страхиња Радић <contact@strahinja.org>
Whenever wtokensplit is used to split into argv/argc, it's better to
use the built-in function wtokenfree() as a wfree call only on argv
is not freeing the memory properly.
The call to 'snprintf' may change the value of 'errno', which means that
the 'perror' call would print a wrong error message, not the one from
'fopen'.
I cannot imagine that modifying an existing ~/.xinitrc is ever wanted, and creating an ~/.xinitrc when none exists is much worse.
If a user created their own ~/.xinitrc, then don't modify it.
The user will modify it if they like.
If the user did not create their own ~/.xinitrc, then creating one will short-circuit X startup as `startx` will *replace* the system's version with the user's version.
Literally ~/.Xresources won't be loaded.
There's no way this is expected behavior.
Replace calls to wusergnusteppath() which just append "/Library" by calls
to wuserdatapath().
Take opportunity to replace hardcoded "/WindowMaker" directories with
the existing PACKAGE_TARNAME macro (which comes from autotools).
The choice of 'TARNAME' is because it meant to be used in filename, thus
less likely to have problematic characters than PACKAGE_NAME (meant for
display purpose) and PACKAGE which is there for historical reason.
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.