[repo.or.cz] wmaker-crm.git branch master updated: wmaker-0.96.0-45-gef1a5048986b

2 views
Skip to first unread message

crmafra

unread,
Jan 27, 2026, 5:57:30 AM (7 days ago) Jan 27
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 ef1a5048986b1786f32c12fd877fca9f08d2ed0a (commit)
via 474b23344aa9152e392eb456c820552404ffafdb (commit)
via 77db6dc649eb96d85d9e13e118a90517e1e17eed (commit)
via b09ac302339e28c6d0ec7dc2e405f3f0c8b56d54 (commit)
via 6e14b6142b6f701ca314da8795a6e5ddd7db18df (commit)
from 7778df2fc598dfb85d90330fdc6d8c412c94f695 (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 ef1a5048986b1786f32c12fd877fca9f08d2ed0a
Author: David Maciejak <david.m...@gmail.com>
Date: Sun, 25 Jan 2026 14:47:06 -0500
URL: <https://repo.or.cz/wmaker-crm.git/ef1a5048986b1786>

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.
---
wrlib/alpha_combine.c | 76 +++++++++++++++++++++----------------------
1 file changed, 38 insertions(+), 38 deletions(-)

diff --git a/wrlib/alpha_combine.c b/wrlib/alpha_combine.c
index 915f65b91ae5..085aec55ba9a 100644
--- a/wrlib/alpha_combine.c
+++ b/wrlib/alpha_combine.c
@@ -25,47 +25,47 @@


void RCombineAlpha(unsigned char *d, unsigned char *s, int s_has_alpha,
- int width, int height, int dwi, int swi, int opacity) {
- int x, y;
- int t, sa;
- int alpha;
- float ratio, cratio;
+ int width, int height, int dwi, int swi, int opacity) {
+ int x, y;
+ unsigned char *dst = d;
+ unsigned char *src = s;

- for (y=0; y<height; y++) {
- for (x=0; x<width; x++) {
- sa=s_has_alpha?*(s+3):255;
+ for (y = 0; y < height; y++) {
+ for (x = 0; x < width; x++) {
+ int sa = s_has_alpha ? src[3] : 255;
+ int t, alpha;

- if (opacity!=255) {
- t = sa * opacity + 0x80;
- sa = ((t>>8)+t)>>8;
- }
+ if (opacity != 255) {
+ t = sa * opacity + 0x80;
+ sa = ((t >> 8) + t) >> 8;
+ }

- t = *(d+3) * (255-sa) + 0x80;
- alpha = sa + (((t>>8)+t)>>8);
+ t = dst[3] * (255 - sa) + 0x80;
+ alpha = sa + (((t >> 8) + t) >> 8);

- if (sa==0 || alpha==0) {
- ratio = 0;
- cratio = 1.0;
- } else if(sa == alpha) {
- ratio = 1.0;
- cratio = 0;
- } else {
- ratio = (float)sa / alpha;
- cratio = 1.0F - ratio;
- }
+ if (alpha == 0) {
+ dst[3] = 0;
+ } else if (sa == alpha) {
+ dst[0] = src[0];
+ dst[1] = src[1];
+ dst[2] = src[2];
+ dst[3] = alpha;
+ } else if (sa == 0) {
+ dst[3] = alpha;
+ } else {
+ int ratio = (sa << 8) / alpha;
+ int inv_ratio = 256 - ratio;

- *d = (int)*d * cratio + (int)*s * ratio;
- s++; d++;
- *d = (int)*d * cratio + (int)*s * ratio;
- s++; d++;
- *d = (int)*d * cratio + (int)*s * ratio;
- s++; d++;
- *d = alpha;
- d++;
+ dst[0] = (dst[0] * inv_ratio + src[0] * ratio) >> 8;
+ dst[1] = (dst[1] * inv_ratio + src[1] * ratio) >> 8;
+ dst[2] = (dst[2] * inv_ratio + src[2] * ratio) >> 8;
+ dst[3] = alpha;
+ }

- if (s_has_alpha) s++;
- }
- d+=dwi;
- s+=swi;
- }
-}
+ dst += 4;
+ src += s_has_alpha ? 4 : 3;
+ }
+ dst += dwi;
+ src += swi;
+ }
+}
\ No newline at end of file

commit 474b23344aa9152e392eb456c820552404ffafdb
Author: David Maciejak <david.m...@gmail.com>
Date: Sun, 25 Jan 2026 14:17:52 -0500
URL: <https://repo.or.cz/wmaker-crm.git/474b23344aa9152e>

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.
---
wrlib/context.c | 2 +-
wrlib/scale.c | 27 ++++++++++++++++++++++++---
wrlib/wraster.h.in | 3 ++-
3 files changed, 27 insertions(+), 5 deletions(-)

diff --git a/wrlib/context.c b/wrlib/context.c
index 730445066129..6bc4c85abb51 100644
--- a/wrlib/context.c
+++ b/wrlib/context.c
@@ -554,7 +554,7 @@ RContext *RCreateContext(Display * dpy, int screen_number, const RContextAttribu

if (!(context->attribs->flags & RC_ScalingFilter)) {
context->attribs->flags |= RC_ScalingFilter;
- context->attribs->scaling_filter = RMitchellFilter;
+ context->attribs->scaling_filter = RCatmullRomFilter;
}

/* get configuration from environment variables */
diff --git a/wrlib/scale.c b/wrlib/scale.c
index 93c5172d9f70..da715ea55e44 100644
--- a/wrlib/scale.c
+++ b/wrlib/scale.c
@@ -244,8 +244,25 @@ static double Mitchell_filter(double t)
return (0.0);
}

-static double (*filterf)(double) = Mitchell_filter;
-static double fwidth = Mitchell_support;
+#define CatmullRom_support (2.0)
+
+static double CatmullRom_filter(double t)
+{
+ double tt;
+
+ tt = t * t;
+ if (t < 0)
+ t = -t;
+ if (t < 1.0) {
+ return ((1.5 * t * tt) - (2.5 * tt) + 1.0);
+ } else if (t < 2.0) {
+ return ((-0.5 * t * tt) + (2.5 * tt) - (4.0 * t) + 2.0);
+ }
+ return (0.0);
+}
+
+static double (*filterf)(double) = CatmullRom_filter;
+static double fwidth = CatmullRom_support;

void wraster_change_filter(RScalingFilter type)
{
@@ -270,11 +287,15 @@ void wraster_change_filter(RScalingFilter type)
filterf = Lanczos3_filter;
fwidth = Lanczos3_support;
break;
- default:
case RMitchellFilter:
filterf = Mitchell_filter;
fwidth = Mitchell_support;
break;
+ default:
+ case RCatmullRomFilter:
+ filterf = CatmullRom_filter;
+ fwidth = CatmullRom_support;
+ break;
}
}

diff --git a/wrlib/wraster.h.in b/wrlib/wraster.h.in
index 6414455ee4e5..e197c8d707a4 100644
--- a/wrlib/wraster.h.in
+++ b/wrlib/wraster.h.in
@@ -143,7 +143,8 @@ typedef enum {
RBellFilter,
RBSplineFilter,
RLanczos3Filter,
- RMitchellFilter
+ RMitchellFilter,
+ RCatmullRomFilter
} RScalingFilter;



commit 77db6dc649eb96d85d9e13e118a90517e1e17eed
Author: David Maciejak <david.m...@gmail.com>
Date: Sun, 25 Jan 2026 14:11:23 -0500
URL: <https://repo.or.cz/wmaker-crm.git/77db6dc649eb96d8>

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

diff --git a/WINGs/wtextfield.c b/WINGs/wtextfield.c
index 4752330b63cb..6a4d9ef22a1f 100644
--- a/WINGs/wtextfield.c
+++ b/WINGs/wtextfield.c
@@ -853,8 +853,8 @@ static void paintTextField(TextField * tPtr)
count = tPtr->viewPosition;
}

- rx = tPtr->offsetWidth + 1 + WMWidthOfString(tPtr->font, text, count)
- - WMWidthOfString(tPtr->font, text, tPtr->viewPosition);
+ rx = tx + WMWidthOfString(tPtr->font, &(text[tPtr->viewPosition]),
+ count - tPtr->viewPosition);

WMDrawImageString(screen, drawbuffer, color, screen->gray,
tPtr->font, rx, ty, &(text[count]), count2);
@@ -1405,7 +1405,25 @@ static void handleTextFieldActionEvents(XEvent * event, void *data)
tPtr->viewPosition);
}

- tPtr->cursorPosition = pointToCursorPosition(tPtr, event->xmotion.x);
+ if (tPtr->flags.alignment == WARight) {
+ int textWidth = WMWidthOfString(tPtr->font, tPtr->text, tPtr->textLen);
+ if (textWidth < tPtr->usableWidth) {
+ tPtr->cursorPosition = pointToCursorPosition(tPtr,
+ event->xmotion.x - tPtr->usableWidth + textWidth);
+ } else {
+ tPtr->cursorPosition = pointToCursorPosition(tPtr, event->xmotion.x);
+ }
+ } else if (tPtr->flags.alignment == WACenter) {
+ int textWidth = WMWidthOfString(tPtr->font, tPtr->text, tPtr->textLen);
+ if (textWidth < tPtr->usableWidth) {
+ tPtr->cursorPosition = pointToCursorPosition(tPtr,
+ event->xmotion.x - (tPtr->usableWidth - textWidth) / 2);
+ } else {
+ tPtr->cursorPosition = pointToCursorPosition(tPtr, event->xmotion.x);
+ }
+ } else {
+ tPtr->cursorPosition = pointToCursorPosition(tPtr, event->xmotion.x);
+ }

/* Do not allow text selection in secure textfields */
if (tPtr->flags.secure) {
@@ -1438,17 +1456,35 @@ static void handleTextFieldActionEvents(XEvent * event, void *data)
if (tPtr->flags.enabled && !tPtr->flags.focused) {
WMSetFocusToWidget(tPtr);
}
+ if (textWidth < tPtr->usableWidth) {
+ tPtr->cursorPosition = pointToCursorPosition(tPtr,
+ event->xbutton.x - tPtr->usableWidth
+ + textWidth);
+ } else
+ tPtr->cursorPosition = pointToCursorPosition(tPtr, event->xbutton.x);
+
if (tPtr->flags.focused) {
tPtr->selection.position = tPtr->cursorPosition;
tPtr->selection.count = 0;
}
+ paintTextField(tPtr);
+ break;
+
+ case WACenter:
+ textWidth = WMWidthOfString(tPtr->font, tPtr->text, tPtr->textLen);
+ if (tPtr->flags.enabled && !tPtr->flags.focused) {
+ WMSetFocusToWidget(tPtr);
+ }
if (textWidth < tPtr->usableWidth) {
tPtr->cursorPosition = pointToCursorPosition(tPtr,
- event->xbutton.x - tPtr->usableWidth
- + textWidth);
- } else
+ event->xbutton.x - (tPtr->usableWidth - textWidth) / 2);
+ } else {
tPtr->cursorPosition = pointToCursorPosition(tPtr, event->xbutton.x);
-
+ }
+ if (tPtr->flags.focused) {
+ tPtr->selection.position = tPtr->cursorPosition;
+ tPtr->selection.count = 0;
+ }
paintTextField(tPtr);
break;

@@ -1462,29 +1498,31 @@ static void handleTextFieldActionEvents(XEvent * event, void *data)
tPtr->selection.count = 0;
paintTextField(tPtr);
}
- if (event->xbutton.button == Button2 && tPtr->flags.enabled) {
- char *text;
- int n;
-
- if (!WMRequestSelection(tPtr->view, XA_PRIMARY, XA_STRING,
- event->xbutton.time, pasteText, NULL)) {
- text = XFetchBuffer(tPtr->view->screen->display, &n, 0);
-
- if (text) {
- text[n] = 0;
- WMInsertTextFieldText(tPtr, text, tPtr->cursorPosition);
- XFree(text);
- NOTIFY(tPtr, didChange, WMTextDidChangeNotification,
- (void *)WMInsertTextEvent);
- }
- } else {
- tPtr->flags.waitingSelection = 1;
- }
- }
break;
default:
break;
}
+
+ if (event->xbutton.button == Button2 && tPtr->flags.enabled) {
+ char *text;
+ int n;
+
+ if (!WMRequestSelection(tPtr->view, XA_PRIMARY, XA_STRING,
+ event->xbutton.time, pasteText, NULL)) {
+ text = XFetchBuffer(tPtr->view->screen->display, &n, 0);
+
+ if (text) {
+ text[n] = 0;
+ WMInsertTextFieldText(tPtr, text, tPtr->cursorPosition);
+ XFree(text);
+ NOTIFY(tPtr, didChange, WMTextDidChangeNotification,
+ (void *)WMInsertTextEvent);
+ }
+ } else {
+ tPtr->flags.waitingSelection = 1;
+ }
+ }
+
break;

case ButtonRelease:

commit b09ac302339e28c6d0ec7dc2e405f3f0c8b56d54
Author: David Maciejak <david.m...@gmail.com>
Date: Sun, 25 Jan 2026 14:02:34 -0500
URL: <https://repo.or.cz/wmaker-crm.git/b09ac302339e28c6>

WINGs: add case to wtextfield test

This patch adds a wtextfield center aligned to the unit test.
---
WINGs/Tests/wtest.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/WINGs/Tests/wtest.c b/WINGs/Tests/wtest.c
index ea6228223c9b..f74d4f81de00 100644
--- a/WINGs/Tests/wtest.c
+++ b/WINGs/Tests/wtest.c
@@ -521,7 +521,7 @@ void testSlider(WMScreen * scr)
void testTextField(WMScreen * scr)
{
WMWindow *win;
- WMTextField *field, *field2;
+ WMTextField *field, *field2, *field3;

windowCount++;

@@ -540,6 +540,11 @@ void testTextField(WMScreen * scr)
WMMoveWidget(field2, 20, 50);
WMSetTextFieldAlignment(field2, WARight);

+ field3 = WMCreateTextField(win);
+ WMResizeWidget(field3, 200, 20);
+ WMMoveWidget(field3, 20, 80);
+ WMSetTextFieldAlignment(field3, WACenter);
+
WMRealizeWidget(win);
WMMapSubwidgets(win);
WMMapWidget(win);

commit 6e14b6142b6f701ca314da8795a6e5ddd7db18df
Author: David Maciejak <david.m...@gmail.com>
Date: Mon, 26 Jan 2026 15:13:42 -0500
URL: <https://repo.or.cz/wmaker-crm.git/6e14b6142b6f701c>

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.
---
src/wmspec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/wmspec.c b/src/wmspec.c
index fe313410821c..1fa01aa729a3 100644
--- a/src/wmspec.c
+++ b/src/wmspec.c
@@ -364,7 +364,7 @@ static void setSupportedHints(WScreen *scr)
32, PropModeReplace, (unsigned char *)&scr->info_window, 1);

/* set _NET_WM_NAME on supporting window */
- snprintf(wm_name, sizeof(wm_name), "Window Maker %s", VERSION);
+ snprintf(wm_name, sizeof(wm_name), "WindowMaker %s", VERSION);
XChangeProperty(dpy, scr->info_window, net_wm_name, utf8_string, 8,
PropModeReplace, (unsigned char *)wm_name, strlen(wm_name));


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

Summary of changes:
WINGs/Tests/wtest.c | 7 +++-
WINGs/wtextfield.c | 90 ++++++++++++++++++++++++++++++-------------
src/wmspec.c | 2 +-
wrlib/alpha_combine.c | 76 ++++++++++++++++++------------------
wrlib/context.c | 2 +-
wrlib/scale.c | 27 +++++++++++--
wrlib/wraster.h.in | 3 +-
7 files changed, 136 insertions(+), 71 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