[repo.or.cz] wmaker-crm.git branch master updated: wmaker-0.96.0-71-g66bf19c1e0c8

3 views
Skip to first unread message

crmafra

unread,
Feb 25, 2026, 2:55:56 AMFeb 25
to wmake...@googlegroups.com
This is an automated email generated because a ref change occurred in the
git repository for project wmaker-crm.git.

The branch, master has been updated
via 66bf19c1e0c87e3eec4f8875eb82f775d55706cc (commit)
from 073235ada42e04d0eed0e70a2edd432cdef2a5eb (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 66bf19c1e0c87e3eec4f8875eb82f775d55706cc
Author: David Maciejak <david.m...@gmail.com>
Date: Tue, 24 Feb 2026 21:48:37 -0500
URL: <https://repo.or.cz/wmaker-crm.git/66bf19c1e0c87e3e>

wmaker: add new ModifierKeyShortLabels option

This patch is adding a new ModifierKeyShortLabels option to the
WindowMaker file to let the user specify the modifier key labels
used in the shortcuts like those appearing in the root menu.
For example, to overwrite the default labels, a user can set
the new option value to:

ModifierKeyShortLabels = (
"\342\207\247",
"\342\214\203",
"\342\214\245",
"\342\207\255",
"\342\207\263",
"\342\214\230",
"\342\207\252",
"\342\227\206",
"\342\214\245"
);

Which is using the same symbols as defined in macos.
For example, instead of printing M4+, "\342\214\230"
will print the ⌘ (Command) symbol.
---
src/WindowMaker.h | 1 +
src/defaults.c | 39 +++++++++++++++++++++++++++++++++++++++
src/xmodifier.c | 42 ++++++++++++++++++++++++------------------
3 files changed, 64 insertions(+), 18 deletions(-)

diff --git a/src/WindowMaker.h b/src/WindowMaker.h
index 75464fdfe9ae..dea943b97082 100644
--- a/src/WindowMaker.h
+++ b/src/WindowMaker.h
@@ -393,6 +393,7 @@ extern struct WPreferences {
signed char workspace_name_display_position;
unsigned int modifier_mask; /* mask to use as kbd modifier */
char *modifier_labels[7]; /* Names of the modifiers */
+ char *modifier_short_labels[9]; /* Short names of the modifiers */

unsigned int supports_tiff; /* Use tiff files */

diff --git a/src/defaults.c b/src/defaults.c
index 43860599da45..6b6bc4c3faf9 100644
--- a/src/defaults.c
+++ b/src/defaults.c
@@ -151,6 +151,7 @@ static WDECallbackUpdate setSwPOptions;
static WDECallbackUpdate updateUsableArea;

static WDECallbackUpdate setModifierKeyLabels;
+static WDECallbackUpdate setModifierShortKeyLabels;
static WDECallbackUpdate setHotCornerActions;

static WDECallbackConvert getCursor;
@@ -624,6 +625,8 @@ WDefaultEntry optionList[] = {
NULL, getPropList, setSwPOptions, NULL, NULL},
{"ModifierKeyLabels", "(\"Shift+\", \"Control+\", \"Mod1+\", \"Mod2+\", \"Mod3+\", \"Mod4+\", \"Mod5+\")", &wPreferences,
NULL, getPropList, setModifierKeyLabels, NULL, NULL},
+ {"ModifierKeyShortLabels", "(\"Sh+\", \"^\", \"M1+\", \"M2+\", \"M3+\", \"M4+\", \"M5+\", \"M+\", \"A+\")", &wPreferences,
+ NULL, getPropList, setModifierShortKeyLabels, NULL, NULL},
{"FrameBorderWidth", "1", NULL,
NULL, getInt, setFrameBorderWidth, NULL, NULL},
{"FrameBorderColor", "black", NULL,
@@ -3499,6 +3502,42 @@ static int setModifierKeyLabels(WScreen * scr, WDefaultEntry * entry, void *tdat
return 0;
}

+static int setModifierShortKeyLabels(WScreen * scr, WDefaultEntry * entry, void *tdata, void *foo)
+{
+ WMPropList *array = tdata;
+ int i;
+ struct WPreferences *prefs = foo;
+
+ if (!WMIsPLArray(array) || WMGetPropListItemCount(array) != 9) {
+ wwarning(_("Value for option \"%s\" must be an array of 9 strings"), entry->key);
+ WMReleasePropList(array);
+ return 0;
+ }
+
+ DestroyWindowMenu(scr);
+
+ for (i = 0; i < 9; i++) {
+ if (prefs->modifier_short_labels[i])
+ wfree(prefs->modifier_short_labels[i]);
+
+ if (WMIsPLString(WMGetFromPLArray(array, i))) {
+ prefs->modifier_short_labels[i] = wstrdup(WMGetFromPLString(WMGetFromPLArray(array, i)));
+ if (prefs->modifier_short_labels[i][0] == '\0') {
+ wwarning(_("Invalid argument for option \"%s\" item %d, cannot be empty"), entry->key, i);
+ wfree(prefs->modifier_short_labels[i]);
+ prefs->modifier_short_labels[i] = NULL;
+ }
+ } else {
+ wwarning(_("Invalid argument for option \"%s\" item %d"), entry->key, i);
+ prefs->modifier_short_labels[i] = NULL;
+ }
+ }
+
+ WMReleasePropList(array);
+
+ return 0;
+}
+
static int setHotCornerActions(WScreen * scr, WDefaultEntry * entry, void *tdata, void *foo)
{
WMPropList *array = tdata;
diff --git a/src/xmodifier.c b/src/xmodifier.c
index e2c0fa2acdd4..f4bdd0d0126d 100644
--- a/src/xmodifier.c
+++ b/src/xmodifier.c
@@ -280,24 +280,30 @@ const char *wXModifierToShortcutLabel(int mask)
if (mask < 0)
return NULL;

- if (mask == ShiftMask)
- return "Sh+";
- if (mask == ControlMask)
- return "^";
- if (mask == AltMask)
- return "A+";
- if (mask == Mod1Mask)
- return "M1+";
- if (mask == Mod2Mask)
- return "M2+";
- if (mask == Mod3Mask)
- return "M3+";
- if (mask == Mod4Mask)
- return "M4+";
- if (mask == Mod5Mask)
- return "M5+";
- if (mask == MetaMask)
- return "M+";
+ struct map_entry {
+ int mask;
+ int label_index;
+ const char *def;
+ } maps[] = {
+ { ShiftMask, 0, "Sh+"},
+ { ControlMask, 1, "^" },
+ { AltMask, 8, "A+" },
+ { Mod1Mask, 2, "M1+"},
+ { Mod2Mask, 3, "M2+"},
+ { Mod3Mask, 4, "M3+"},
+ { Mod4Mask, 5, "M4+"},
+ { Mod5Mask, 6, "M5+"},
+ { MetaMask, 7, "M+" }
+ };
+
+ for (size_t i = 0; i < sizeof(maps)/sizeof(maps[0]); i++) {
+ if (mask == maps[i].mask) {
+ int idx = maps[i].label_index;
+ if (idx >= 0 && idx < 9 && wPreferences.modifier_short_labels[idx])
+ return wPreferences.modifier_short_labels[idx];
+ return maps[i].def;
+ }
+ }

wwarning(_("Can't convert keymask 0x%04X to a shortcut label"), mask);
return NULL;

-----------------------------------------------------------------------

Summary of changes:
src/WindowMaker.h | 1 +
src/defaults.c | 39 +++++++++++++++++++++++++++++++++++++++
src/xmodifier.c | 42 ++++++++++++++++++++++++------------------
3 files changed, 64 insertions(+), 18 deletions(-)


repo.or.cz automatic notification. Contact project admin crm...@gmail.com
if you want to unsubscribe, or site admin ad...@repo.or.cz if you receive
no reply.
--
wmaker-crm.git ("The Window Maker window manager")
Reply all
Reply to author
Forward
0 new messages