conformal / spectrwm

A small dynamic tiling window manager for X11.
ISC License
1.34k stars 97 forks source link

Invalid starting position of floating windows #562

Open wavexx opened 9 months ago

wavexx commented 9 months ago

With multiple monitors, windows started from the second region placed with FLOAT+ANYWHERE always land at the edge.

On a3614d12151f44a1d8472bf33a0d5d01c9a07d9c, assuming two regions and the following quirk:

quirk[::] = FLOAT + ANYWHERE

try running:

xev -geometry 100x100+10+10 -name ''

on a region which is not the first. Generally, the window will show to the far left, exactly 1 pixel within the current.

LordReg commented 9 months ago

The -geometry coordinates are relative to root. When positioning a floating window via command line, the actual root coordinates should be specified.

For example, if the spawn region is at +1920+0, then the command in your example should be xev -geometry 100x100+1930+10 -name ''

Also, with the ANYWHERE quirk, if the coordinates put the floating window completely outside of the region, the position is constrained to keep the window in the region (i.e. 1px.). Without the ANYWHERE quirk, WM_SIZE_HINTS is still applied if it is valid (within the region), otherwise the window is auto-centered. So actually, the ANYWHERE quirk isn't necessary for -geometry.

wavexx commented 9 months ago

This clarifies it for me. What I noticed is that several programs that attempt to place windows do so in the wrong workspace, which is then moved at the edge of the current one.

The worst offender I'm noticing is pinentry-gtk.

Many "startup windows" seem to be affected by this. To name a few programs which do this are FreeCAD/libreoffice/prusa-slicer. FreeCAD is qt5. prusa-slicer is gtk3 through wxwindows, and libreoffice does his own thing..