[PATCH] wmaker: fix window position issues

5 views
Skip to first unread message

david.m...@gmail.com

unread,
Feb 7, 2026, 8:52:17 AMFeb 7
to Window Maker Development
I think I finally managed to fix those annoying issues with virtualbox, please have a try (I tested with virtualbox 7.2.6).

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 2271f254..361566fa 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 25170951..8a14a034 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 */
--
2.43.0

0001-wmaker-fix-window-position-issues.patch
Reply all
Reply to author
Forward
0 new messages