mirror of
https://github.com/gryf/wmaker.git
synced 2026-03-19 17:23:33 +01:00
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
This commit is contained in:
committed by
Carlos R. Mafra
parent
1e63c590b6
commit
839061a25a
14
src/client.c
14
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;
|
||||
|
||||
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user