[repo.or.cz] wmaker-crm.git branch master updated: wmaker-0.96.0-35-gb662d0827c7c

0 views
Skip to first unread message

crmafra

unread,
Jan 22, 2026, 5:49:20 PM (11 days ago) Jan 22
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 b662d0827c7c10c197e11b583f8c371add01717a (commit)
via a542934e675b68d4226779c70b1b57e7e78c94a4 (commit)
via d2b2c3238b7875515a0b8e0e492557f088e8a4c0 (commit)
via d37a3162e054549d84fc27062f433adfd523f43a (commit)
from 9ddacfc29b2e4684d34b32b22c943cfb522df2cb (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 b662d0827c7c10c197e11b583f8c371add01717a
Author: David Maciejak <david.m...@gmail.com>
Date: Thu, 22 Jan 2026 17:18:27 -0500
URL: <https://repo.or.cz/wmaker-crm.git/b662d0827c7c10c1>

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.
---
WINGs/wfont.c | 57 +++++++++++++++++++++++----------------------------
1 file changed, 26 insertions(+), 31 deletions(-)

diff --git a/WINGs/wfont.c b/WINGs/wfont.c
index 999aaa441119..b464b6ca7418 100644
--- a/WINGs/wfont.c
+++ b/WINGs/wfont.c
@@ -70,37 +70,30 @@ static Bool hasProperty(FcPattern * pattern, const char *property)
return False;
}

-static Bool hasPropertyWithStringValue(FcPattern * pattern, const char *object, const char *value)
-{
- FcChar8 *str;
- int id;
-
- if (!value || value[0] == 0)
- return True;
-
- id = 0;
- while (FcPatternGetString(pattern, object, id, &str) == FcResultMatch) {
- if (strcasecmp(value, (char *)str) == 0) {
- return True;
- }
- id++;
- }
-
- return False;
-}
-
static char *makeFontOfSize(const char *font, int size, const char *fallback)
{
- FcPattern *pattern;
+ FcPattern *pattern = NULL;
char *result;

- if (font[0] == '-') {
+ if (font && font[0] == '-') {
pattern = xlfdToFcPattern(font);
} else {
pattern = FcNameParse((const FcChar8 *) font);
}

- /*FcPatternPrint(pattern); */
+ if (!pattern) {
+ wwarning(_("could not load font spec: %s."), font);
+ if (!fallback)
+ return NULL;
+ pattern = FcPatternCreate();
+ if (!pattern)
+ return NULL;
+ if (!FcPatternAddString(pattern, FC_FAMILY, (const FcChar8 *) fallback)) {
+ wfatal(_("could not load default font spec: %s."), fallback);
+ FcPatternDestroy(pattern);
+ return NULL;
+ }
+ }

if (size > 0) {
FcPatternDel(pattern, FC_PIXEL_SIZE);
@@ -109,12 +102,6 @@ static char *makeFontOfSize(const char *font, int size, const char *fallback)
FcPatternAddDouble(pattern, FC_PIXEL_SIZE, (double)DEFAULT_SIZE);
}

- if (fallback && !hasPropertyWithStringValue(pattern, FC_FAMILY, fallback)) {
- FcPatternAddString(pattern, FC_FAMILY, (const FcChar8 *) fallback);
- }
-
- /*FcPatternPrint(pattern); */
-
result = (char *)FcNameUnparse(pattern);
FcPatternDestroy(pattern);

@@ -135,7 +122,7 @@ WMFont *WMCreateFont(WMScreen * scrPtr, const char *fontName)
double size;
#endif

- if (fontName[0] == '-') {
+ if (fontName && fontName[0] == '-') {
fname = xlfdToFcName(fontName);
} else {
fname = wstrdup(fontName);
@@ -262,7 +249,11 @@ WMFont *WMSystemFontOfSize(WMScreen * scrPtr, int size)
WMFont *font;
char *fontSpec;

- fontSpec = makeFontOfSize(WINGsConfiguration.systemFont, size, NULL);
+ fontSpec = makeFontOfSize(WINGsConfiguration.systemFont, size, DEFAULT_FONT);
+
+ if (!fontSpec) {
+ return NULL;
+ }

font = WMCreateFont(scrPtr, fontSpec);

@@ -280,7 +271,11 @@ WMFont *WMBoldSystemFontOfSize(WMScreen * scrPtr, int size)
WMFont *font;
char *fontSpec;

- fontSpec = makeFontOfSize(WINGsConfiguration.boldSystemFont, size, NULL);
+ fontSpec = makeFontOfSize(WINGsConfiguration.boldSystemFont, size, DEFAULT_FONT);
+
+ if (!fontSpec) {
+ return NULL;
+ }

font = WMCreateFont(scrPtr, fontSpec);


commit a542934e675b68d4226779c70b1b57e7e78c94a4
Author: David Maciejak <david.m...@gmail.com>
Date: Tue, 20 Jan 2026 23:26:36 -0500
URL: <https://repo.or.cz/wmaker-crm.git/a542934e675b68d4>

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.
---
WINGs/wtextfield.c | 26 ++++++++------------------
1 file changed, 8 insertions(+), 18 deletions(-)

diff --git a/WINGs/wtextfield.c b/WINGs/wtextfield.c
index f5f6e411f546..4752330b63cb 100644
--- a/WINGs/wtextfield.c
+++ b/WINGs/wtextfield.c
@@ -1036,7 +1036,6 @@ static void handleTextFieldKeyPress(TextField * tPtr, XEvent * event)
case XK_Left:
if (tPtr->cursorPosition > 0) {
int i;
- paintCursor(tPtr);

i = tPtr->cursorPosition;
i += oneUTF8CharBackward(&tPtr->text[i], i);
@@ -1052,9 +1051,8 @@ static void handleTextFieldKeyPress(TextField * tPtr, XEvent * event)

if (tPtr->cursorPosition < tPtr->viewPosition) {
tPtr->viewPosition = tPtr->cursorPosition;
- refresh = 1;
- } else
- paintCursor(tPtr);
+ }
+ refresh = 1;
}
if (shifted)
cancelSelection = 0;
@@ -1077,7 +1075,6 @@ static void handleTextFieldKeyPress(TextField * tPtr, XEvent * event)
case XK_Right:
if (tPtr->cursorPosition < tPtr->textLen) {
int i;
- paintCursor(tPtr);

i = tPtr->cursorPosition;
if (controled) {
@@ -1090,10 +1087,8 @@ static void handleTextFieldKeyPress(TextField * tPtr, XEvent * event)
}
tPtr->cursorPosition = i;

- refresh = incrToFit2(tPtr);
-
- if (!refresh)
- paintCursor(tPtr);
+ incrToFit2(tPtr);
+ refresh = 1;
}
if (shifted)
cancelSelection = 0;
@@ -1116,13 +1111,11 @@ static void handleTextFieldKeyPress(TextField * tPtr, XEvent * event)
case XK_Home:
if (!controled) {
if (tPtr->cursorPosition > 0) {
- paintCursor(tPtr);
tPtr->cursorPosition = 0;
if (tPtr->viewPosition > 0) {
tPtr->viewPosition = 0;
- refresh = 1;
- } else
- paintCursor(tPtr);
+ }
+ refresh = 1;
}
if (shifted)
cancelSelection = 0;
@@ -1145,14 +1138,11 @@ static void handleTextFieldKeyPress(TextField * tPtr, XEvent * event)
case XK_End:
if (!controled) {
if (tPtr->cursorPosition < tPtr->textLen) {
- paintCursor(tPtr);
tPtr->cursorPosition = tPtr->textLen;
tPtr->viewPosition = 0;

- refresh = incrToFit(tPtr);
-
- if (!refresh)
- paintCursor(tPtr);
+ incrToFit(tPtr);
+ refresh = 1;
}
if (shifted)
cancelSelection = 0;

commit d2b2c3238b7875515a0b8e0e492557f088e8a4c0
Author: David Maciejak <david.m...@gmail.com>
Date: Tue, 20 Jan 2026 18:48:17 -0500
URL: <https://repo.or.cz/wmaker-crm.git/d2b2c3238b787551>

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.
---
WINGs/wtextfield.c | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/WINGs/wtextfield.c b/WINGs/wtextfield.c
index c955e332c5c4..f5f6e411f546 100644
--- a/WINGs/wtextfield.c
+++ b/WINGs/wtextfield.c
@@ -446,6 +446,13 @@ void WMDeleteTextFieldRange(WMTextField * tPtr, WMRange range)

decrToFit(tPtr);

+ /* Ensure cursor is visible after deletion */
+ if (tPtr->cursorPosition < tPtr->viewPosition) {
+ tPtr->viewPosition = tPtr->cursorPosition;
+ } else {
+ incrToFit2(tPtr);
+ }
+
paintTextField(tPtr);
}


commit d37a3162e054549d84fc27062f433adfd523f43a
Author: David Maciejak <david.m...@gmail.com>
Date: Tue, 20 Jan 2026 17:26:19 -0500
URL: <https://repo.or.cz/wmaker-crm.git/d37a3162e054549d>

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.
---
WINGs/wtext.c | 32 ++++++++++++++++----------------
WINGs/wtextfield.c | 20 ++++++++++----------
2 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/WINGs/wtext.c b/WINGs/wtext.c
index 61899ed80ee2..0f6edc4d0a09 100644
--- a/WINGs/wtext.c
+++ b/WINGs/wtext.c
@@ -219,9 +219,9 @@ static char *default_bullet[] = {
};

/* These id are used when sharing the selected text between applications */
-static Atom XA_Targets = None;
-static Atom XA_Format_Text = None;
-static Atom XA_Format_Compound_Text = None;
+static Atom XA_TARGETS = None;
+static Atom XA_TEXT = None;
+static Atom XA_COMPOUND_TEXT = None;

static void handleEvents(XEvent * event, void *data);
static void layOutDocument(Text * tPtr);
@@ -2050,7 +2050,7 @@ static WMData *requestHandler(WMView * view, Atom selection, Atom target, void *
(void) selection;
(void) cdata;

- if (target == XA_STRING || target == XA_Format_Text || target == XA_Format_Compound_Text) {
+ if (target == XA_STRING || target == XA_TEXT || target == XA_COMPOUND_TEXT) {
char *text = WMGetTextSelectedStream(tPtr);

if (text) {
@@ -2063,18 +2063,18 @@ static WMData *requestHandler(WMView * view, Atom selection, Atom target, void *
} else
printf("didn't get it\n");

- if (target == XA_Targets) {
- Atom array[4];
+ if (target == XA_TARGETS) {
+ Atom supported_type[4];

- array[0] = XA_Targets;
- array[1] = XA_STRING;
- array[2] = XA_Format_Text;
- array[3] = XA_Format_Compound_Text;
+ supported_type[0] = XA_TARGETS;
+ supported_type[1] = XA_STRING;
+ supported_type[2] = XA_TEXT;
+ supported_type[3] = XA_COMPOUND_TEXT;

- data = WMCreateDataWithBytes(&array, sizeof(array));
+ data = WMCreateDataWithBytes(supported_type, sizeof(supported_type));
WMSetDataFormat(data, 32);

- *type = target;
+ *type = XA_ATOM;
return data;
}

@@ -2977,15 +2977,15 @@ WMText *WMCreateTextForDocumentType(WMWidget * parent, WMAction * parser, WMActi
dpy = tPtr->view->screen->display;
scr = tPtr->view->screen;

- if (XA_Targets == None) {
+ if (XA_TARGETS == None) {
/*
* Because the X protocol guaranties that the value will never change in
* the lifespan of the server, we query the values only the first time a
* widget is created
*/
- XA_Targets = XInternAtom(dpy, "TARGETS", False);
- XA_Format_Text = XInternAtom(dpy, "TEXT", False);
- XA_Format_Compound_Text = XInternAtom(dpy, "COMPOUND_TEXT", False);
+ XA_TARGETS = XInternAtom(dpy, "TARGETS", False);
+ XA_TEXT = XInternAtom(dpy, "TEXT", False);
+ XA_COMPOUND_TEXT = XInternAtom(dpy, "COMPOUND_TEXT", False);
}

tPtr->view->self = tPtr;
diff --git a/WINGs/wtextfield.c b/WINGs/wtextfield.c
index feb1d189c639..c955e332c5c4 100644
--- a/WINGs/wtextfield.c
+++ b/WINGs/wtextfield.c
@@ -239,9 +239,9 @@ static WMData *requestHandler(WMView * view, Atom selection, Atom target, void *
TextField *tPtr = view->self;
int count;
Display *dpy = tPtr->view->screen->display;
- Atom _TARGETS;
- Atom TEXT = XInternAtom(dpy, "TEXT", False);
- Atom COMPOUND_TEXT = XInternAtom(dpy, "COMPOUND_TEXT", False);
+ Atom XA_TARGETS;
+ Atom XA_TEXT = XInternAtom(dpy, "TEXT", False);
+ Atom XA_COMPOUND_TEXT = XInternAtom(dpy, "COMPOUND_TEXT", False);
WMData *data;

/* Parameter not used, but tell the compiler that it is ok */
@@ -251,7 +251,7 @@ static WMData *requestHandler(WMView * view, Atom selection, Atom target, void *
count = tPtr->selection.count < 0
? tPtr->selection.position + tPtr->selection.count : tPtr->selection.position;

- if (target == XA_STRING || target == TEXT || target == COMPOUND_TEXT) {
+ if (target == XA_STRING || target == XA_TEXT || target == XA_COMPOUND_TEXT) {

data = WMCreateDataWithBytes(&(tPtr->text[count]), abs(tPtr->selection.count));
WMSetDataFormat(data, 8);
@@ -260,19 +260,19 @@ static WMData *requestHandler(WMView * view, Atom selection, Atom target, void *
return data;
}

- _TARGETS = XInternAtom(dpy, "TARGETS", False);
- if (target == _TARGETS) {
+ XA_TARGETS = XInternAtom(dpy, "TARGETS", False);
+ if (target == XA_TARGETS) {
Atom supported_type[4];

- supported_type[0] = _TARGETS;
+ supported_type[0] = XA_TARGETS;
supported_type[1] = XA_STRING;
- supported_type[2] = TEXT;
- supported_type[3] = COMPOUND_TEXT;
+ supported_type[2] = XA_TEXT;
+ supported_type[3] = XA_COMPOUND_TEXT;

data = WMCreateDataWithBytes(supported_type, sizeof(supported_type));
WMSetDataFormat(data, 32);

- *type = target;
+ *type = XA_ATOM;
return data;
}


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

Summary of changes:
WINGs/wfont.c | 57 +++++++++++++++++++++-------------------------
WINGs/wtext.c | 32 +++++++++++++-------------
WINGs/wtextfield.c | 53 ++++++++++++++++++++----------------------
3 files changed, 67 insertions(+), 75 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