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 839061a25a87877d741abf68699095b40c5f86a6 (commit)
via 1e63c590b61b1ab51de711dec8d8e463f6c9c0e7 (commit)
from 92e1e9fb0b1935c8330847fc493d1811b236c59c (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 839061a25a87877d741abf68699095b40c5f86a6
Author: David Maciejak <
david.m...@gmail.com>
Date: Sat, 7 Feb 2026 08:41:57 -0500
URL: <
https://repo.or.cz/wmaker-crm.git/839061a25a87877d>
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
---
src/client.c | 14 ++++++++++++++
src/window.c | 9 +++++++++
2 files changed, 23 insertions(+)
diff --git a/src/client.c b/src/client.c
index 2271f254b793..361566fab5fe 100644
--- a/src/client.c
+++ b/src/client.c
@@ -245,6 +245,20 @@ void wClientConfigure(WWindow * wwin, XConfigureRequestEvent * xcre)
wwin->flags.maximized &= ~(MAX_VERTICAL | MAX_LEFTHALF | MAX_RIGHTHALF | MAX_MAXIMUS | MAX_CENTRAL);
wWindowConstrainSize(wwin, (unsigned int *)&nwidth, (unsigned int *)&nheight);
+
+ /* Ignore tiny position adjustments from client ConfigureRequests to prevent
+ * window jitters (e.g., VirtualBox sending incremental 1-2px corrections). */
+ if (wwin->flags.mapped && !wwin->moveresize.active && (xcre->value_mask & (CWX | CWY))) {
+ int dx = abs(nx - wwin->frame_x);
+ int dy = abs(ny - wwin->frame_y);
+
+ if (dx < 3 && dy < 3) {
+ /* Keep current position */
+ nx = wwin->frame_x;
+ ny = wwin->frame_y;
+ }
+ }
+
wWindowConfigure(wwin, nx, ny, nwidth, nheight);
wwin->old_geometry.x = nx;
wwin->old_geometry.y = ny;
diff --git a/src/window.c b/src/window.c
index 25170951e2a1..8a14a03427a6 100644
--- a/src/window.c
+++ b/src/window.c
@@ -681,6 +681,15 @@ WWindow *wManageWindow(WScreen *scr, Window window)
return NULL;
}
+ /* Some applications create placeholder windows with 1x1 size
+ * (e.g. VirtualBox internal windows). Don't manage those initial
+ * 1x1 windows — wait for a proper ConfigureNotify/MapRequest with
+ * a real size. */
+ if (wattribs.width <= 1 && wattribs.height <= 1) {
+ XUngrabServer(dpy);
+ return NULL;
+ }
+
wm_state = PropGetWindowState(window);
/* if it's startup and the window is unmapped, don't manage it */
commit 1e63c590b61b1ab51de711dec8d8e463f6c9c0e7
Author: David Maciejak <
david.m...@gmail.com>
Date: Tue, 3 Feb 2026 18:36:55 -0500
URL: <
https://repo.or.cz/wmaker-crm.git/1e63c590b61b1ab5>
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.
---
src/misc.c | 38 +++++++++++++++++++++++++++++++++
src/misc.h | 2 ++
src/session.c | 55 ++++++------------------------------------------
src/wdefaults.c | 39 +++-------------------------------
src/window.c | 20 +++---------------
src/winspector.c | 29 +------------------------
6 files changed, 53 insertions(+), 130 deletions(-)
diff --git a/src/misc.c b/src/misc.c
index 4c920520ad61..007f71c9b678 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -124,6 +124,44 @@ Bool wGetIconName(Display *dpy, Window win, char **iconname)
return False;
}
+int WMStrEqual(const char *x, const char *y)
+{
+ if ((x == NULL) && (y == NULL))
+ return 1;
+
+ if ((x == NULL) || (y == NULL))
+ return 0;
+
+ return (strcmp(x, y) == 0);
+}
+
+int WMPLGetBool(WMPropList *value)
+{
+ char *val;
+
+ if (!WMIsPLString(value))
+ return 0;
+
+ val = WMGetFromPLString(value);
+ if (val == NULL)
+ return 0;
+
+ if ((val[1] == '\0' &&
+ (val[0] == 'y' || val[0] == 'Y' || val[0] == 'T' ||
+ val[0] == 't' || val[0] == '1')) ||
+ (strcasecmp(val, "YES") == 0 || strcasecmp(val, "TRUE") == 0)) {
+ return 1;
+ } else if ((val[1] == '\0' &&
+ (val[0] == 'n' || val[0] == 'N' || val[0] == 'F' ||
+ val[0] == 'f' || val[0] == '0')) ||
+ (strcasecmp(val, "NO") == 0 || strcasecmp(val, "FALSE") == 0)) {
+ return 0;
+ } else {
+ wwarning(_("can't convert \"%s\" to boolean"), val);
+ return 0;
+ }
+}
+
static void eatExpose(void)
{
XEvent event, foo;
diff --git a/src/misc.h b/src/misc.h
index dbfc18734f2b..5fc15a8f5d96 100644
--- a/src/misc.h
+++ b/src/misc.h
@@ -54,4 +54,6 @@ char *GetShortcutKey(WShortKey key);
char *EscapeWM_CLASS(const char *name, const char *class);
char *StrConcatDot(const char *a, const char *b);
char *GetCommandForWindow(Window win);
+int WMStrEqual(const char *x, const char *y);
+int WMPLGetBool(WMPropList *value);
#endif
diff --git a/src/session.c b/src/session.c
index 50c9ec8d1a6d..af7901bcf26a 100644
--- a/src/session.c
+++ b/src/session.c
@@ -123,35 +123,6 @@ static void make_keys(void)
sNo = WMCreatePLString("No");
}
-static int getBool(WMPropList * value)
-{
- char *val;
-
- if (!WMIsPLString(value)) {
- return 0;
- }
- val = WMGetFromPLString(value);
- if (val == NULL)
- return 0;
-
- if ((val[1] == '\0' && (val[0] == 'y' || val[0] == 'Y'))
- || strcasecmp(val, "YES") == 0) {
-
- return 1;
- } else if ((val[1] == '\0' && (val[0] == 'n' || val[0] == 'N'))
- || strcasecmp(val, "NO") == 0) {
- return 0;
- } else {
- int i;
- if (sscanf(val, "%i", &i) == 1) {
- return (i != 0);
- } else {
- wwarning(_("can't convert \"%s\" to boolean"), val);
- return 0;
- }
- }
-}
-
static unsigned getInt(WMPropList * value)
{
char *val;
@@ -423,11 +394,11 @@ static WSavedState *getWindowState(WScreen * scr, WMPropList * win_state)
value = WMGetFromPLDictionary(win_state, sShaded);
if (value != NULL)
- state->shaded = getBool(value);
+ state->shaded = WMPLGetBool(value);
value = WMGetFromPLDictionary(win_state, sMiniaturized);
if (value != NULL)
- state->miniaturized = getBool(value);
+ state->miniaturized = WMPLGetBool(value);
value = WMGetFromPLDictionary(win_state, sMaximized);
if (value != NULL) {
@@ -436,7 +407,7 @@ static WSavedState *getWindowState(WScreen * scr, WMPropList * win_state)
value = WMGetFromPLDictionary(win_state, sHidden);
if (value != NULL)
- state->hidden = getBool(value);
+ state->hidden = WMPLGetBool(value);
value = WMGetFromPLDictionary(win_state, sShortcutMask);
if (value != NULL) {
@@ -456,20 +427,6 @@ static WSavedState *getWindowState(WScreen * scr, WMPropList * win_state)
return state;
}
-static inline int is_same(const char *x, const char *y)
-{
- if ((x == NULL) && (y == NULL))
- return 1;
-
- if ((x == NULL) || (y == NULL))
- return 0;
-
- if (strcmp(x, y) == 0)
- return 1;
- else
- return 0;
-}
-
void wSessionRestoreState(WScreen *scr)
{
WSavedState *state;
@@ -556,9 +513,9 @@ void wSessionRestoreState(WScreen *scr)
if (dock != NULL) {
for (j = 0; j < dock->max_icons; j++) {
btn = dock->icon_array[j];
- if (btn && is_same(instance, btn->wm_instance) &&
- is_same(class, btn->wm_class) &&
- is_same(command, btn->command) &&
+ if (btn && WMStrEqual(instance, btn->wm_instance) &&
+ WMStrEqual(class, btn->wm_class) &&
+ WMStrEqual(command, btn->command) &&
!btn->launching) {
found = 1;
break;
diff --git a/src/wdefaults.c b/src/wdefaults.c
index 7aad3db5d926..9a3e92c0da62 100644
--- a/src/wdefaults.c
+++ b/src/wdefaults.c
@@ -43,14 +43,13 @@
#include "icon.h"
#include "misc.h"
-#define APPLY_VAL(value, flag, attrib) \
- if (value) {attr->flag = getBool(attrib, value); \
- if (mask) mask->flag = 1;}
+#define APPLY_VAL(value, flag, attrib) \
+ if (value) {attr->flag = WMPLGetBool(value); \
+ if (mask) mask->flag = 1;}
/* Local stuff */
/* type converters */
-static int getBool(WMPropList *, WMPropList *);
static char *getString(WMPropList *, WMPropList *);
static WMPropList *ANoTitlebar = NULL;
static WMPropList *ANoResizebar;
@@ -634,38 +633,6 @@ void wDefaultPurgeInfo(const char *instance, const char *class)
WMPLSetCaseSensitive(False);
}
-/* --------------------------- Local ----------------------- */
-
-static int getBool(WMPropList * key, WMPropList * value)
-{
- char *val;
-
- if (!WMIsPLString(value)) {
- wwarning(_("Wrong option format for key \"%s\". Should be %s."),
- WMGetFromPLString(key), "Boolean");
- return 0;
- }
- val = WMGetFromPLString(value);
-
- if ((val[1] == '\0' && (val[0] == 'y' || val[0] == 'Y' || val[0] == 'T' || val[0] == 't' || val[0] == '1'))
- || (strcasecmp(val, "YES") == 0 || strcasecmp(val, "TRUE") == 0)) {
-
- return 1;
- } else if ((val[1] == '\0'
- && (val[0] == 'n' || val[0] == 'N' || val[0] == 'F' || val[0] == 'f' || val[0] == '0'))
- || (strcasecmp(val, "NO") == 0 || strcasecmp(val, "FALSE") == 0)) {
-
- return 0;
- } else {
- wwarning(_("can't convert \"%s\" to boolean"), val);
- /* We return False if we can't convert to BOOLEAN.
- * This is because all options defaults to False.
- * -1 is not checked and thus is interpreted as True,
- * which is not good.*/
- return 0;
- }
-}
-
/* WARNING: Do not free the value returned by this function!! */
static char *getString(WMPropList * key, WMPropList * value)
{
diff --git a/src/window.c b/src/window.c
index 1f16f4583b5d..25170951e2a1 100644
--- a/src/window.c
+++ b/src/window.c
@@ -2726,20 +2726,6 @@ WMagicNumber wWindowAddSavedState(const char *instance, const char *class,
return wstate;
}
-static inline int is_same(const char *x, const char *y)
-{
- if ((x == NULL) && (y == NULL))
- return 1;
-
- if ((x == NULL) || (y == NULL))
- return 0;
-
- if (strcmp(x, y) == 0)
- return 1;
- else
- return 0;
-}
-
WMagicNumber wWindowGetSavedState(Window win)
{
char *instance, *class, *command = NULL;
@@ -2754,9 +2740,9 @@ WMagicNumber wWindowGetSavedState(Window win)
if (PropGetWMClass(win, &class, &instance)) {
while (wstate) {
- if (is_same(instance, wstate->instance) &&
- is_same(class, wstate->class) &&
- is_same(command, wstate->command)) {
+ if (WMStrEqual(instance, wstate->instance) &&
+ WMStrEqual(class, wstate->class) &&
+ WMStrEqual(command, wstate->command)) {
break;
}
wstate = wstate->next;
diff --git a/src/winspector.c b/src/winspector.c
index e0d0f6e8262f..af338bd97d95 100644
--- a/src/winspector.c
+++ b/src/winspector.c
@@ -504,33 +504,6 @@ static int showIconFor(WMScreen *scrPtr, InspectorPanel *panel, const char *wm_i
return 0;
}
-static int getBool(WMPropList *value)
-{
- char *val;
-
- if (!WMIsPLString(value))
- return 0;
-
- val = WMGetFromPLString(value);
- if (val == NULL)
- return 0;
-
- if ((val[1] == '\0' &&
- (val[0] == 'y' || val[0] == 'Y' || val[0] == 'T' ||
- val[0] == 't' || val[0] == '1')) ||
- (strcasecmp(val, "YES") == 0 || strcasecmp(val, "TRUE") == 0)) {
- return 1;
- } else if ((val[1] == '\0' &&
- (val[0] == 'n' || val[0] == 'N' || val[0] == 'F' ||
- val[0] == 'f' || val[0] == '0')) ||
- (strcasecmp(val, "NO") == 0 || strcasecmp(val, "FALSE") == 0)) {
- return 0;
- } else {
- wwarning(_("can't convert \"%s\" to boolean"), val);
- return 0;
- }
-}
-
/* Will insert the attribute = value; pair in window's list,
* if it's different from the defaults.
* Defaults means either defaults database, or attributes saved
@@ -554,7 +527,7 @@ insertAttribute(WMPropList *dict, WMPropList *window, WMPropList *attr, WMPropLi
def_value = ((flags & IS_BOOLEAN) != 0) ? No : EmptyString;
if (flags & IS_BOOLEAN)
- update = (getBool(value) != getBool(def_value));
+ update = (WMPLGetBool(value) != WMPLGetBool(def_value));
else
update = !WMIsPropListEqualTo(value, def_value);
-----------------------------------------------------------------------
Summary of changes:
src/client.c | 14 ++++++++++++
src/misc.c | 38 +++++++++++++++++++++++++++++++++
src/misc.h | 2 ++
src/session.c | 55 ++++++------------------------------------------
src/wdefaults.c | 39 +++-------------------------------
src/window.c | 29 +++++++++++--------------
src/winspector.c | 29 +------------------------
7 files changed, 76 insertions(+), 130 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")