The mixed-option parsing code includes an assertion that short-form
options have a length of two. However, there is no other validation of
this requirement and some dock-apps do not comply with it, which means
that if one exec's them with an unrecognized option or a mix of short
options, the assertion fails and the app aborts.
For example:
$ /usr/bin/wmail --help | grep '\<display\>'
-display <string> display to use
$ /usr/bin/wmail --blah
wmail: daargs.c:126: contains: Assertion `strlen(needle) == 2' failed.
Aborted
Since there is no explicit statement of this requirement, let's replace
the assertion with a conditional.
- "Untitled window" appears in xfce4-wmdock-plugin's enumeration of
dockapps using libdockapp.
- Reference to string buffer that might not live long enough.
libdockapp supports shaped dockapps with the DASetShape() function, but this
function requires as input a bitmap. Previously, there was no support for
creating such a bitmap from XBM data without using Xlib directly.
We add two functions, DAMakeShapeFromData(), which is a wrapper around
XCreateBitmapFromData and allows developers to #include XBM data, and
DAMakeShapeFromFile(), which is a wrapper around XReadBitmapfile and
lets developers specify the path to an XBM file.
Some dockapps may want to handle command line options themselves, so we
make this function optional.
Previously, if this function was skipped, then a segfault would result when
trying to access the _daContext global while first creating the dockapp
window.
Now we check if _daContext has been initialized first, and if not, we
initialize it.
In Window Maker, windows with application class "DockApp" are automatically
withdrawn. We don't want this in windowed mode. We use the application
name instead, with the usual convention of capitalizing the initial letter.
Patch by Corin-EU from GitHub [1].
In libdockapps file wmgeneral.c, wname is set from argv[0] and is then used
to set the window name and class resource. Often applications are called with
their full path which then means that the window name has a path in it,
thereby requiring an unwieldy path specific string for "Name" in WMState if
the applet is to be captured in the WM dock.
The simple solution is that wname should be the basename of argv[0] to
ensure that the window name for the applet is the simple and obvious one.
Thus the inclusion of header file libgen.h is required.
Just say "no" to path slashes "/" in window name/class resources ....
[1] https://github.com/d-torrance/dockapps/issues/5
This fixes the package-contains-timestamped-gzip warning given by Lintian
for the Debian package. (This warning is really unnecessary, as its purpose
it to check for reproducible builds and the fonts are not compressed at
build time, but I see no harm in removing these timestamps.)
In the README it is said to run ./configure but there's no such script in the
tarball. I wrote instructions to generate a ./configure with libtool and autotools.
This patch includes the libwmgeneral library in the libdockapp
library.
The new library is now version 3 (previous was version 2) and it
includes the new include folder in $libdir/libdockapp.
The wmgeneral files were moved from the previous folder (libwmgeneral)
and the folder is now removed.
Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
Otherwise, we get the following compiler warning:
basic.c: In function ‘main’:
basic.c:111:2: warning: implicit declaration of function ‘time’ [-Wimplicit-function-declaration]
srandom(time(NULL));
^