Re: [dwm] snapping bugs with multiple screens

From: Anselm R. Garbe <>
Date: Mon, 5 May 2008 11:19:11 +0200

On Sat, May 03, 2008 at 10:35:22PM -0400, John Li wrote:
> I'm not sure if this qualifies as a bug, but I think it's
> unexpected/non-optimal behavior.
> Example setup:
> Laptop screen at 1024x768 with a separate LCD at 1280x1024 positioned on
> the left of the laptop. Here's a geom for that:
> /* geometries, s{x,y,w,h} and bh are already initualized [sic] here */
> /* name bx by bw wx wy ww wh mx my mw mh tx ty tw th mox moy mow moh */
> DEFGEOM(desklap, 0, 0, 1280, 0, bh, sw, sh-bh, 0, bh, 1280, wh, 1280, 0, 1024, 768, 0, bh, mw, wh)
> I have the bar and master area confined to the first 1280 horizontal
> pixels: the separate LCD. The master area is 1280x(1024-bh) while the
> tile area is 1024x768. There are two unexpected behaviors related to
> snapping in the tile area:
> 1) Snapping at the top doesn't snap to the top of the tile area, y=0; it
> snaps to y=bh.
> 2) Snapping at the bottom doesn't snap to y=768; it snaps to y=1024.
> Since I've defined ty=0 and th=768, this seems incorrect. I don't know C
> very well, but it seems like dwm looks at only at the w? vars (and not
> the m? or t? vars) to determine when to snap. Changing those would
> result in wrong snapping behavior on either the master or tile areas,
> though.
> Another possible, vaguely related bug: there is no snapping on the
> master/tile split (also the physical divide between the monitors).
> Perhaps if mw is a constant, or doesn't include "mfact", there could
> also be snapping here?
> I know dwm isn't particularly concerned with heavy use of floating
> windows, but I find them necessary at times (especially with higher
> resolution, multiple monitor setups) so it'd be nice to see snapping
> work in these situations.

I can confirm your observation and it took quite a while that
someone reported it. I expected it much earlier ;)

The snap-algorithm uses wx, wy, ww, and wh as screen dimension
boundaries. There is no support for multiple screens in the snap
algorithm, so it is only intended to work correctly in a single
screen setup or at least at wx and ww in multi screen setups.

As a workaround I propose to disable snapping in multihead
setups through setting it to 0.

Proper snap-support would make dwm dependend from XrandR or
Xinerama and I don't want to do that (or alternatively of yet
another complex geometrie setup at compile time).

I see some potential to make SNAP a variable however, which
could be set in DEFGEOMs for this reason.

Kind regards,

 Anselm R. Garbe >< >< GPG key: 0D73F361
Received on Mon May 05 2008 - 11:19:11 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:36:54 UTC