1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-03-19 17:23:33 +01:00
Commit Graph

4017 Commits

Author SHA1 Message Date
David Maciejak
128ba2ddc7 wmaker: use appicon icons in the switchpanel when existing
This patch is making sure the icons shown in the switchpanel
are also those used for the appicon. For example, for xterm
the icon used in the switchpanel is the default app and not the
icon provided by xterm app.
Seems that issue is also present in vanilla wmaker 0.96.
2026-02-09 09:23:07 +00:00
David Maciejak
7ca96b9ed6 wmaker: fix titlebar glitch issues with modelock
This patch is fixing 2 issues with the modelock language pixmap
located in the titlebar.

If wmaker is compiled with modelock support but modelock is disabled
from the expert preferences, dialog windows like run command or exit
will not show the language pixmap but will show empty frame borders.

When modelock is enabled from the expert preferences, it needs a
warm restart for the titlebars to be updated with the language pixmap.
If afterwards, modelock is disabled from the expert preferences,
any old windows that is gettting focus will be repainted and the language
pixmap will be destroyed but the empty frame borders will still be
present. Now to fully disable modelock for existing opened windows,
wmaker needs a warm restart.
2026-02-09 09:23:07 +00:00
David Maciejak
839061a25a wmaker: fix window position issues
This patch is fixing some initial window position issues
as seen for example with virtualbox.
Now wmaker is not trying to manage the 1x1 app internal windows
which was resulting on some position issues (stacking the window
app on the left side).
It also fixes some window jitters issues when the app is trying
to negotiate some tiny position adjustments.
Related to bug at https://github.com/window-maker/wmaker/issues/26
2026-02-07 20:39:24 +00:00
David Maciejak
1e63c590b6 wmaker: factorize duplicated code
This patch is factorizing is_same and getBool functions in misc.
is_same is renamed to WMStrEqual
getBool is renamed to WMPLGetBool
to prevent name collision issues.
2026-02-07 20:37:46 +00:00
David Maciejak
92e1e9fb0b WPrefs: fix some truncated texts
This patch is fixing some text truncation in the ergonomic and
hot corner preference tabs.
2026-02-07 13:33:40 +00:00
David Maciejak
ddf0b20367 wmaker: refactor get_corner()
This patch refactors get_corner() for better readability
and performance.
2026-02-07 13:33:40 +00:00
David Maciejak
d303317a31 wmaker: handle keybinding change notifications
This patch is to fix an issue seen on FreeBSD 15 where
keybinding are mixed up at the cold start of wmaker.
It is mentioned at https://github.com/window-maker/wmaker/issues/43
Seems that issue is not happening on Linux.
A warm restart ("restart window maker") from the root menu
is getting rid of that issue temporarily.

To solve that issue, now wmaker is reloading the keyboard mapping
via the new wReadKeybindings function when a XkbNewKeyboardNotifyMask
event is received.
It means xkb, which is part of X11 core,
is now used by default and not conditionally with modelock.
I tried to delay reading the keybinding as late as possible but
it did not solve the issue as seems X is started with a improper
keyboard by default.

Here some debug trace when the bindings are loaded by wmaker on FreeBSD:

Keybind F12: keycode=96 modifier=0x0   <--- cold starting wmaker
Keybind F11: keycode=95 modifier=0x0
Keybind Escape: keycode=9 modifier=0x4
Keybind M: keycode=58 modifier=0x8
Keybind H: keycode=43 modifier=0x8
Keybind Up: keycode=98 modifier=0x8   <--- keycode is wrong, provided by X11
Keybind Down: keycode=104 modifier=0x8
Keybind Tab: keycode=23 modifier=0x8
Keybind Tab: keycode=23 modifier=0x9
Keybind Right: keycode=102 modifier=0xc
Keybind Left: keycode=100 modifier=0xc
Keybind 1: keycode=10 modifier=0x8
Keybind 2: keycode=11 modifier=0x8
Keybind 3: keycode=12 modifier=0x8
Keybind 4: keycode=13 modifier=0x8
Keybind 5: keycode=14 modifier=0x8
Keybind 6: keycode=15 modifier=0x8
Keybind 7: keycode=16 modifier=0x8
Keybind 8: keycode=17 modifier=0x8
Keybind 9: keycode=18 modifier=0x8
Keybind 0: keycode=19 modifier=0x8
Keybind Print: keycode=111 modifier=0x0   <--- keycode is wrong, 111 is UP key

/usr/ports/x11-wm/windowmaker/work/WindowMaker-0.96.0/src/.libs/wmaker(execInitScript(main.c:531)):
error: /root/GNUstep/Library/WindowMaker/autostart:could not execute initialization script   <--- warm restart from wmaker
Keybind F12: keycode=96 modifier=0x0
Keybind F11: keycode=95 modifier=0x0
Keybind Escape: keycode=9 modifier=0x4
Keybind M: keycode=58 modifier=0x8
Keybind H: keycode=43 modifier=0x8
Keybind Up: keycode=111 modifier=0x8   <--- UP key keycode is correct
Keybind Down: keycode=116 modifier=0x8
Keybind Tab: keycode=23 modifier=0x8
Keybind Tab: keycode=23 modifier=0x9
Keybind Right: keycode=114 modifier=0xc
Keybind Left: keycode=113 modifier=0xc
Keybind 1: keycode=10 modifier=0x8
Keybind 2: keycode=11 modifier=0x8
Keybind 3: keycode=12 modifier=0x8
Keybind 4: keycode=13 modifier=0x8
Keybind 5: keycode=14 modifier=0x8
Keybind 6: keycode=15 modifier=0x8
Keybind 7: keycode=16 modifier=0x8
Keybind 8: keycode=17 modifier=0x8
Keybind 9: keycode=18 modifier=0x8
Keybind 0: keycode=19 modifier=0x8
Keybind Print: keycode=107 modifier=0x0   <--- Print keycode is correct

Alternatively, to mitigate the issue, .xinitrc can be set to:

setxkbmap -layout us
exec wmaker

or whatever layout you are using.
2026-02-07 13:33:40 +00:00
David Maciejak
c620b354b5 wmaker: fix some truncated texts in the info panel
This patch is fixing some text truncation especially
for displaying the total memory allocated in debug mode
and the image formats (when the JXL support is enabled).
2026-02-07 13:33:40 +00:00
David Maciejak
ebac2bbcd8 wmaker: fix compiler warning in properties.c
This patch is fixing a compiler warning for the implicit
conversion of int to char changes value from 255 to -1
when at the line *ptr++ = 255 the code is trying to store
the value 255 into a char.
2026-02-07 13:33:40 +00:00
David Maciejak
3281349f8d WINGs: remove unnecessary warning in wtextfield
Since commit 77db6dc649
("WINGs: fix right and center aligned wtextfield"),
right and center alignments are working in wtextfield.
2026-02-07 13:32:27 +00:00
David Maciejak
3f5280987e WINGs: refactor wlist
This patch refactors wlist to bring some improvements
to not count the list of entries at each loop iteration.
2026-02-07 13:31:28 +00:00
David Maciejak
6d0953bc22 wmaker: add support for _NET_WM_MOVERESIZE
This patch adds support for _NET_WM_MOVERESIZE hint as defined in EWMH
which allows a window without decorations to manage itself (moving/resizing).
The purpose is to fix the issue mentioned at https://github.com/window-maker/wmaker/issues/20

Tested with VS Code, Google Chrome, Steam and Discord.

Specs are available at https://specifications.freedesktop.org/wm/1.5/ar01s04.html#id-1.5.4
2026-02-03 18:05:20 +00:00
David Maciejak
ef1a504898 wrlib: alpha combine speed improvement
This patch is improving the alpha combine function by using int
instead of float. That function is used for example in the
switch panel to merge the transparency mask.
The change is practically indistinguishable to the human eye
for a single-pass blend but the performance gained is huge.

I've been doing some benchmark of wrlib and even implemented AVX2 support.
But the gain compared to the complexity of AVX2 is not worth,
while having int usage in that specific function is a really good trade-off.

Here the result:

Alpha Blending Performance Test
Image size: 1024x768 (786432 pixels)
Iterations: 100

AVX2 support: YES

=== RGBA Source Test ===
Original (float):     2.540 ms/frame  (393.8 FPS)
Optimized (int):      1.983 ms/frame  (504.2 FPS)  [1.3x speedup]
AVX2 optimized:       1.843 ms/frame  (542.6 FPS)  [1.4x speedup]

By using int, the alpha blending in that use case is 28% faster.
2026-01-27 10:56:30 +00:00
David Maciejak
474b23344a wrlib: change default scaling interpolation to Catmull-Rom
This patch is implementing a new default Catmull-Rom filter
to resize images.
Catmull-Rom is a special case of cubic interpolation with B=0 and
C=0.5 (in the Mitchell-Netravali formulation).
It provides slighlty sharper results than Mitchell with the same
performance.
Catmull-Rom is a better choice for a window manager as it prioritizes
sharpness, making small elements feel crisp.
2026-01-27 10:53:34 +00:00
David Maciejak
77db6dc649 WINGs: fix right and center aligned wtextfield
This patch is fixing some issues in how right and center aligned
wtextfields are handled.
-text selection with mouse was not working properly especially
setting and identifying the cursor position
-middle button paste was only working for left aligned text
2026-01-27 10:52:04 +00:00
David Maciejak
b09ac30233 WINGs: add case to wtextfield test
This patch adds a wtextfield center aligned to the unit test.
2026-01-27 10:50:58 +00:00
David Maciejak
6e14b6142b wmaker: fix _NET_WM_NAME window manager's name
xterm is not working properly (it's not advertising its internal icon)
if the window manager's name contains a space, seems to be specific
to xterm as xeyes and xpaint are working fine.
2026-01-27 10:47:58 +00:00
David Maciejak
7778df2fc5 wmaker: add keyboard control to crash window
This patch is allowing to control the wpopupbutton entries
via keyboard up/down arrows.
It happens to me a few weeks ago during development,
wmaker crashed and I lost the mouse control.
I was stuck on that dialog box without a way to select another entry.
2026-01-25 01:28:53 +00:00
David Maciejak
156841f80e WINGs: wpopupbutton add two functions to change the displayed item
This patch is adding WMSelectPopUpButtonPreviousItem and
WMSelectPopUpButtonNextItem functions to the widget.
The WINGs lib version is bumped.
2026-01-25 01:28:53 +00:00
David Maciejak
c82e6dad5c wmaker: set the window manager's information
According to EWMH specification, the active window manager is supposed
to set some information. Those can be gathered for example with
'wmctrl -m'.

Before the patch:
$ wmctrl -m
Name: N/A
Class: N/A
PID: N/A
Window manager's "showing the desktop" mode: OFF

After the patch:
$ wmctrl -m
Name: Window Maker 0.96.0
Class: wmaker
PID: 6866
Window manager's "showing the desktop" mode: OFF
2026-01-24 14:24:03 +00:00
David Maciejak
95c68fe26d configure: add optional --enable-native option to compilation flags
This patch adds an option to enable native CPU optimizations
by adding -march=native to the compiler flags, tuning the
generated code for the build machine at the expense of portability.

In some tests, especially on wrlib I saw 8% perf improvement.
Should be used by developers or those who recompile wmaker for their own usage.
2026-01-24 14:24:03 +00:00
David Maciejak
77c3b95fd5 Doc: fix wmiv man page
Sort out the argument order or else 'make check' will complain.
2026-01-24 00:52:25 +00:00
David Maciejak
b662d0827c WINGs: wfont fallback to default font when font is not found
This patch is fixing the issue reported
at https://github.com/window-maker/wmaker/issues/62
where wmaker is crashing if the font specified in WMGLOBAL is not found.
Now by default it will failsafe to DEFAULT_FONT.
2026-01-22 22:46:10 +00:00
David Maciejak
a542934e67 WINGs: fix cursor ghosting issue in wtextfield
The cursor is moved using right/left arrows but as it's blinking
and a XOR function is used to hide/unhide it, it happens the cursor
can be not hidden properly from its previous position.
Better to refresh the view to avoid such issues.
2026-01-22 22:46:10 +00:00
David Maciejak
d2b2c3238b WINGs: fix cursor position in wtextfield
In case the cursor is positioned out of the textfield view
after a delete and more chars are entered, wmaker process
will reach 100% and become unresponsive.

How to reproduce:
in the run command window enter an overly long text (longer than
the current input field view). Then, press home to go back to the
beginning of the string. Then, shift-End to select all the text,
then del to delete all the text. At that point the cursor is still
out of the view and if you enter more text wmaker process will be stuck.
2026-01-22 22:46:10 +00:00
David Maciejak
d37a3162e0 WINGs: fix TARGETS request return type
According to the ICCCM, a reply to a TARGETS request must be a list of atoms.
Took the chance to also fix variable naming consistency between wtext and
wtextfield which are using the same kind of code.
2026-01-22 22:46:10 +00:00
David Maciejak
9ddacfc29b Fix typos and some appicon consistency in the FAQ 2026-01-18 14:54:28 +00:00
David Maciejak
7e21785710 wmiv: add support for archive files and a new option to ignore unknown image format
This patch adds optional support for compressed files and a new --ignore-unknown option
to ignore unknown image format. It also adds local filename drag-and-drop support.
And a copy current image to clipboard feature with ctrl+c shortcut.

It also fixes:
- fullscreen issue on multi monitors setup by using randr
- app icon advertised via _NET_WM_ICON
- fix UTF-8 filename usage in window title
2026-01-17 22:03:09 +00:00
David Maciejak
7cfdf6bd68 WRaster: add function to save image in memory
This patch adds the RSaveRawImage() function to the WRaster lib
to be able to save image structure in memory.
The WRaster lib version is bumped.
2026-01-17 22:03:09 +00:00
David Maciejak
72942267aa Prevent wrong UTF-8 window title truncation
The patch is fixing a UTF-8 truncation issue that could happen with the window title
when it was shrinked to be displayed in the window list (F11), leading to
an infinite loop.

Issue was reported at https://github.com/window-maker/wmaker/issues/61
2026-01-15 15:56:20 +00:00
Balló György
ac19c4bc07 Don't set X-GDM-SessionRegisters to true
Window Maker does not call the RegisterSession() method on GDM's D-Bus
interface, causing that GDM doesn't know that the login was successful,
which leads to problems. If X-GDM-SessionRegisters is not specified or
false, GDM registers the session itself.

I noticed this when I logged out from Window Maker, and tried to log
in into another session with GDM, it doesn't work, because the login
screen hangs as the previous session was not entered into registered
state within GDM.

If X-GDM-SessionRegisters=true is specified, GDM expects that the
session will be registered via D-Bus:
1c061b84ff

E.g. GNOME Shell calls RegisterSession() method after login:
0e37cd2ec9

Older versions behave the same way as would be X-GDM-SessionRegisters
not set or false.

Currently X-GDM-SessionRegisters=true is used only by GNOME Shell. All
other sessions omit this property, because they don't call the
RegisterSession() method on GDM's D-Bus interface after login.
2026-01-13 13:11:21 +00:00
David Maciejak
14bd13b1be Doc: fix spelling errors 2026-01-04 14:57:50 +00:00
David Maciejak
afe13d3e72 New expert option: cycle all windows from all workspaces
Mentioned on the WMaker user mailing list, option disabled by default.

https://groups.google.com/g/wmaker-user/c/pR8P-ZYCDFo/m/Wo42U_xqBgAJ

So basically the patch is adding a new expert option in WPrefs (disabled by
default) to allow the switch panel to cycle over all the windows from all
workspaces. I believe it's useful if you are using a lot of fullscreen apps
each on different workspaces.
2026-01-03 19:23:34 +00:00
Carlos R. Mafra
e356ef8c05 Revert "Prevent unnecessary RandR wmaker restart"
This reverts commit 3579c85af1.

As pointed out by David Maciejak himself, this patch triggers
an odd behavior:

 "Now I cannot do a rectangular selection on the desktop with the left
 click of the mouse like I used to do.
 Seems the XRRQueryVersion call to get randr version is messing up with the
 X events. I tried to move up the call in src/startup.c and src/main.c
 instead to the point where the bug cannot be reproduced if I am putting the
 XRRQueryVersion code just before the call to wDefaultsInitDomain
 "WMWindowAttributes" (in src/startup.c) which is really weird."
2025-12-30 20:25:46 +00:00
David Maciejak
3d993a7323 Fix UTF-8 usage in icon title
When pango is enabled and a window title contains UTF-8 chars,
there is a chance the miniaturized icon title will cut in 2 an UTF-8 char
leading to a glitch in the title.
2025-12-29 16:10:24 +00:00
David Maciejak
a4a6e65ca9 Fix for ignore client supplied icon attributes
As mentioned on the WMaker user mailing list some time ago
https://groups.google.com/g/wmaker-user/c/95M_pb_Qlbs/m/6qJLJSqoAwAJ
The Ignore client supplied icon from the windows attributes is not working.
That's especially visible with firefox and thunderbird when they are using
NET_WM_ICON to push the embedded icon.
That patch is making sure to ignore the embedded icon if the user defined one.
2025-12-29 16:10:24 +00:00
David Maciejak
4392fdc291 WRaster: Add optional support to JPEG XL
Detect if libjxl is intalled, and build-in support in raster lib.
Feature can be disabled/enabled at configure time.
2025-12-27 19:48:37 +00:00
David Maciejak
67e2f5e1ca Prevent XAllocColor() call on TrueColor display
As reported in bug https://github.com/window-maker/wmaker/issues/50
X11 XAllocColor() call from wGetColorForColormap() in src/resources.c is returning some errors
especially seen when running GZDoom.

TrueColor display has been the dominant standard for well over a decade, meaning almost all modern X servers default to a TrueColor visual.
The default colormap is predefined and read-only, making allocation with XAllocColor() unnecessary (and meaning no need to free it too).
The patch is checking the display visual, and in case the display is truecolor, it does not allocate or free the color, just looking up for it.
Once the patch applied, GZDoom is not reporting warnings anymore.
2025-12-25 23:22:57 +00:00
David Maciejak
3579c85af1 Prevent unnecessary RandR wmaker restart
As reported in bug https://github.com/window-maker/wmaker/issues/34
when RandR is enabled, everytime a monitor is turned on or off wmaker is restarting
(that happens either manually or automatically with DPMS).
This behavior causes issues with xscreensaver.

How to reproduce the issue:
-install xscreensaver and lock the screen
-turn off then on the monitor manually
-you can see that wmaker was restarted and behind the xscreensaver lock window,
the desktop appears, potentially leaking information

Instead of using the RandR event RRScreenChangeNotifyMask which is too generic,
the patch is using RRCrtcChangeNotifyMask defined since RandR 1.2 (released in 2007).
In the recent RandR version, events for output (hardware) changes are propagated via
RROutputChangeNotifyMask while layout changes (like position, size, rotation)
are propagated via RRCrtcChangeNotifyMask.

The patch is purposedly not listening for RROutputChangeNotifyMask,
thus wmaker is not restarting on DPMS events anymore.

Currently, in case a new monitor is added (or removed) wmaker is not discovering it anyway
even after an automatic restart.
Either, wmaker has to be exited and restarted fully or an external tool like arandr
has to be used to configure the new monitor. So after the patch functionality remains unchanged.
2025-12-24 12:37:12 +00:00
David Maciejak
896bbce2e5 Remove default print key grabbing 2025-12-21 21:23:30 +00:00
David Maciejak
8f1ee27595 Remove duplicated code 2025-12-21 21:23:13 +00:00
Страхиња Радић
541947e9ef Update translator's email for Serbian
This patch updates my email throughout the source.

Signed-off-by: Страхиња Радић <sr@strahinja.org>
2025-10-27 20:47:25 +00:00
Страхиња Радић
7bb7d0f4d6 m4/wm_i18n.m4: Make compatible with POSIX sed
Currently, it seems like the script m4/wm_i18n.m4 is passing some editing
commands to sed(1), which are not strictly conforming to POSIX[1]. Namely, the
"grouping" command:

	{ command; command }

needs to have either a semicolon or a newline before the closing brace:

	{ command; command; }

or

	{ command; command
	}

according to POSIX.

On systems which don't use the lax GNU sed by default (like OpenBSD), the
current configuration and compilation goes like this:

$ autoreconf -vif

	...
	sed: 1: "/po$/{s,.po,,;p}": extra characters at the end of p command
	sed: 1: "/po$/{s,.po,,;p}": extra characters at the end of p command
	... (etc)

$ ./configure --without-menu-textdomain CATALOGS=sr.mo LINGUAS=sr \
	LIBS=-lintl MSGFMT=msgfmt --mandir=/usr/local/man

	...

	Translated languages to support     :

	configure: WARNING: No language from $LINGUAS are supported

$ gmake && doas gmake install
	... (no .mo files are generated nor installed)

and so on, since the editing commands in question are affecting the processing
of .po files.

This patch proposes inserting semicolons before the closing brace in the
mentioned editing commands passed to sed(1).

[1]: https://pubs.opengroup.org/onlinepubs/9799919799/utilities/sed.html#tag_20_109_13_03

Signed-off-by: Страхиња Радић <sr@strahinja.org>
2025-10-27 20:47:25 +00:00
Doug Torrance
da676c9e9e Add WPrefs Serbian translation to EXTRA_DIST
Otherwise "make check" fails (script/check-translation-sources.sh).
2024-11-12 10:15:17 +00:00
Doug Torrance
4edf589a5b Remove cruft from autogen.sh 2024-11-12 10:15:17 +00:00
Doug Torrance
709eec4bce Update autogen.sh so that it can be run from build directory 2024-11-12 10:15:17 +00:00
Jeremy Sowden
b179803c11 Fix spelling errors
* "unknow" -> "unknown"
* "occured" -> "occurred"

Remove some entries from PO files where these entries contain spelling errors
and there are other entries that are identical except for these mistakes.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
2024-11-10 16:59:03 +00:00
Jeremy Sowden
5cd40deb20 Add missing Language: headers to PO files
msgfmt complains.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
2024-11-10 16:59:03 +00:00
Jeremy Sowden
9db1ea580d Ignore wrlib gettext artefacts
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
2024-11-10 16:59:03 +00:00
Jeremy Sowden
9e56f58742 Remove obsolete autoconf macro
`AC_PROG_GCC_TRADITIONAL` is obsolete and is now just an alias for `AC_PROG_CC`,
which is already defined.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
2024-11-10 16:59:03 +00:00