wmaker-crm.git
4 months agoUpdate Serbian translation from master branchmaster
Страхиња Радић [Thu, 2 Nov 2023 18:45:46 +0000 (2 19:45 +0100)]
Update Serbian translation from master branch

Signed-off-by: Страхиња Радић <contact@strahinja.org>
4 months agoEdit leftover automake files and READMEs for Serbian localization
Страхиња Радић [Thu, 2 Nov 2023 18:16:36 +0000 (2 19:16 +0100)]
Edit leftover automake files and READMEs for Serbian localization

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>
4 months agoAdd Serbian localization
Strahinya [Wed, 1 Nov 2023 12:33:01 +0000 (1 13:33 +0100)]
Add Serbian localization

This patch adds Serbian localization to Window Maker.

Signed-off-by: Страхиња Радић <contact@strahinja.org>
4 months agoutil/wmgenmenu.c(main): Close parentheses around vgradient
Страхиња Радић [Wed, 1 Nov 2023 13:16:31 +0000 (1 14:16 +0100)]
util/wmgenmenu.c(main): Close parentheses around vgradient

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>
7 months agoRevert "WUtil: Be more strict about base directory for wmkdirhier()"
Carlos R. Mafra [Mon, 21 Aug 2023 21:18:23 +0000 (21 22:18 +0100)]
Revert "WUtil: Be more strict about base directory for wmkdirhier()"

This reverts commit a0b283a60f734c38faa8e7cd594ace1657ce74b0,
as it breaks saving the history in ~GNUstep/.AppInfo/WindowMaker/History
by restricting modifications to either ~GNUstep/Defaults or ~GNUstep/Library.

Thanks to Paul Selig for reporting this issue.

7 months agoUpdate .gitignore
Carlos R. Mafra [Mon, 21 Aug 2023 19:38:50 +0000 (21 20:38 +0100)]
Update .gitignore

Since

fc63d72032 (WINGs: Fix incorrect use of macro USE_PANGO in installed header)

and

0e274dc979 (WRaster: Fix incorrect use of macro USE_XSHM in installed header)

the files wrlib/wraster.h and WINGs/WINGs/WINGsP.h are generated by the compilation,
so add them to .gitignore

7 months agoFix calculation of version number in the library mapfiles
Christophe CURIS [Sat, 12 Aug 2023 20:35:52 +0000 (12 22:35 +0200)]
Fix calculation of version number in the library mapfiles

As reported by Andreas Metzler, the latest API change in lib WRaster caused
a compatibility issue because the internal version number was increased.

To correctly handle this situation, this patch does 2 things:
 - do not discard the 2 last number in the "c:r:a" version, because we need them;
 - when calculating the version for the mapfile, use the formula that is
suggested in libtool's documentation.

The purpose of the formula is that when API is changed, if a new function
is added then the version is not incremented to reflect that we are still
compatible with current binaries, it will be incremented only when there
is a break in compatibility.

7 months agoWindow Maker 0.96.0wmaker-0.96.0
Carlos R. Mafra [Sat, 5 Aug 2023 07:46:23 +0000 (5 08:46 +0100)]
Window Maker 0.96.0

11 months agoFix autoconf obsolete macros
David Maciejak [Fri, 14 Apr 2023 21:14:20 +0000 (15 05:14 +0800)]
Fix autoconf obsolete macros

autogen.sh is reporting some warnings as below

./autogen.sh 2>&1 |grep "obsolete"
libtoolize: copying file 'm4/lt~obsolete.m4'
configure.ac:115: warning: The macro `AC_LANG_C' is obsolete.
configure.ac:115: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:134: warning: The macro `AC_LANG_C' is obsolete.
configure.ac:134: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:135: warning: The macro `AC_LANG_C' is obsolete.
configure.ac:135: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:146: warning: The macro `AC_LANG_C' is obsolete.
configure.ac:146: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:146: warning: The macro `AC_LANG_C' is obsolete.
configure.ac:146: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:373: warning: The macro `AC_LANG_C' is obsolete.
configure.ac:373: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:458: warning: The macro `AC_HEADER_TIME' is obsolete.
configure.ac:681: warning: The macro `AC_TRY_LINK' is obsolete.
configure.ac:807: warning: The macro `AC_TRY_LINK' is obsolete.

As the minimum autoconf version required is v2.69,
we need to make sure to update obsolete macros as described at
https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Obsolete-Macros.html

11 months agoSet proper motif wm hints name
David Maciejak [Sun, 9 Apr 2023 09:15:17 +0000 (9 17:15 +0800)]
Set proper motif wm hints name

Just a cosmetic change as the variable is currently not in use.
According to the Motif Toolkit API and MwmUtil.h, the last long
variable from the Motif WM Hints struct is currenlty used
for the status.

11 months agoAdd central position feature for active window
David Maciejak [Thu, 30 Mar 2023 23:18:40 +0000 (31 07:18 +0800)]
Add central position feature for active window

This patch adds a new Central feature under the window menu
"Other maximization" entry.
Shortcut can be configured via WPrefs "Center active window" action.
When called the active window is centered on the screen head.
If the window height or width are bigger than the head size,
the window is resized to fit.
There are some transitions defined as below:
*from fullscreen to center
*from any corner to center
*from top half to center top half
*from bottom half to center bottom half
*from left half to center left half
*from right half to center right half

Undoing the action is done via the window menu "Unmaximize" entry
or the shortcut.

12 months agoNEWS: Hot corners feature description
David Maciejak [Sun, 26 Mar 2023 06:36:40 +0000 (26 14:36 +0800)]
NEWS: Hot corners feature description

Add an entry in the NEWS to describe the Hot Corners feature.

12 months agoWPrefs: Hot corner preferences
David Maciejak [Sun, 26 Mar 2023 06:36:13 +0000 (26 14:36 +0800)]
WPrefs: Hot corner preferences

Add a new "Hot Corner Shortcut Preferences" section to WPrefs
to configure the Hot Corners feature.

12 months agoHot corners feature core
David Maciejak [Sun, 26 Mar 2023 06:35:13 +0000 (26 14:35 +0800)]
Hot corners feature core

Add mouse pointer position detection to trigger the corner actions.

Screen corners can be assigned an external command to be
executed when the mouse pointer is entering those areas.

In WPrefs, "Hot Corner Shortcut Preferences" can be used
for configuration or by manually adding a "HotCorners" key
and value to "YES" in the ~/GNUstep/Defaults/WindowMaker file.

Actions are specified by the "HotCornerActions" and are defined
as a four entries list ("top left action", "top right action",
"bottom left action", "bottom right action").
A screen corner area is a cube shape defined by the "HotCornerEdge"
which is a number of pixels from 2 (by default) to 10.

To lower the risk of triggering that feature accidentally a
"HotCornerDelay" key can be used which is the time before the action
is triggered while the pointer is in one of the screen corner.
Default value is 250 ms.

Hot Corners feature is disabled by default.

12 months agoFix internal function name typo
David Maciejak [Thu, 23 Mar 2023 12:37:54 +0000 (23 20:37 +0800)]
Fix internal function name typo

The patch is to fix a typo in the fct name movePionterToWindowCenter

12 months agoWPrefs: fix keyboard shortcut sorting order
David Maciejak [Tue, 21 Mar 2023 13:06:06 +0000 (21 21:06 +0800)]
WPrefs: fix keyboard shortcut sorting order

That patch is fixing some Actions entries that are not sorted properly.
One is using some upper/lower cases.
And the other one, is displaying numbers while alphabetic sorting is not
working properly on numbers. For example:
Shortcut for window 1
Shortcut for window 10
Shortcut for window 2
...

12 months agoAdd some more cases to handle window unusual size request
David Maciejak [Thu, 16 Mar 2023 11:15:56 +0000 (16 19:15 +0800)]
Add some more cases to handle window unusual size request

As discussed on the ML, the test to check for CARD16 limit is probably innacurate.
Check instead for maxH and maxW which are set by default to twice the size
of the screen or to the max values passed by the window normal hints property.

12 months agoFix ICCM ConfigureNotify request
David Maciejak [Thu, 16 Mar 2023 11:13:03 +0000 (16 19:13 +0800)]
Fix ICCM ConfigureNotify request

According to ICCM specs at [1]

*Not changing the size, location, border width, or stacking order of the window at all.
A client will receive a synthetic ConfigureNotify event that describes the (unchanged)
geometry of the window. The (x,y) coordinates will be in the root coordinate system,
adjusted for the border width the client requested, irrespective of any reparenting
that has taken place. The border_width will be the border width the client requested.
The client will not receive a real ConfigureNotify event because no change has actually
taken place.

*Moving or restacking the window without resizing it or changing its border width.
A client will receive a synthetic ConfigureNotify event following the change that
describes the new geometry of the window. The event's (x,y) coordinates will be in
the root coordinate system adjusted for the border width the client requested.
The border_width will be the border width the client requested. The client may not
receive a real ConfigureNotify event that describes this change because the window
manager may have reparented the top-level window. If the client does receive a
real event, the synthetic event will follow the real one.

*Resizing the window or changing its border width
(regardless of whether the window was also moved or restacked).
A client that has selected for StructureNotify events will receive a real
ConfigureNotify event.
Note that the coordinates in this event are relative to the parent,
which may not be the root if the window has been reparented. The coordinates will
reflect the actual border width of the window (which the window manager may have
changed). The TranslateCoordinates request can be used to convert the coordinates
if required.

In Window Maker, the first case is not implemented: doing a synthetic ConfigureNotify
to notify no changes were done. That's creating some issues with app like Citrix icaclient
when sometime windows are blank and need to be moved to be refreshed.

[1]https://x.org/releases/X11R7.6/doc/xorg-docs/specs/ICCCM/icccm.html#configuring_the_window

12 months agoUpdate window.c copyright
David Maciejak [Thu, 16 Mar 2023 11:10:33 +0000 (16 19:10 +0800)]
Update window.c copyright

Just updating the copyright line in the file header.

12 months agoWPrefs: update maximization feature descriptions
David Maciejak [Thu, 16 Mar 2023 10:55:55 +0000 (16 18:55 +0800)]
WPrefs: update maximization feature descriptions

Align the old maximization descriptions to the new visual indicator
names. The internal shortcut names had also been updated, meaning a
reconfiguration of the shortcuts in WPrefs is required.

12 months agoWindow menu: add maximization visual indicators
David Maciejak [Tue, 14 Mar 2023 10:23:46 +0000 (14 18:23 +0800)]
Window menu: add maximization visual indicators

Add visual indicators for the maximization options in the window menu.

12 months agoRestore proper drawer direction when screen was resized
David Maciejak [Tue, 14 Mar 2023 10:49:08 +0000 (14 18:49 +0800)]
Restore proper drawer direction when screen was resized

Since 48d4820deea3b0053b9840275f1bed5148899006 the dock is positioned
dynamically based on the screen midpoint.
The side issue using such method is if in case the screen was temporarily
resized the dock as a chance to be displayed on the other side making
the drawer saved configuration from WMState esp the direction wrong when
wm is started again.
For example, the dock and drawer are displayed on the right of the screen.
Then the screen resolution is downsized temporaily to half or less of
the previous size. The position stored in WMState will be updated and the
direction of the drawer is still opening on the left.
But on next wm start, when reading the conf.
The position of the dock and drawer are corresponding to the
middle or less of the unresized screen. The dock and drawer will be sticked
on the left. But the drawer direction was not updated and still opening
on the left (which is out of the screen).

12 months agoMove declarations to beginning of switch statements
Doug Torrance [Mon, 13 Mar 2023 14:49:36 +0000 (13 10:49 -0400)]
Move declarations to beginning of switch statements

Several variable declarations were recently added immediately after
labels, but this causes compile errors in GCC versions prior to 11,
e.g.,

    wsmap.c: In function ‘handle_event’:
    wsmap.c:534:4: error: a label can only be part of a statement and a declaration is not a statement
      534 |    WMScreen *wmscr = wsmap->scr->wmscreen;
          |    ^~~~~~~~

We move these declarations to the top of the corresponding switch
statements so that Window Maker can compile on these older versions of
GCC.

12 months agowmiv: align version with wm
David Maciejak [Mon, 13 Mar 2023 13:22:48 +0000 (13 21:22 +0800)]
wmiv: align version with wm

Use wm version for the wmiv util.

12 months agoKeepDockOnPrimaryHead: fix drawer direction
David Maciejak [Mon, 13 Mar 2023 13:50:07 +0000 (13 21:50 +0800)]
KeepDockOnPrimaryHead: fix drawer direction

When that option is on, swapping drawer does not always mean
swapping drawer direction. For example if drawer is on the left
side of the second head and moving to the left side of the first head,
the direction should be the same.

12 months agoInfo Panel: display proper number of colors in deepcolor env
David Maciejak [Mon, 13 Mar 2023 13:18:21 +0000 (13 21:18 +0800)]
Info Panel: display proper number of colors in deepcolor env

Instead of displaying a number of unitary colors in 10bit env,
display a more human readable message.

12 months agoWINGs: Make the Extras examples to compile
David Maciejak [Sun, 12 Mar 2023 01:55:50 +0000 (12 09:55 +0800)]
WINGs: Make the Extras examples to compile

There is a table view example which is not compiling cause
of a missing lib, also fixed some warnings.

12 months agoWindow titlebar double click to unmaximize
David Maciejak [Sun, 12 Mar 2023 06:58:59 +0000 (12 14:58 +0800)]
Window titlebar double click to unmaximize

Commit 6e2075f3dfb7c9f8ca7ac447d47c715b945dd9c0 from 2020 added
a feature to maximize window when double clicking on the titlebar.
But unmaximizing is not supported so when double clicking again
on the window titlebar the window geometry was not reverted back.

12 months agoUpdate file headers year copyright
David Maciejak [Sun, 12 Mar 2023 03:17:14 +0000 (12 11:17 +0800)]
Update file headers year copyright

Update copyright year for Window Maker Team entries.

12 months agoWorkspace pager: display ? on non visited mini workspace
David Maciejak [Sat, 11 Mar 2023 04:32:35 +0000 (11 12:32 +0800)]
Workspace pager: display ? on non visited mini workspace

When the workspace pager is displayed it's showing grey mini workspaces
for non rendered/non visited workspaces. That patch is adding an exclamation
mark in the middle of the dummy grey background mini workspaces.

12 months agoWINGs: W_KeycodeToKeysym remove unnecessary if test
David Maciejak [Tue, 7 Mar 2023 23:21:30 +0000 (8 07:21 +0800)]
WINGs: W_KeycodeToKeysym remove unnecessary if test

min_kc value is always -1 at that point in the code, so need to test it
as it's always true.

12 months agoWINGs: handle fixed size windows
David Maciejak [Wed, 8 Mar 2023 11:37:48 +0000 (8 19:37 +0800)]
WINGs: handle fixed size windows

According to the EWMH specs, windows can indicate that they are
non-resizable by setting minheight = maxheight and minwidth = maxwidth
in the ICCCM WM_NORMAL_HINTS property. That should be for example
the case for WPrefs app which is not resizable.
Window Maker currently is overwriting that flag in src/window.c for
apps that are exposing GNUstepHints instead.
This patch is making sure the apps created with WINGs is removing
the WMResizableWindowMask to hide the resizebar.

12 months agoSwitchPanel: fix app icons opacity combination
David Maciejak [Thu, 9 Mar 2023 12:15:44 +0000 (9 20:15 +0800)]
SwitchPanel: fix app icons opacity combination

For some apps the background is not displayed properly, showing
some kind of shawow around the app icon like for example firefox
or skype. This is due to an issue in combining alpha channels.

12 months agoNEWS: add entry for libXRes support
David Maciejak [Thu, 9 Mar 2023 12:06:58 +0000 (9 20:06 +0800)]
NEWS: add entry for libXRes support

12 months agoUpdate news and changelog files
David Maciejak [Tue, 7 Mar 2023 12:23:38 +0000 (7 20:23 +0800)]
Update news and changelog files

12 months agoAdd a screenshot capture feature
David Maciejak [Tue, 7 Mar 2023 11:46:50 +0000 (7 19:46 +0800)]
Add a screenshot capture feature

This patch adds a feature to take screenshots directly from Window Maker.
Having the feature embeded direclty inside Window Maker allows us to take
advantage of how Window Maker is managing and handling Windows.
Three new actions can be bound to a key shortcut from WPrefs.
The screenshot files are saved in ~/GNUstep/Library/WindowMaker/Screenshots/
dir, with a "screenshot_%Y-%m-%d_at_%H:%M:%S" format followed by the
extension. Preferably as a PNG or JPG file if available.
Meaning, to work Window Maker via WRaster needs to support
at least one of those format.

"Capture the entire screen" is quite standard, it takes a screenshot
of the whole screen area (even in multiheads env).
"Capture a portion of the screen" requires the user to draw a rectangle which
will be captured.
Those two first are quite straightforward, just taking a live picture of
the screen.
The last one is "Capture a window" which works in best effort mode,
it catures the focused window. As Window Maker by default is not using
any compositor (like for example Xcompmgr) it can only dump the content
displayed on the screen.
If a window is minimized or out of the screen, there is high chance the
image will be split or some area greyed in case other windows overlapped it.

12 months agoWINGs: Make the test examples to compile
David Maciejak [Tue, 7 Mar 2023 17:24:41 +0000 (7 17:24 +0000)]
WINGs: Make the test examples to compile

Those examples are optional but currently cannot compile properly.
The compiler is reporting some unused variables and missing header file.

12 months agoWINGs: comment out wtext unused NOTIFY macro
David Maciejak [Sun, 5 Mar 2023 07:24:17 +0000 (5 15:24 +0800)]
WINGs: comment out wtext unused NOTIFY macro

The compiler is reporting the warning below
wtext.c:171: warning: macro "NOTIFY" is not used [-Wunused-macros]

That macro is only used once within that C file, code which is commented
out already.

12 months agoWPrefs: convert workspacename.xpm X11 color name to hex
David Maciejak [Sat, 4 Mar 2023 03:10:34 +0000 (4 11:10 +0800)]
WPrefs: convert workspacename.xpm X11 color name to hex

On window maker built without libxpm, a simple build-in xpm support is used.
That component does not support X11 color name thus when trying to load
that image we are getting a file corrupted error.
Colors manually converted using ref at
https://www.ehdp.com/methods/x11-colors/x11-colors-rgb-values-05.htm

12 months agoUtil: fix wmgenmenu memory leak and help msg
David Maciejak [Sat, 4 Mar 2023 04:10:57 +0000 (4 12:10 +0800)]
Util: fix wmgenmenu memory leak and help msg

Memory allocated from wstrconcat() calls are not freed properly.
Help msg is reporting the wrong directory where to install WMRootMenu.

12 months agoUse wtokenfree whenever there is wtokensplit
David Maciejak [Sat, 4 Mar 2023 03:16:17 +0000 (4 11:16 +0800)]
Use wtokenfree whenever there is wtokensplit

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.

12 months agoConvert tile.xpm X11 color name to hex
David Maciejak [Sat, 4 Mar 2023 06:23:13 +0000 (4 14:23 +0800)]
Convert tile.xpm X11 color name to hex

On window maker built without libxpm, a simple build-in xpm support is used.
That component does not support X11 color name thus when trying to load
that image we are getting a file corrupted error.
Colors manually converted using ref at
https://www.ehdp.com/methods/x11-colors/x11-colors-rgb-values-05.htm

12 months agoWPrefs: sort alphabetically the key shortcut actions and expert options
David Maciejak [Fri, 3 Mar 2023 11:11:30 +0000 (3 19:11 +0800)]
WPrefs: sort alphabetically the key shortcut actions and expert options

There are too many entries now in key shortcut actions and expert options,
better to sort them dynamically.

12 months agoCoverity: fix WRaster convert uninitialized scalar variable
David Maciejak [Fri, 3 Mar 2023 05:36:50 +0000 (3 13:36 +0800)]
Coverity: fix WRaster convert uninitialized scalar variable

12 months agoCoverity: fix WPrefs workspace negative array index read
David Maciejak [Fri, 3 Mar 2023 05:36:04 +0000 (3 13:36 +0800)]
Coverity: fix WPrefs workspace negative array index read

12 months agoCoverity: fix util wmsetbg resource leak
David Maciejak [Fri, 3 Mar 2023 05:18:53 +0000 (3 13:18 +0800)]
Coverity: fix util wmsetbg resource leak

12 months agoWRaster: add new file references for translation
David Maciejak [Fri, 3 Mar 2023 00:06:31 +0000 (3 08:06 +0800)]
WRaster: add new file references for translation

This patch is adding the references for the two newly added files
save_jpeg.c and save_png.c for translation (even if those new
files are not adding any new strings to be translated).

12 months agoCoverity: fix wmgenmenu resource leak
David Maciejak [Thu, 2 Mar 2023 14:39:45 +0000 (2 22:39 +0800)]
Coverity: fix wmgenmenu resource leak

12 months agoCoverity: fix wmmenugen resource leak
David Maciejak [Thu, 2 Mar 2023 14:16:43 +0000 (2 22:16 +0800)]
Coverity: fix wmmenugen resource leak

12 months agoCoverity: fix wmspec dereference after null check
David Maciejak [Thu, 2 Mar 2023 12:03:34 +0000 (2 20:03 +0800)]
Coverity: fix wmspec dereference after null check

12 months agoCoverity: fix WPrefs appearance negative array index read
David Maciejak [Thu, 2 Mar 2023 15:11:47 +0000 (2 23:11 +0800)]
Coverity: fix WPrefs appearance negative array index read

12 months agoCoverity: fix WPrefs menu negative array index read
David Maciejak [Thu, 2 Mar 2023 11:26:01 +0000 (2 19:26 +0800)]
Coverity: fix WPrefs menu negative array index read

12 months agoCoverity: fix WPrefs mousesettings menu negative array index read
David Maciejak [Thu, 2 Mar 2023 11:24:08 +0000 (2 19:24 +0800)]
Coverity: fix WPrefs mousesettings menu negative array index read

12 months agoCoverity: fix WPrefs preference negative array index read
David Maciejak [Wed, 1 Mar 2023 14:29:44 +0000 (1 22:29 +0800)]
Coverity: fix WPrefs preference negative array index read

12 months agoCoverity: fix WPrefs texturepanel negative array index read
David Maciejak [Wed, 1 Mar 2023 14:26:50 +0000 (1 22:26 +0800)]
Coverity: fix WPrefs texturepanel negative array index read

12 months agoCoverity: fix dialog dereference null return value
David Maciejak [Thu, 2 Mar 2023 14:24:52 +0000 (2 22:24 +0800)]
Coverity: fix dialog dereference null return value

This patch is making sure defaultPath returns from FindImage() is not null
and freeing the variables.

12 months agoCoverity: fix WPrefs appearance time of check time of use
David Maciejak [Thu, 2 Mar 2023 15:05:41 +0000 (2 23:05 +0800)]
Coverity: fix WPrefs appearance time of check time of use

12 months agoCoverity: fix WPrefs editmenu uninitialized scalar variables
David Maciejak [Wed, 1 Mar 2023 14:43:50 +0000 (1 22:43 +0800)]
Coverity: fix WPrefs editmenu uninitialized scalar variables

12 months agoCoverity: fix WRaster convert uninitialized scalar variable
David Maciejak [Wed, 1 Mar 2023 14:48:50 +0000 (1 22:48 +0800)]
Coverity: fix WRaster convert uninitialized scalar variable

12 months agoCoverity: fix session resource leak
David Maciejak [Tue, 28 Feb 2023 22:42:29 +0000 (1 06:42 +0800)]
Coverity: fix session resource leak

12 months agoCoverity: fix xmodifier uninitialized scalar variable
David Maciejak [Tue, 28 Feb 2023 23:28:42 +0000 (1 07:28 +0800)]
Coverity: fix xmodifier uninitialized scalar variable

12 months agoCoverity: fix wmsetbg string not null terminated
David Maciejak [Tue, 28 Feb 2023 22:37:45 +0000 (1 06:37 +0800)]
Coverity: fix wmsetbg string not null terminated

12 months agoCoverity: fix rootmenu structurally dead code
David Maciejak [Tue, 28 Feb 2023 23:01:33 +0000 (1 07:01 +0800)]
Coverity: fix rootmenu structurally dead code

12 months agoCoverity: fix wcolorpanel uninitialized scalar value
David Maciejak [Tue, 28 Feb 2023 22:46:02 +0000 (1 06:46 +0800)]
Coverity: fix wcolorpanel uninitialized scalar value

12 months agoCoverity: fix setstyle resource leak
David Maciejak [Tue, 28 Feb 2023 22:17:47 +0000 (1 06:17 +0800)]
Coverity: fix setstyle resource leak

12 months agoCoverity: fix misc resource leak
David Maciejak [Tue, 28 Feb 2023 22:33:41 +0000 (1 06:33 +0800)]
Coverity: fix misc resource leak

12 months agoCoverity: fix menuparser_macro uninitialized pointer read
David Maciejak [Tue, 28 Feb 2023 22:03:04 +0000 (1 06:03 +0800)]
Coverity: fix menuparser_macro uninitialized pointer read

12 months agoWRaster: add functions to save image on disk
David Maciejak [Wed, 1 Mar 2023 12:36:09 +0000 (1 20:36 +0800)]
WRaster: add functions to save image on disk

This patch adds the RSaveTitledImage() function to the WRaster lib
to be able to save file on disk either as a PNG or a JPEG file.
Those two formats depends on optional external libs.
The function can take an optional title/comment which will
be save inside the file.

The WRaster lib and header versions are bumped.

12 months agoCoverity: fix wmspec uninitialized layer variable
David Maciejak [Tue, 28 Feb 2023 10:58:51 +0000 (28 18:58 +0800)]
Coverity: fix wmspec uninitialized layer variable

12 months agoCoverity: fix RContextAttributes uninitialized variable
David Maciejak [Tue, 28 Feb 2023 13:26:01 +0000 (28 21:26 +0800)]
Coverity: fix RContextAttributes uninitialized variable

12 months agoCoverity: fix wmiv resource leak
David Maciejak [Tue, 28 Feb 2023 13:24:33 +0000 (28 21:24 +0800)]
Coverity: fix wmiv resource leak

12 months agoCoverity: fix potential buffer overflow
David Maciejak [Tue, 28 Feb 2023 13:24:31 +0000 (28 21:24 +0800)]
Coverity: fix potential buffer overflow

12 months agowmiv: use W_KeycodeToKeysym instead of XkbKeycodeToKeysym
David [Tue, 28 Feb 2023 02:58:10 +0000 (28 10:58 +0800)]
wmiv: use W_KeycodeToKeysym instead of XkbKeycodeToKeysym

This patch replaces XkbKeycodeToKeysym in wmiv by our
own function W_KeycodeToKeysym.

12 months agoUse W_KeycodeToKeysym instead of XkbKeycodeToKeysym
David Maciejak [Sun, 26 Feb 2023 01:15:42 +0000 (26 09:15 +0800)]
Use W_KeycodeToKeysym instead of XkbKeycodeToKeysym

This patch replaces XkbKeycodeToKeysym by our
own function W_KeycodeToKeysym.

12 months agoWPrefs: use W_KeycodeToKeysym instead of XkbKeycodeToKeysym
David Maciejak [Sun, 26 Feb 2023 00:51:35 +0000 (26 08:51 +0800)]
WPrefs: use W_KeycodeToKeysym instead of XkbKeycodeToKeysym

This patch replaces XKeycodeToKeysym and XkbKeycodeToKeysym
in WPrefs by our own function W_KeycodeToKeysym.

12 months agoWINGs: Add W_KeycodeToKeysym to replace XKeycodeToKeysym/XkbKeycodeToKeysym calls
David Maciejak [Sun, 26 Feb 2023 00:40:14 +0000 (26 08:40 +0800)]
WINGs: Add W_KeycodeToKeysym to replace XKeycodeToKeysym/XkbKeycodeToKeysym calls

XKeycodeToKeysym was deprecated some time ago and we replaced
those function calls to XkbKeycodeToKeysym.
Usage of XkbKeycodeToKeysym is not the best as it appears
the XKEYBOARD can be disabled via xorg.conf (at least on Linux).
So just replacing XKeycodeToKeysym() with XkbKeycodeToKeysym()
could cause run-time errors on top of the compilation warning
we may have.
Better fix is to address the problem without introducing a
dependency on XKEYBOARD. W_KeycodeToKeysym is the equivalent
code for XKeycodeToKeysym/XkbKeycodeToKeysym using
XGetKeyboardMapping instead.

As a new function is added to the library WINGs library version
is bumped.

12 months agoStore window maximize state as hex value
David Maciejak [Mon, 27 Feb 2023 15:21:50 +0000 (27 23:21 +0800)]
Store window maximize state as hex value

As the maximize state is defined as a bit-field internally.
Better to store the flag in the WMSTATE file as hex value.

12 months agoCompile by default with POSIX 7 revision
David Maciejak [Mon, 27 Feb 2023 15:09:32 +0000 (27 23:09 +0800)]
Compile by default with POSIX 7 revision

Compile by default with POSIX-2008 standard for Linux and FreeBSD.

12 months agoCode cleaning: removing trailing space
David Maciejak [Sat, 25 Feb 2023 22:26:54 +0000 (26 06:26 +0800)]
Code cleaning: removing trailing space

The patch is removing trailing space(s) before
the semicolon ending line. .c and .h files were checked.

13 months agoDoc: add disable-res description
David Maciejak [Sun, 26 Feb 2023 06:38:11 +0000 (26 14:38 +0800)]
Doc: add disable-res description

13 months agoWPrefs: check if captured keyboard shortcut is not in use
David Maciejak [Sat, 25 Feb 2023 06:13:33 +0000 (25 14:13 +0800)]
WPrefs: check if captured keyboard shortcut is not in use

Make sure the captured keyboard shortcut is not already in use
by another action, if it's the case an error popup is shown and
the key is not kept.

13 months agoFix compiler warnings from texture.c v2
David Maciejak [Sat, 25 Feb 2023 04:55:51 +0000 (25 12:55 +0800)]
Fix compiler warnings from texture.c v2

The patch fixes those 2 warnings below from texture.c.
It reverts the previous v1 patch and fixes the compiler warning
by updating the texture.h wTextureMakeIGradient header instead.

texture.c:205:81: warning: argument 3 of type 'const RColor[2]' with mismatched bound [-Warray-parameter=]
  205 | WTexIGradient *wTextureMakeIGradient(WScreen *scr, int thickness1, const RColor colors1[2],
      |                                                                    ~~~~~~~~~~~~~^~~~~~~~~~
In file included from texture.c:33:
texture.h:165:53: note: previously declared as 'const RColor[]'
  165 | WTexIGradient *wTextureMakeIGradient(WScreen*, int, const RColor[], int, const RColor[]);
      |                                                     ^~~~~~~~~~~~~~
texture.c:206:67: warning: argument 5 of type 'const RColor[2]' with mismatched bound [-Warray-parameter=]
  206 |                                      int thickness2, const RColor colors2[2])
      |                                                      ~~~~~~~~~~~~~^~~~~~~~~~
texture.h:165:74: note: previously declared as 'const RColor[]'
  165 | WTexIGradient *wTextureMakeIGradient(WScreen*, int, const RColor[], int, const RColor[]);
      |

13 months agoFix compiler warnings from texture.c
David Maciejak [Fri, 24 Feb 2023 11:24:45 +0000 (24 19:24 +0800)]
Fix compiler warnings from texture.c

The patch fixes those 2 warnings below from texture.c

texture.c:205:81: warning: argument 3 of type 'const RColor[2]' with mismatched bound [-Warray-parameter=]
  205 | WTexIGradient *wTextureMakeIGradient(WScreen *scr, int thickness1, const RColor colors1[2],
      |                                                                    ~~~~~~~~~~~~~^~~~~~~~~~
In file included from texture.c:33:
texture.h:165:53: note: previously declared as 'const RColor[]'
  165 | WTexIGradient *wTextureMakeIGradient(WScreen*, int, const RColor[], int, const RColor[]);
      |                                                     ^~~~~~~~~~~~~~
texture.c:206:67: warning: argument 5 of type 'const RColor[2]' with mismatched bound [-Warray-parameter=]
  206 |                                      int thickness2, const RColor colors2[2])
      |                                                      ~~~~~~~~~~~~~^~~~~~~~~~
texture.h:165:74: note: previously declared as 'const RColor[]'
  165 | WTexIGradient *wTextureMakeIGradient(WScreen*, int, const RColor[], int, const RColor[]);
      |

13 months agoFix compiler warning from menu.c
David Maciejak [Fri, 24 Feb 2023 11:21:31 +0000 (24 19:21 +0800)]
Fix compiler warning from menu.c

The patch fixes the compiler warning below

menu.c: In function 'restoreMenuRecurs':
menu.c:2450:47: warning: '%s' directive output may be truncated writing up to 510 bytes into a region of size between 509 and 1019 [-Wformat-truncation=]
 2450 |         snprintf(buffer, sizeof(buffer), "%s\\%s", path, menu->frame->title);
      |                                               ^~

The code is taking care of checking properly the string passed to the buffer,
so there is no issue, the change is just to make the compiler happy.

13 months agoDetect and override illegal window size hints v2
David Maciejak [Wed, 22 Feb 2023 11:29:23 +0000 (22 19:29 +0800)]
Detect and override illegal window size hints v2

The patch is trying to mitigate and properly address the issue described at
https://github.com/window-maker/wmaker/issues/26
A buggy application (in that example virtualbox) is requesting a window size creation
that is way too big and basically at the limit of X11 protocol
(width and height are defined as CARD16).
See details at https://www.x.org/releases/X11R7.7/doc/xproto/x11protocol.html
During the tests, virtualbox has been seen requesting for window creation of size 843x65508.
Even xprop is reporting incorrect values.

There had been an attempt before with the commit
https://repo.or.cz/wmaker-crm.git?a=commit;h=6668715402a5d8e2ecda6702076a06bf8988721e

But the patch is broken and not implemented at the right place.
As described in the wWindowConfigure function header, the size passed by the client app
should not be trusted and should be vetted with a prior call to wWindowConstrainSize.
wWindowConstrainSize call was missing only once in the wClientConfigure function from client.c
What wWindowConstrainSize doing now is basically setting a failsafe window size fo 640x480
if both width and height are above the size of CARD16.
If only one dimension is oversized, it's setting a default 4/3 window ratio.
Oversized here has not been changed and it's defined in windowmaker as double the screen size.

13 months agoMake window maximize state persistent
David Maciejak [Tue, 21 Feb 2023 13:40:59 +0000 (21 21:40 +0800)]
Make window maximize state persistent

Window maximize state is not persistent between windowmaker sessions.
This patch is updating the save and restore workspace state functions
to update the state in the WMSTATE file.

13 months agoInfo Panel: Add libXRes info if supported
David Maciejak [Mon, 20 Feb 2023 22:19:18 +0000 (21 06:19 +0800)]
Info Panel: Add libXRes info if supported

If windowmaker was compiled with libXRes,
add XRes info in the "Additional support" section.

Take also the chance to remove the mode +x on the source code file.

13 months agoSet missing WM_COMMAND using pid given from libXRes
David Maciejak [Mon, 20 Feb 2023 12:02:28 +0000 (20 20:02 +0800)]
Set missing WM_COMMAND using pid given from libXRes

For apps which are not setting the window WM_COMMAND property like those old
apps using Motif toolkit (I am thinking of NEdit for example)
it's bringing some issues in windowmaker which is relying on it for a few interactions.
Especially,
*an app without WM_COMMAND will not be saved during the workspace state
(so session restore is not working for them)
*when added to the dock, the settings parameters are empty and need to be filled
*cannot autostart from the dock (even if the settings are manually filled and saved)
*right click on the app titlebar, and choosing Launch has no effect

Most of the time, those apps are also not setting the X11_NET_WM_PID property.
With the pid we could have a chance to find the running program.
To link a window to a pid, there is the X11 Resource extension library (libXRes).
After checking, gnome and xfce are also using the same method to handle such issues.

The patch is checking if the libXRes is present on the system (but it's not mandatory to compile).
Then, it adds a layer on top of wNETWMGetPidForWindow to not only check the window property
but if necessary to get the underlying pid from libXRes if available.
That's solving the points mentioned above.

13 months agoAllow WM_COMMAND-less app to autostart
David Maciejak [Sun, 19 Feb 2023 22:24:44 +0000 (20 06:24 +0800)]
Allow WM_COMMAND-less app to autostart

For apps which are not setting the window WM_COMMAND property like those old
apps using Motif toolkit (I am thinking of NEdit for example)
it's bringing some issues in windowmaker which is relying on it for a few interactions.
Especially,
*an app without WM_COMMAND will not be saved during the workspace state
(so session restore is not working for them)
*when added to the dock, the settings parameters are empty and need to be filled
*cannot autostart from the dock (even if the settings are manually filled and saved)
*right click on the app titlebar, and choosing Launch has no effect

The patch below allows the workspace state to be saved for those apps without WM_COMMAND
that have been launched from the dock. We are just reusing what have been set in the
Application Path Settings of the dock app (and it does not require extra libs like libXRes).

13 months agoAllow exit panel to be bound to a key shortcut
David Maciejak [Sun, 19 Feb 2023 04:10:08 +0000 (19 12:10 +0800)]
Allow exit panel to be bound to a key shortcut

While debugging the save/restore workspace state, I found quite
useful to be able to exit windowmaker using a key shortcut.

13 months agoFactorize duplicate run command code
David Maciejak [Sat, 18 Feb 2023 11:30:29 +0000 (18 19:30 +0800)]
Factorize duplicate run command code

Run command from the menu and run command from the key shortcut are from two different codes.
Merge them into one function instead.

13 months agoWRaster: Avoid undefined setjmp() behavior with libjpeg
David Maciejak [Sat, 18 Feb 2023 13:58:28 +0000 (18 21:58 +0800)]
WRaster: Avoid undefined setjmp() behavior with libjpeg

Fix compiler warning:
load_jpeg.c: In function 'RLoadJPEG':
load_jpeg.c:100:17: warning: variable 'image' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]

As it was not working to only set the RImage *image as volatile,
I had to refactor the code by following the example from
https://github.com/libjpeg-turbo/libjpeg-turbo/commit/410c028f3396d1fa9bcc72608079ff4d3d76b03e#diff-e7cb632359a2be17c1008b50f9ec85691cd5d66834d5fe8f63ef65ceb06682ee

13 months agoAdd support for _NET_WM_FULLSCREEN_MONITORS
David Maciejak [Sat, 18 Feb 2023 06:53:14 +0000 (18 14:53 +0800)]
Add support for _NET_WM_FULLSCREEN_MONITORS

This patch adds the _NET_WM_FULLSCREEN_MONITORS hint as defined in EWMH which is based on Xinerama.
It's allowing a window to be displayed fullscreen on multiple monitors.

Issue mentioned at https://github.com/window-maker/wmaker/issues/8
Specs at https://specifications.freedesktop.org/wm-spec/1.5/ar01s06.html#idm45763309187776
GTK test program used https://bugzilla.gnome.org/show_bug.cgi?id=414476

13 months agoFix mini workspace compiler warnings
David Maciejak [Fri, 17 Feb 2023 15:14:06 +0000 (17 23:14 +0800)]
Fix mini workspace compiler warnings

The patch is to fix warnings like:
wsmap.c: In function "update_mini_workspace":
wsmap.c:451:55: warning: "%d" directive output may be truncated writing between 1 and 11 bytes into a region of size 10 [-Wformat-truncation=]
  451 |                         snprintf(name, sizeof(name), "%d", general_index);

13 months agoInfo Panel: Fix uninitialized posn variable
David Maciejak [Thu, 16 Feb 2023 09:09:52 +0000 (16 17:09 +0800)]
Info Panel: Fix uninitialized posn variable

13 months agoIgnore WM_NORMAL_HINTS resize increment for maximized windows
David Maciejak [Wed, 15 Feb 2023 11:13:53 +0000 (15 19:13 +0800)]
Ignore WM_NORMAL_HINTS resize increment for maximized windows

If you are trying to maximize old apps that are setting a resize increment
in term of WM_NORMAL_HINTS notion the window will not be maximized fully (by a few pixels).
It's easy to reproduce with xterm, ctrl double click on the title bar.
xprop extract sample is giving:
program specified resize increment: 6 by 13

For those maximized windows the patch is just ignoring the resize increment.
Seems the same issue happened on that project
https://github.com/paperwm/PaperWM/issues/106

13 months agoWRaster: Avoid types deprecated with libtiff 4.3
David Maciejak [Wed, 15 Feb 2023 11:06:46 +0000 (15 19:06 +0800)]
WRaster: Avoid types deprecated with libtiff 4.3

This patch is fixing compiler warnings like:

load_tiff.c:42:9: warning: 'uint16' is deprecated [-Wdeprecated-declarations]
load_tiff.c:43:9: warning: 'uint32' is deprecated [-Wdeprecated-declarations]

As starting from libtiff 4.3, released in April 2021, types were moved
from uint16 to uint16_t and uint32 to uint32_t respectively.

See https://libtiff.gitlab.io/libtiff/releases/v4.3.0.html

13 months agoInfo Panel: display more OS details
David Maciejak [Tue, 14 Feb 2023 21:42:39 +0000 (15 05:42 +0800)]
Info Panel: display more OS details

Rely on old utsname and os-release (http://0pointer.de/blog/projects/os-release) when available
to display more underlying OS details in the Info panel.
The idea is when someone creates a bug entry we can request them to copy/paste that screen
to give more info about the context that could help us debug the issue.
For example, on my current system it's displaying:
"Running on: Ubuntu 22.10 (x86_64)"

13 months agoSet a better exit panel message
David Maciejak [Tue, 14 Feb 2023 21:38:48 +0000 (15 05:38 +0800)]
Set a better exit panel message

Replace the exit window manager generic message with Window Maker term instead.

13 months agoWINGs: allow keypad enter key to validate button
David Maciejak [Tue, 14 Feb 2023 21:37:24 +0000 (15 05:37 +0800)]
WINGs: allow keypad enter key to validate button

This patch allows the keypad enter key to validate the button click action.