1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-18 20:10:29 +01:00
Commit Graph

351 Commits

Author SHA1 Message Date
Christophe CURIS
0e274dc979 WRaster: Fix incorrect use of macro USE_XSHM in installed header
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>
2021-05-18 17:50:43 +01:00
Christophe CURIS
0ac6827a9b wmmenugen: Fix memory leaks when parsing menu in wmconfig format
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>
2021-05-18 17:49:17 +01:00
Christophe CURIS
f030ab7664 wmmenugen: Fix memory leaks in XDG menu generation when getting locale-dependant name
As reported by Coverity as CID #50142, #50143, #50144 and #50145, all the
strings allocated by 'parse_locale' were never freed.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-05-18 17:49:17 +01:00
Christophe CURIS
2a8fc1df9a wmmenugen: Fix memory leak when parsing names for menus in XDG format
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>
2021-05-18 17:49:17 +01:00
Christophe CURIS
296456f361 wmmenugen: Fix memory leak when parsing categories in an XDG menu
Reported by Coverity (CID #50147)

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-05-18 17:49:17 +01:00
Doug Torrance
54a24ab6f7 Remove trailing whitespace.
Also, the script is a one-liner, stolen from [1]:

ack --print0 -l '[ \t]+$' | xargs -0 -n1 perl -pi -e 's/[ \t]+$//'

[1]
https://stackoverflow.com/questions/149057/how-to-remove-trailing-whitespace-of-all-files-recursively
2020-04-09 14:28:09 +01:00
Doug Torrance
a17d131da3 Remove apostrophes from instances of possessive "its".
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".
2020-04-09 09:05:50 +01:00
David Maciejak
bb716a4ca1 util: renamed wmiv DEBUG constant name
To prevent compilation warning message saying DEBUG name is already defined
2020-03-28 10:13:11 +00:00
Jeremy Sowden
4477ae4da4 Prefer TryExec to Exec when generating menu entries from XDG desktop files.
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>
2019-06-20 22:06:36 +01:00
Jeremy Sowden
9330a021e5 Omit field-code in Exec fields when generating menu-entries from XDG desktop-files.
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>
2019-06-20 22:06:36 +01:00
Jeremy Sowden
41ab926090 Parse Exec fields when generating menu-entries from XDG desktop-files.
Exec fields in desktop-files are subject to escaping.  Unescape them.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
2019-06-20 22:06:36 +01:00
Jeremy Sowden
b32ccee5cb Undo XDG string-escaping when generating menu-entries.
In XDG desktop files, string values are subject to escaping.  Undo this
when parsing them.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
2019-06-20 22:06:36 +01:00
Jeremy Sowden
6734646265 Use pointers as parameters instead of pointer-to-pointers.
Some functions expected pointers-to-pointers where pointers would do.
Changed them to use pointers.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
2019-06-20 22:06:36 +01:00
Rodolfo García Peñas (kix)
00dffbe317 wmiv.c Removed indentation warning
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>
2019-06-20 22:04:31 +01:00
Rodolfo García Peñas (kix)
7759d06851 wmgenmenu.c Removed format-truncation
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>
2019-06-20 22:04:31 +01:00
Carlos R. Mafra
6c6853ea30 util: add wmiv entry to README 2019-06-15 16:49:34 +01:00
Doug Torrance
738a78b3e2 Replace GNUSTEP_USER_ROOT environment variable with WMAKER_USER_ROOT
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
2019-02-17 18:44:33 +00:00
Carlos R. Mafra
f1809a7786 wmgenmenu: add a few programs 2019-01-22 22:25:06 +00:00
Doug Torrance
100745d356 setstyle: Add support for fpixmap ("fillscale") textures 2018-05-15 19:55:28 +01:00
Doug Torrance
d364afff02 menu: Write data directory during build instead of with wmaker.inst.
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.
2017-08-18 02:14:11 +01:00
Doug Torrance
ff865c31f0 wmmenugen: Sort menu entries with no category into 'Other'. 2017-07-07 09:59:29 +01:00
Doug Torrance
adc1687f98 wmmenugen: Use 'Other' instead of 'Applications' for unknown categories.
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.
2017-07-07 09:59:29 +01:00
Doug Torrance
ac0690b324 wmmenugen: Add reserved categories.
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.
2017-07-07 09:59:29 +01:00
Doug Torrance
c261f8ec35 wmmenugen: Add missing 'Science' menu category.
See https://standards.freedesktop.org/menu-spec/latest/apa.html
2017-07-07 09:59:29 +01:00
Christophe CURIS
e037ae3684 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 <ametzler@bebt.de>
2017-07-03 14:45:26 +01:00
6e4698fe11 Fixed couple of compilator warning and removed unused macros. 2017-02-25 10:19:52 +00:00
Alexandru Lazar
b7a1528833 getstyle: fix wcopy_file paths
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>
2016-04-24 19:11:08 -04:00
Doug Torrance
2ea6162629 wmmenugen: Fix segfault; argv[argc] doesn't exist. 2016-04-24 19:05:34 -04:00
Alwin
7fa14a0137 Translations: Frisian language files updated
New entries were translated, and a lot improved.
2016-01-21 13:10:43 -05:00
Alwin
eb1c06d704 New translation into Frisian for Window Maker
This is a complete translation into the Frisian language, mainly
done by translating it from the Dutch language files already in
Window Maker.
2015-06-14 19:36:24 +01:00
Doug Torrance
1b1cb99e36 wmiv: Improve help text.
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.
2015-06-13 08:40:50 -06:00
Doug Torrance
08b27e5edd wmiv: Add long command line options --help and --version.
We will need --help for `make check` to work once we add a manpage.
2015-06-13 08:40:50 -06:00
Christophe CURIS
0a009143c3 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.curis@free.fr>
2015-05-23 18:53:19 +01:00
Christophe CURIS
c743c4b77b 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.curis@free.fr>
2015-04-18 19:31:10 +01:00
Christophe CURIS
a9a0d2ac85 make: new target 'update-lang' to update the PO files for a languages against latest sources
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>
2015-01-20 21:29:24 +00:00
Christophe CURIS
2429d5e196 doc: explain how to help translating the Window Maker project
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>
2015-01-20 21:29:24 +00:00
Christophe CURIS
740c812476 make: remove installed translations when performing Uninstall
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>
2015-01-20 21:29:24 +00:00
Christophe CURIS
bf6bc120a5 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.curis@free.fr>
2015-01-20 21:29:24 +00:00
Christophe CURIS
b944a4beb2 configure: add check for the program "msgfmt" when i18n is requested
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>
2015-01-20 21:29:24 +00:00
Christophe CURIS
2cfb2b5276 configure: rewrote detection for 'xgettext'
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>
2015-01-20 21:29:24 +00:00
Christophe CURIS
bb544439f4 make: add a variable 'DOMAIN' for the name of the pot and mo files
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>
2015-01-20 21:29:24 +00:00
Christophe CURIS
c72f013136 make: remove unnecessary chmod when creating directories for locales installation
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>
2015-01-20 21:29:24 +00:00
Alwin
1dc7dc4309 Translations: Dutch .po files updated
Recently added/changed msgid's were translated, plus a few cosmetic
improvements. Kept one entry for last stable release.
2014-12-23 11:33:36 +00:00
Christophe CURIS
0e884f793a util: remove local constants GLOBAL_DEFAULTS_SUBDIR that are not used
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>
2014-12-10 10:19:20 +00:00
Christophe CURIS
d9438e65ef makefile: make silent rule work also for generated files
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>
2014-12-10 10:19:18 +00:00
Christophe CURIS
a24efec61f util: use wfree instead of free for consistency
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>
2014-11-29 18:44:48 +00:00
Christophe CURIS
6397f3403a util: return from 'findCopyFile' if the source file could not be found (Coverity #50075)
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>
2014-11-29 18:44:48 +00:00
Alwin
40139e208b Catch-up and some cosmetic changes of the Dutch .po files
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.
2014-11-23 22:42:18 +00:00
Christophe CURIS
3de5b8fb42 util: removed usage of external '__progname' because it is not portable
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>
2014-11-02 13:08:59 +01:00
Christophe CURIS
461214d870 util: clarify error message in "wmaker.inst" in case of directory creation failure
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>
2014-11-02 13:04:14 +01:00