wmaker-crm.git
3 years agoAdd icon sizes
Xander [Tue, 4 May 2021 11:24:23 +0000 (4 14:24 +0300)]
Add icon sizes

The classic WindowMaker allows tile icon size up to 96x96 px. This patch rises this value
to 256x256 px. It also sets the max number of visible items in the corresponding pref list
to 29 (instead of 9), so the new values show up in the list. This patch makes it possible
to use dockapps that allow changing their size to bigger than 64x64 px, see
https://gitlab.com/xander1988/dockapps for more info.

3 years agoCorrect calculation of usable space for reserved area.
Roman Dobosz [Thu, 18 Mar 2021 15:41:36 +0000 (18 16:41 +0100)]
Correct calculation of usable space for reserved area.

Previous patch has correct the way, how reserved area found in
_NET_WM_STRUT was calculated. Unfortunately, the calculation was not
precise, as for not reserved areas (i.e. values of 0 for one of the
cardinals is set) must be calculated anyway for given head, otherwise
usable area might be too broad.

3 years agoCorrect way for reserved space on multihead environment.
Roman Dobosz [Tue, 16 Mar 2021 20:34:51 +0000 (16 21:34 +0100)]
Correct way for reserved space on multihead environment.

Applications such a panels or docks have ability for reserving space so
that no windows should cover or overlap them. There is (partially)
support for it by checking the _NET_WM_STRUT property, although
calculation for the reserved space was wrong in case of several heads
enabled.

In this patch calculation for reserved area has been corrected.

3 years agoTippfehler in de.po von WPrefs (WindowMaker)
Helge Kreutzmann [Mon, 7 Dec 2020 15:54:00 +0000 (7 16:54 +0100)]
Tippfehler in de.po von WPrefs (WindowMaker)

per Zufall habe ich einen Tippfehler gefunden

3 years agoAdd support for _NET_WM_STATE_FOCUSED
Nick Berendsen [Tue, 27 Oct 2020 15:01:56 +0000 (27 15:01 +0000)]
Add support for _NET_WM_STATE_FOCUSED

Thanks to Jeremy Sowden for sending the patch to the mailing list.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
3 years agoPatch for GetCommandForPid() in osdep_darwin.c
Diedrich Vorberg [Mon, 19 Oct 2020 19:38:29 +0000 (19 20:38 +0100)]
Patch for GetCommandForPid() in osdep_darwin.c

the function mentioned above caused segfaults on MacOS. The attached patch
seems to solve that.

Details: The functions provides an array of string pointers (the argument
vector) pointing to a buffer allocated and referred to by a static local
variable `args`. This buffer was used on each subsequent call. For one
thing this would overwrite old values and for another this caused segfaults.

My new implementation allocates a buffer for the argument vector plus the
actual string data on each call. The caller will wfree() the buffer, but
until then has available an independent copy of the strings.

3 years agoAdded Expert option: "Close rootmenu when mouse (left or right) is clicked outside...
Alexander Komarov [Wed, 9 Sep 2020 10:29:11 +0000 (9 13:29 +0300)]
Added Expert option: "Close rootmenu when mouse (left or right) is clicked outside focus.

Common WindowMaker's rootmenu behavior if press right mouse button open menu and close only with same button.
It's uncomfortably, it patch  allows close menu by left or right is clicked outside focus.
Changed func "static WMenu*configureMenu(WScreen *scr, WMPropList *definition)" to non-static forglobal use.
Added new  OPTION_WMAKER for this Expert-option. Changed event.c: for correct work should use initialization
func configureMenu afterwMenuDestroy (this is a feature of the event implementation XEvent).

3 years agoChanged Russian translation
Alexander Komarov [Tue, 11 Aug 2020 06:09:06 +0000 (11 09:09 +0300)]
Changed Russian translation

3 years agoDouble click on titlebar maximize a window to fullscreen
Alexander Komarov [Mon, 10 Aug 2020 10:47:23 +0000 (10 13:47 +0300)]
Double click on titlebar maximize a window to fullscreen

3 years agoWPrefs: Create Turkish translation
XOR [Sun, 28 Jun 2020 10:29:41 +0000 (28 12:29 +0200)]
WPrefs: Create Turkish translation

3 years agoTell git to ignore files created during i18n preparation
Christophe CURIS [Sun, 28 Jun 2020 10:29:40 +0000 (28 12:29 +0200)]
Tell git to ignore files created during i18n preparation

The 'pot' files are templates generated when we want to update the 'po'
files against latest source code;

the 'mo' files are compiled 'po' files to be installed

3 years agoTurn off automake's warning messages about using GNU make extensions
Doug Torrance [Mon, 22 Jun 2020 15:04:01 +0000 (22 11:04 -0400)]
Turn off automake's warning messages about using GNU make extensions

We've been using addsuffix in WindowMaker/Makefile.am and may use others
in the future.

3 years agoRemove Debian related build files.
Roman Dobosz [Sun, 31 May 2020 14:54:23 +0000 (31 16:54 +0200)]
Remove Debian related build files.

Keeping Debian related build files should not be the duty of wmaker
development team, but Debian package maintainers.

4 years agoFix typo on defining imagemagick version.
Roman Dobosz [Mon, 20 Apr 2020 05:53:22 +0000 (20 07:53 +0200)]
Fix typo on defining imagemagick version.

In this patch we will fix an issue during compilation on systems, which
have ImageMagick version 7, and slightly more recent version of
compiler. If we define USE_MAGICK with null value, compilation will fail
on preprocessor check on such defined variable.

4 years agowrlib: Fix typo in macro containing ImageMagick version
Doug Torrance [Sun, 19 Apr 2020 03:00:34 +0000 (18 23:00 -0400)]
wrlib: Fix typo in macro containing ImageMagick version

It's USE_MAGICK, not USE_MAGIC.  Also, we wrap the if/else statement
in an ifdef.  This doesn't really affect anything since load_magick.c
won't be compiled if USE_MAGICK is undefined because of an if statement
in the Makefile.  But in the off chance that it is somehow, then we will
try to load a nonexistent version 6 header file since USE_MAGICK will
be interprested as 0 and 0 < 7 is true.

4 years agodebian: Remove ImageMagick patch; an equivalent patch now exists in next
Doug Torrance [Sun, 19 Apr 2020 02:24:53 +0000 (18 22:24 -0400)]
debian: Remove ImageMagick patch; an equivalent patch now exists in next

If a user wanted to build a Debian package from the next branch, then
it would fail immediately when quilt tried to apply the patches.

4 years agocheckpatch.pl: Escape curly braces in regexes
Doug Torrance [Sat, 18 Apr 2020 21:20:14 +0000 (18 17:20 -0400)]
checkpatch.pl: Escape curly braces in regexes

Unescaped curly braces  have been deprecated since Perl 5.26 and are
illegal in Perl 5.30. I copied the relevant lines from the latest kernel
source, so we'll inherit a couple other improvements as well.

4 years agodebian: Update with version 0.95.9-2 packaging.
Doug Torrance [Sat, 18 Apr 2020 18:28:42 +0000 (18 14:28 -0400)]
debian: Update with version 0.95.9-2 packaging.

4 years agoFix various abs() issues.
Doug Torrance [Sat, 18 Apr 2020 18:28:41 +0000 (18 14:28 -0400)]
Fix various abs() issues.

The abs() function should take an int as argument, but there were
several instances in the code where it was taking an unsigned int or a
double.  In these case, we took one of the following approaches:

* If the argument was a double, use fabs() instead.
* If the argument was unsigned and was certainly going to be positive
  (i.e,. no subtraction), then drop abs() altogether.
* If the argument was unsigned as result of adding or subtracting signed
  and unsigned ints, then we cast all the unsigned ints to signed ints.

4 years agowrlib: Compile with either ImageMagick 6 and 7
Doug Torrance [Sat, 18 Apr 2020 18:28:40 +0000 (18 14:28 -0400)]
wrlib: Compile with either ImageMagick 6 and 7

We dropped ImageMagick 6 support in 0.95.9.  However, ImageMagick 6 is
still widespread (e.g., ImageMagick 7 has not been packaged in Debian
yet), and upstream plans on maintaining it until at least 2028 [1].

In this patch, we detect the version of the MagickWand library installed
on the user's system and include the appropriate header file when
building wrlib.

Note: I've only tested this with ImageMagick 6, so I'd appreciate
confirmation that it works with ImageMagick 7.

[1] https://github.com/ImageMagick/ImageMagick6/blob/master/NEWS.txt

4 years agodebian: Update with version 0.95.9-1 packaging.
Doug Torrance [Fri, 17 Apr 2020 02:49:30 +0000 (16 22:49 -0400)]
debian: Update with version 0.95.9-1 packaging.

4 years agowmlib: Use X flags from configure
Doug Torrance [Thu, 9 Apr 2020 13:50:13 +0000 (9 09:50 -0400)]
wmlib: Use X flags from configure

We use the AC_PATH_XTRA macro to find all the X library paths during
build, but we weren't actually using the variables it generated for
building wmlib.  Instead, we just hardcoded the linker flag "-lX11",
which may or may not actually work.

4 years agoconfigure: Fix typo in libXmu check.
Doug Torrance [Thu, 9 Apr 2020 13:50:12 +0000 (9 09:50 -0400)]
configure: Fix typo in libXmu check.

As the literal string "wm_cv_xext_xmu" will never be equal to "xno",
we always ran the code that was supposed to run when the variable
$wm_cv_xext_xmu was not equal to "no".  In particular, if libXmu
was not found, then we proceeded as if it had been found.

4 years agoRemove trailing whitespace.
Doug Torrance [Thu, 9 Apr 2020 04:00:14 +0000 (9 00:00 -0400)]
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

4 years agoRemove apostrophes from instances of possessive "its".
Doug Torrance [Thu, 9 Apr 2020 04:00:55 +0000 (9 00:00 -0400)]
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".

4 years agoconfigure: Allow changing default search paths
David Michael [Thu, 16 Jan 2020 19:59:33 +0000 (16 14:59 -0500)]
configure: Allow changing default search paths

This changes the behavior of the --with-{inc,lib}s-from arguments
to replace the default paths instead of adding to them.  This is
required when cross-compiling in a sysroot, since the default paths
will include files from the host system which can have an
incompatible architecture.

4 years agoWindow Maker 0.95.9wmaker-0.95.9
Carlos R. Mafra [Sat, 4 Apr 2020 10:02:28 +0000 (4 11:02 +0100)]
Window Maker 0.95.9

4 years agoUpdate .gitignore file
Carlos R. Mafra [Sat, 4 Apr 2020 09:55:31 +0000 (4 10:55 +0100)]
Update .gitignore file

4 years agoutil: renamed wmiv DEBUG constant name
David Maciejak [Sat, 28 Mar 2020 04:31:22 +0000 (28 12:31 +0800)]
util: renamed wmiv DEBUG constant name

To prevent compilation warning message saying DEBUG name is already defined

4 years agoWPrefs: fixed malformed TIFF file generating libtiff warnings
David Maciejak [Sat, 28 Mar 2020 00:46:57 +0000 (28 08:46 +0800)]
WPrefs: fixed malformed TIFF file generating libtiff warnings

The original ergonomic.tiff file samples/pixel property was wrong which was generating the warning message from libtiff
"TIFFReadDirectory: Warning, Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.."

4 years agoWPrefs: increased open submenu label size
David Maciejak [Fri, 27 Mar 2020 15:10:31 +0000 (27 23:10 +0800)]
WPrefs: increased open submenu label size

Give more space for the open submenu label to be displayed properly

4 years agowrlib: Fixed warning msg using libpng
David Maciejak [Fri, 27 Mar 2020 16:10:18 +0000 (28 00:10 +0800)]
wrlib: Fixed warning msg using libpng

Call png_set_interlace_handling() to get rid of the warning message "libpng warning: Interlace handling should be turned on when using png_read_image"

4 years agobump copyright year in Info Panel
David Maciejak [Wed, 25 Mar 2020 15:10:34 +0000 (25 23:10 +0800)]
bump copyright year in Info Panel

bump copyright year in Info Panel

4 years agoFix typo
David Maciejak [Wed, 25 Mar 2020 15:12:09 +0000 (25 23:12 +0800)]
Fix typo

Renamed isPointNearBoder() function

4 years agoUpdate Armenian translation
nchilingaryan@aua.am [Wed, 4 Mar 2020 15:11:04 +0000 (4 07:11 -0800)]
Update Armenian translation

I did some part of translatin back in 2008, now I fixed bugs and updated it
so that all the messages are translated.

4 years agostrncpy's third argument should be the length of the dest buffer, not the source.
Jeremy Sowden [Fri, 12 Jul 2019 22:28:14 +0000 (12 23:28 +0100)]
strncpy's third argument should be the length of the dest buffer, not the source.

4 years agoFixed expression checking whether flag is set.
Jeremy Sowden [Fri, 12 Jul 2019 22:28:13 +0000 (12 23:28 +0100)]
Fixed expression checking whether flag is set.

4 years agoFixed buffer size.
Jeremy Sowden [Fri, 12 Jul 2019 22:28:12 +0000 (12 23:28 +0100)]
Fixed buffer size.

4 years agoFixed function-pointer compatibility.
Jeremy Sowden [Fri, 12 Jul 2019 22:28:11 +0000 (12 23:28 +0100)]
Fixed function-pointer compatibility.

4 years agoAdded explicit fall-through comments to pacify GCC.
Jeremy Sowden [Fri, 12 Jul 2019 22:28:10 +0000 (12 23:28 +0100)]
Added explicit fall-through comments to pacify GCC.

4 years agoAdded missing function declaration.
Jeremy Sowden [Fri, 12 Jul 2019 22:28:09 +0000 (12 23:28 +0100)]
Added missing function declaration.

4 years agoslight increase in default switch panel icon size to improve border view
Haroldo [Sun, 28 Jul 2019 20:23:07 +0000 (28 22:23 +0200)]
slight increase in default switch panel icon size to improve border view

4 years agohigher resolution images for switch panel
Haroldo [Sun, 21 Jul 2019 19:04:54 +0000 (21 21:04 +0200)]
higher resolution images for switch panel

4 years agomake switchpanel configurable
Haroldo [Sat, 13 Jul 2019 15:57:40 +0000 (13 17:57 +0200)]
make switchpanel configurable

4 years agoPrefer TryExec to Exec when generating menu entries from XDG desktop files.
Jeremy Sowden [Thu, 20 Jun 2019 20:23:55 +0000 (20 21:23 +0100)]
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>
4 years agoOmit field-code in Exec fields when generating menu-entries from XDG desktop-files.
Jeremy Sowden [Thu, 20 Jun 2019 20:23:54 +0000 (20 21:23 +0100)]
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>
4 years agoParse Exec fields when generating menu-entries from XDG desktop-files.
Jeremy Sowden [Thu, 20 Jun 2019 20:23:53 +0000 (20 21:23 +0100)]
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>
4 years agoUndo XDG string-escaping when generating menu-entries.
Jeremy Sowden [Thu, 20 Jun 2019 20:23:52 +0000 (20 21:23 +0100)]
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>
4 years agoUse pointers as parameters instead of pointer-to-pointers.
Jeremy Sowden [Thu, 20 Jun 2019 20:23:51 +0000 (20 21:23 +0100)]
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>
4 years agoload_jpeg.c Return NULL
Rodolfo García Peñas (kix) [Wed, 19 Jun 2019 22:40:12 +0000 (20 00:40 +0200)]
load_jpeg.c Return NULL

The image is NULL, we can return NULL here.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
4 years agoload_jpeg.c Style
Rodolfo García Peñas (kix) [Wed, 19 Jun 2019 22:40:11 +0000 (20 00:40 +0200)]
load_jpeg.c Style

This patch is just coding style. Removes some empty lines,...

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
4 years agoload_jpeg.c Removed dead code
Rodolfo García Peñas (kix) [Wed, 19 Jun 2019 22:40:10 +0000 (20 00:40 +0200)]
load_jpeg.c Removed dead code

This patch removes the code not used. Because the if block
check that buffer[0] is NULL, then, we don't need check it
again inside.

Image is not used yet, so is NULL. We can return NULL.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
4 years agoload_jpeg.c Clean code
Rodolfo García Peñas (kix) [Wed, 19 Jun 2019 22:40:09 +0000 (20 00:40 +0200)]
load_jpeg.c Clean code

This patch returns NULL, because the variable image is not used yet.

The patch also removes three lines:

- buffer[0] = NULL;       /* Initialize pointer to avoid spurious free in cleanup code */
  RErrorCode = RERR_BADIMAGEFILE;
  jpeg_destroy_decompress(&cinfo);
  fclose(file);
- if (buffer[0])
-    free(buffer[0]);

buffer is a local variable. The malloc is not used yet. So:

- We set the value to NULL, then check if is null to call free(). So the free()
  call is never used. We can remove the last too lines.
- We don't need set now to NULL, because the variable is empty (the
  initializated (or not) value is not used, and is destroyed as local variable
  when we returns, just one line later.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
4 years agoload_jpeg.c Removed goto
Rodolfo García Peñas (kix) [Wed, 19 Jun 2019 22:40:08 +0000 (20 00:40 +0200)]
load_jpeg.c Removed goto

This patch removes the goto call. I copied the code after the bye: label and
I paste it in the goto-calls.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
4 years agoWPrefs.c Removed format-overflow warning
Rodolfo García Peñas (kix) [Wed, 19 Jun 2019 19:11:07 +0000 (19 21:11 +0200)]
WPrefs.c Removed format-overflow warning

This patch adds some characters to the mbuf buffer, to allow the buffer size and some extra characters.

WPrefs.c: In function ‘loadConfigurations’:
../src/wconfig.h:400:17: warning: ‘%s’ directive writing up to 1023 bytes into a region of size 1018 [-Wformat-overflow=]

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
4 years agoAppearance.c Removed fallthrough warning
Rodolfo García Peñas (kix) [Wed, 19 Jun 2019 19:11:06 +0000 (19 21:11 +0200)]
Appearance.c Removed fallthrough warning

This patch adds some comments to remove the falthrough warning.

Appearance.c: In function ‘renderTexture’:
../WINGs/WINGs/WUtil.h:230:32: warning: this statement may fall through [-Wimplicit-fallthrough=]
 #define wwarning(fmt, args...) __wmessage( __func__, __FILE__, __LINE__, WMESSAGE_TYPE_WARNING, fmt, ## args)
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Appearance.c:675:4: note: in expansion of macro ‘wwarning’
    wwarning(_("unknown direction in '%s', falling back to diagonal"), type);
    ^~~~~~~~
Appearance.c:676:3: note: here
   case 'D':
   ^~~~

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
4 years agowmiv.c Removed indentation warning
Rodolfo García Peñas (kix) [Wed, 19 Jun 2019 19:11:05 +0000 (19 21:11 +0200)]
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>
4 years agowmgenmenu.c Removed format-truncation
Rodolfo García Peñas (kix) [Wed, 19 Jun 2019 19:11:04 +0000 (19 21:11 +0200)]
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>
4 years agogradient.c Removed implicit-fallthrough warnings
Rodolfo García Peñas (kix) [Wed, 19 Jun 2019 19:11:03 +0000 (19 21:11 +0200)]
gradient.c Removed implicit-fallthrough warnings

This patch adds the comments to remove the warnings.

gradient.c: In function ‘renderGradientWidth’:
gradient.c:162:10: warning: this statement may fall through [-Wimplicit-fallthrough=]
   *ptr++ = b;
   ~~~~~~~^~~
gradient.c:163:2: note: here
  case 2:
  ^~~~
gradient.c:166:10: warning: this statement may fall through [-Wimplicit-fallthrough=]
   *ptr++ = b;
   ~~~~~~~^~~
gradient.c:167:2: note: here
  case 1:
  ^~~~

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
4 years agowtextfield.c: Removed multiple warnings
Rodolfo García Peñas (kix) [Wed, 19 Jun 2019 19:11:02 +0000 (19 21:11 +0200)]
wtextfield.c: Removed multiple warnings

This patch removes the implicit-fallthrough warnings for GCC7. Just add the FALLTHRU comment.

4 years agowtext.c Remove warnings
Rodolfo García Peñas (kix) [Wed, 19 Jun 2019 19:11:01 +0000 (19 21:11 +0200)]
wtext.c Remove warnings

This patch removes the FALLTHRU warnings in wtext.c. Only includes the comments for GCC7.

wtext.c: In function ‘handleActionEvents’:
wtext.c:2508:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
   if (event->xbutton.button == Button2) {
      ^
wtext.c:2547:2: note: here
  case ButtonRelease:
  ^~~~
wtext.c: In function ‘handleTextKeyPress’:
wtext.c:2307:11: warning: this statement may fall through [-Wimplicit-fallthrough=]
   *buffer = '\n';
   ~~~~~~~~^~~~~~
wtext.c:2308:2: note: here
  default:
  ^~~~~~~

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
4 years agowruler.c Remove format-truncation warning
Rodolfo García Peñas (kix) [Wed, 19 Jun 2019 19:11:00 +0000 (19 21:11 +0200)]
wruler.c Remove format-truncation warning

This patch removes the format-truncation error. The warning is because c has size of 3, but using "%d" is not possible to store the value.

wruler.c: In function ‘paintRuler.part.0’:
wruler.c:184:28: warning: ‘%d’ directive output may be truncated writing between 1 and 10 bytes into a region of size 3 [-Wformat-truncation=]
    snprintf(c, sizeof(c), "%d", ++j);
                            ^~
wruler.c:184:27: note: directive argument in the range [1, 2147483647]
    snprintf(c, sizeof(c), "%d", ++j);
                           ^~~~
wruler.c:184:4: note: ‘snprintf’ output between 2 and 11 bytes into a destination of size 3
    snprintf(c, sizeof(c), "%d", ++j);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The value "j" is the result of "m < w". w is the result of rPtr->view->size.width - rPtr->margins.left;, and both variables are unsigned int. So the value for w is an unsigned int and m is related to i. m cannot be greater of unsigned int.

i = j = m = 0;
w = rPtr->view->size.width - rPtr->margins.left;
while (m < w) {
XDrawLine(rPtr->view->screen->display, rPtr->drawBuffer,
  rPtr->fgGC, rPtr->margins.left + m, 23, rPtr->margins.left + m, marks[i % 8] + 23);
if (i != 0 && i % 8 == 0) {
snprintf(c, sizeof(c), "%hu", ++j);
WMDrawString(rPtr->view->screen, rPtr->drawBuffer, rPtr->fg,
     rPtr->font, rPtr->margins.left + 2 + m, 26, c, 2);
}
m = (++i) * 10;
}

The printf modifier should be unsigned int.

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
4 years agowidgets.c Removes implicit-fallthrough warning
Rodolfo García Peñas (kix) [Wed, 19 Jun 2019 19:10:59 +0000 (19 21:10 +0200)]
widgets.c Removes implicit-fallthrough warning

This patch removes this warning:

widgets.c: In function `renderPixmap':
widgets.c:385:8: warning: this statement may fall through [-Wimplicit-fallthrough=]
     if (mask)
        ^
widgets.c:388:4: note: here
    case '.':
    ^~~~

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
4 years agowcolorpanel.c Removed hsbInit warnings
Rodolfo García Peñas (kix) [Wed, 19 Jun 2019 19:10:58 +0000 (19 21:10 +0200)]
wcolorpanel.c Removed hsbInit warnings

This patch removes these warnings in the hsbInit function.

wcolorpanel.c: In function ‘hsbInit’:
wcolorpanel.c:3456:16: warning: ‘%u’ directive writing between 1 and 5 bytes into a region of size 4 [-Wformat-overflow=]
  sprintf(tmp, "%d", value[0]);
                ^~
wcolorpanel.c:3456:15: note: directive argument in the range [0, 65535]
  sprintf(tmp, "%d", value[0]);
               ^~~~
wcolorpanel.c:3456:2: note: ‘sprintf’ output between 2 and 6 bytes into a destination of size 4
  sprintf(tmp, "%d", value[0]);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

The problem is that the hue variable in the RHSVColor struct. This variable is not an integer, is a shor variable, so using the printf using the "%d" modifier spects an integer. Using a "%hu" prints a unsigned short value.

typedef struct RHSVColor {
    unsigned short hue;        /* 0-359 */
    unsigned char saturation;      /* 0-255 */
    unsigned char value;        /* 0-255 */
} RHSVColor;

4 years agowcolorpanel.c: Remove warning in rgbIntToChar
Rodolfo García Peñas (kix) [Wed, 19 Jun 2019 19:10:57 +0000 (19 21:10 +0200)]
wcolorpanel.c: Remove warning in rgbIntToChar

This patch removes this warning. The default case should not be used.

wcolorpanel.c: In function ‘rgbIntToChar’:
wcolorpanel.c:2392:2: warning: ‘format’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  sprintf(tmp, format, value[1]);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
4 years agowcolorpanel.c Avoid compiler warning
Rodolfo García Peñas (kix) [Wed, 19 Jun 2019 19:10:56 +0000 (19 21:10 +0200)]
wcolorpanel.c Avoid compiler warning

This patch removes this warning. The patch adds a switch case that never should happend.

wcolorpanel.c: In function ‘rgbInit’:
wcolorpanel.c:3403:2: warning: ‘format’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  sprintf(tmp, format, panel->color.rgb.green);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
4 years agoWINGs/selection.c Removed compiler warning
Rodolfo García Peñas (kix) [Wed, 19 Jun 2019 19:10:55 +0000 (19 21:10 +0200)]
WINGs/selection.c Removed compiler warning

This patch removes this warning:

selection.c:265:64: warning: cast between incompatible function types from ‘int (*)(void *)’ to ‘void (*)(void *)’ [-Wcast-function-type]
  wdata = WMCreateDataWithBytesNoCopy((void *) data, len * bpi, (WMFreeDataProc *) XFree);

Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
4 years agoAdjusted size of the Legal Information panel
Tim Taenny [Tue, 18 Jun 2019 19:17:31 +0000 (18 21:17 +0200)]
Adjusted size of the Legal Information panel

With the changes to the layout, which were introduced in the
previous patch series, and the correction of the default font
size, the Legal Information panel was too small to display the
complete text.
It has been set to a sufficient size.

4 years agoRenamed the ScaleX/Y macros and their local variables
Tim Taenny [Tue, 18 Jun 2019 19:17:30 +0000 (18 21:17 +0200)]
Renamed the ScaleX/Y macros and their local variables

The names of the macros and the local variables that they use
have been changed to make them less "user-space" like.

    ScaleX -> WMScaleX
    ScaleY -> WMScaleY
    fw     -> wmScaleWidth
    fh     -> wmScaleHeight

4 years agoAdjusted scale factors in ScaleX and ScaleY macros
Tim Taenny [Tue, 18 Jun 2019 19:17:29 +0000 (18 21:17 +0200)]
Adjusted scale factors in ScaleX and ScaleY macros

The scale factors in the macros were based on the assumption that
the default font size was 11. But the actual default font size is
12. This value is specified as DEFAULT_FONT_SIZE in
WINGS/configuration.c.

4 years agoUse fixed font size in original WMCreate*Panel functions
Tim Taenny [Tue, 18 Jun 2019 19:17:28 +0000 (18 21:17 +0200)]
Use fixed font size in original WMCreate*Panel functions

Instead of just assuming that the size of the system font has not
been changed by the user, the WMCreateAlertPanel,
WMCreateInputPanel and WMCreateGenericPanel functions now use a
fixed default font size of 12, so that changing the system font's
size in WPrefs.app does not break the fixed layouts of these panels.
("12" is specified as DEFAULT_FONT_SIZE in WINGS/configuration.c)

4 years agoNew functions for the creation of scaled panels (WMCreateScaled*Panel)
Tim Taenny [Tue, 18 Jun 2019 19:17:27 +0000 (18 21:17 +0200)]
New functions for the creation of scaled panels (WMCreateScaled*Panel)

To prevent breaking applications depending on the static layout
behavior of the WMCreateAlertPanel and WMCreateInputPanel functions
in WINGs, the scaling functionality has been moved to the new
functions WMCreateScaledAlertPanel and WMCreateScaledInputPanel.

The system dialogs (wMessageDialog, wExitDialog, etc.) now use the
new functions, thus keeping the improved layout introduced in the
previous patches.

4 years agoutil: add wmiv entry to README
Carlos R. Mafra [Sat, 15 Jun 2019 15:49:34 +0000 (15 16:49 +0100)]
util: add wmiv entry to README

4 years agoImproved layout of the Info Panel
Tim Taenny [Wed, 12 Jun 2019 20:06:30 +0000 (12 22:06 +0200)]
Improved layout of the Info Panel

Instead of relying on static pixel values for position and size of
the widgets, the info panel now scales its widgets based on the
selected system font size.

4 years agoImproved layout of the Legal Panel
Tim Taenny [Wed, 12 Jun 2019 20:06:29 +0000 (12 22:06 +0200)]
Improved layout of the Legal Panel

Instead of relying on static pixel values for position and size of
the widgets, the legal panel now scales its widgets based on the
selected system font size.

4 years agoImproved layout of the Icon Chooser Panel
Tim Taenny [Wed, 12 Jun 2019 20:06:28 +0000 (12 22:06 +0200)]
Improved layout of the Icon Chooser Panel

Instead of relying on static pixel values for position and size of
the widgets, the icon chooser panel now scales its widgets based
on the selected system font size.

4 years agoImproved layout of the Input Panels
Tim Taenny [Wed, 12 Jun 2019 20:06:27 +0000 (12 22:06 +0200)]
Improved layout of the Input Panels

Instead of relying on static pixel values for position and size of
the widgets, the input panels now scale their widgets based on the
selected system font size.

4 years agoImproved layout of the Alert Panels
Tim Taenny [Wed, 12 Jun 2019 20:06:26 +0000 (12 22:06 +0200)]
Improved layout of the Alert Panels

Instead of relying on static pixel values for position and size of
the widgets, the alert panels now scale their widgets based on the
selected system font size.

4 years agoAdded ScaleX and ScaleY macros to WINGs
Tim Taenny [Wed, 12 Jun 2019 20:06:25 +0000 (12 22:06 +0200)]
Added ScaleX and ScaleY macros to WINGs

To reduce code duplication the ScaleX and ScaleY macros have been
moved to WUtil.h. Along with the function WMGetScaleBaseFromSystemFont
these macros can be used in all panels to scale the widgets based on
the current system font size instead of giving fixed pixel sizes which
messes up the panels if a larger system font is selected in WPrefs.

Use the macros in the following way:

    instead of   WMResizeWidget(widget, 128, 64);
                 WMMoveWidget(widget, 32, 32);

    use          int fw, fh;
                 WMGetScaleBaseFromSystemFont(scr->wmscreen, &fw, &fh);
                 WMResizeWidget(widget, ScaleX(128), ScaleY(64));
                 WMMoveWidget(widget, ScaleX(32), ScaleY(32));

4 years agoImproved layout of the widgets in the DockAppSettingsPanel
Tim Taenny [Wed, 12 Jun 2019 20:06:24 +0000 (12 22:06 +0200)]
Improved layout of the widgets in the DockAppSettingsPanel

Instead of relying on static pixel values for position and size of
the widgets, the DockAppSettingsPanel now scales its widgets based
on the selected system font size.

5 years agoDo not stop compilation if library Xmu is not found
Christophe CURIS [Sat, 4 May 2019 12:58:48 +0000 (4 14:58 +0200)]
Do not stop compilation if library Xmu is not found

We use only 1 function from this library, and it is in a case that should
be rare nowadays: displays with indexed color.
This commit makes it acceptable to compile if the library is missing.

5 years agoChange the way the ChangeLog date is extracted for Texi2txt generated docs
Christophe CURIS [Fri, 22 Feb 2019 16:04:15 +0000 (22 17:04 +0100)]
Change the way the ChangeLog date is extracted for Texi2txt generated docs

When building into another directory than in the source, the hard-coded
relative path to the changelog will fail finding the file, causing an empty
date in the generated file when '@today' is used.

This patch is making sure the ChangeLog is taken in the source directory to
avoid any problem.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
5 years agoWINGs: simplify code
Christophe CURIS [Fri, 22 Feb 2019 14:48:17 +0000 (22 15:48 +0100)]
WINGs: simplify code

It looks like the original code was expecting the side effect of specifying
a length in the %d to smartly truncate the number, which it does not.
The new code has the same behaviour without extra complexity.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
5 years agoWPrefs: Dead code removal
Christophe CURIS [Fri, 22 Feb 2019 14:48:16 +0000 (22 15:48 +0100)]
WPrefs: Dead code removal

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
5 years agoDo not allocate memory for a temporary buffer
Christophe CURIS [Fri, 22 Feb 2019 16:03:49 +0000 (22 17:03 +0100)]
Do not allocate memory for a temporary buffer

This kind of things participates in memory fragmentation, so it is
generally a bad practice when an on-stack allocation is enough.
Took opportunity to reduce the buffer size, there's no point in
overallocating memory (the new size being still way too much).

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
5 years agoWPrefs: Prefer use of 'sizeof' instead of hard-coded values
Christophe CURIS [Fri, 22 Feb 2019 14:48:14 +0000 (22 15:48 +0100)]
WPrefs: Prefer use of 'sizeof' instead of hard-coded values

Hard-coding a value is prone to errors when maintaining the code; using the
builtin C macro 'sizeof' is a much safer choice.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
5 years agoReplace GNUSTEP_USER_ROOT environment variable with WMAKER_USER_ROOT
Doug Torrance [Fri, 15 Feb 2019 23:49:49 +0000 (15 18:49 -0500)]
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

5 years agoDrop support for Imagemagick version < 7
Stig-Ørjan Smelror [Tue, 12 Feb 2019 16:43:18 +0000 (12 17:43 +0100)]
Drop support for Imagemagick version < 7

Had to do a few modifications to get WM to build with Imagemagick 7.

Attached is the diff from the latest git checkout.

Cheers,
Stig

5 years agoAdded expert option for WrapAppiconsInDock property to WPrefs
Tim Taenny [Tue, 5 Feb 2019 21:04:51 +0000 (5 22:04 +0100)]
Added expert option for WrapAppiconsInDock property to WPrefs

In 2013 Daniel added the functionality to wrap icons, which are
attached to the dock, around the screen edges when the dock is
being moved vertically.
This patch adds an expert option to WPrefs.app for setting the
property which enables/disables this feature.

Remark: In my opinion, the default value for that property should
        be changed to NO, as this is also the default behavior in
        NeXTSTEP. It is handy to be able to move all these icons
        out of sight when working with maximized application
        windows.

5 years agoAdded feature: automatic scaling of application icons
Tim Taenny [Thu, 31 Jan 2019 16:34:30 +0000 (31 17:34 +0100)]
Added feature: automatic scaling of application icons

If the option "Enforce icon margin" is selected, application window
icons will be selected or scaled so that they only use 75% of the
available icon_size.
Even if the feature is not enabled, this change will scale down
large application icons to icon_size, so that icons can be used
that were rejected by the previous implementation of findBestIcon.
(Example: The Qt Creator icon never showed before, because it is
only provided in 128x128 resolution. Now it's visible.)

5 years agoAdded icon feature option to WPrefs: Enforce icon margin
Tim Taenny [Thu, 31 Jan 2019 16:34:29 +0000 (31 17:34 +0100)]
Added icon feature option to WPrefs: Enforce icon margin

The current findBestIcon function usually selects an icon image
that almost completely fills up the (default) 64x64 pixels of an
icon. As Dan noted in the function, the icon images should use only
75% of the available space, which would result in room for the
miniwindow title and better overall aesthetics.

This feature option provides for enabling such an automatic "icon
shrinking" functionality.

Note: This commit only introduces the new option, not the actual
      image shrinking.

5 years agoUse popup button for animation style instead of option group in WPrefs
Tim Taenny [Thu, 31 Jan 2019 16:34:28 +0000 (31 17:34 +0100)]
Use popup button for animation style instead of option group in WPrefs

To make some room for an additional icon option (yet to be committed)
the options group for selecting the iconification animation is
replaced by a popup button. This allows for adding at least two more
checkboxes in the options and makes adding new animation styles less
painful.

5 years agoFixed icon loading during Attribute Inspector startup
Tim Taenny [Wed, 30 Jan 2019 21:03:35 +0000 (30 22:03 +0100)]
Fixed icon loading during Attribute Inspector startup

When opening the "Icon and Initial Workspace" panel of the Attribute
Inspector, the Miniwindow Image and the corresponding text field were
always empty, even if an icon had been selected, applied and saved
before. The file name was not loaded from the database on startup
of the inspector window.

With this change, the icon and the text field are properly set on
startup of the inspector window.

5 years agowmgenmenu: add a few programs
Carlos R. Mafra [Tue, 22 Jan 2019 22:25:06 +0000 (22 22:25 +0000)]
wmgenmenu: add a few programs

5 years agosupport moving window between heads using keyboard
Gaspar Chilingarov [Sun, 16 Sep 2018 13:55:16 +0000 (16 16:55 +0300)]
support moving window between heads using keyboard

Window Maker allows to perform practically all operations with windows
using only keyboard. One of the actions so far which required using
mouse was dragging window from one head (monitor) to another.

This patch introduces support for keyboard shortcuts. These shortcuts
move windows in circular fashion (if you have 3 and more monitors).

In case of 2 or 3 monitors arranged horizontally - window will just move
right/left.

In case of 3x3 setup - it is impossible to move window to central
monitor with keyboard.

- preserves window position and size (if display sizes are same)
- otherwise tries to fit window to smaller display

5 years agoconfigure: Fix pkg-config variable typo.
Doug Torrance [Wed, 8 Aug 2018 01:55:01 +0000 (7 21:55 -0400)]
configure: Fix pkg-config variable typo.

The variable set by PKG_PROG_PKG_CONFIG which points to the pkg-config
utility is PKG_CONFIG, not PKGCONFIG.  The latter was previously used
when trying to detect the presence of the MagickWand library when Window
Maker was built using --enable-magick.

6 years agoDetect and override illegal window size hints
Gaspar Chilingarov [Mon, 21 May 2018 08:35:36 +0000 (21 08:35 +0000)]
Detect and override illegal window size hints

The problem - when VirtualBox starts virtual machine, window has very
small height (couple of pixels) and it requires some manual fiddling
to resize it to something usable.

See related bugs here:

https://www.virtualbox.org/ticket/14718#comment:19 - small horizontal
line in the middle of the screen is newly opened virtual machine's
window.

https://www.virtualbox.org/ticket/15863

Inspecting with xdebug and xprop reveals that VirtualBox sends wrong hints:

Request(12): ConfigureWindow window=0x0660000a values={x=27 y=559
width=720 height=65512}

Which is interpreted by X server wrongly and shown with xprop as

WM_NORMAL_HINTS(WM_SIZE_HINTS)
:
                user specified location: 27, 559
                user specified size: 720 by -24
                program specified minimum size: 254 by 109
                window gravity: Static

Some part of X11 interprets such large value as signed int and wraps
it to negative value.

The solution will be if program requests such big window - detect it,
ignore requested size and resize it to some reasonable defaults.

Disclaimer - I tested it only on Ubuntu 16.04, but should apply to
another systems as well - see bug reports.

6 years agosetstyle: Add support for fpixmap ("fillscale") textures
Doug Torrance [Tue, 15 May 2018 18:50:18 +0000 (15 14:50 -0400)]
setstyle: Add support for fpixmap ("fillscale") textures

6 years agomenu: Fix broken "Save Theme" option.
Doug Torrance [Tue, 15 May 2018 18:14:14 +0000 (15 14:14 -0400)]
menu: Fix broken "Save Theme" option.

This option had been broken for several reasons:
* The getstyle utility does not replace the #usergnusteppath# macro which
  was passed to it by the menu.
* When processing the USER_THEMES_DIR macro, the menu inserts a space
  afterwards, and so the directory and filename were passed to getstyle
  as two separate arguments.
* It used the old, pre-0.50.0 theme format.

By using the -p option to getstyle, we can avoid these issues, as we don't
need to specify the directory *and* it uses the 'new' (since 1999) themepack
format.

6 years agoAdd new Adwaita style to Makefile.
Doug Torrance [Tue, 15 May 2018 13:19:51 +0000 (15 09:19 -0400)]
Add new Adwaita style to Makefile.