From 839061a25a87877d741abf68699095b40c5f86a6 Mon Sep 17 00:00:00 2001 From: David Maciejak Date: Sat, 7 Feb 2026 08:41:57 -0500 Subject: [PATCH] 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 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 */