[xmonad] Issue 407 in xmonad: Resizing a size-hinted window very small yields bad dimensions

codesite-noreply at google.com codesite-noreply at google.com
Thu Sep 2 20:01:15 EDT 2010


Status: New
Owner: ----

New issue 407 by djpohly: Resizing a size-hinted window very small yields  
bad dimensions
http://code.google.com/p/xmonad/issues/detail?id=407

What steps will reproduce the problem?
1. Set XSizeHints on a window for PResizeInc and PBaseSize.
2. Resize (Mod-right-drag) this window to a size which is smaller than the  
base size.

What is the expected output? What do you see instead?
For certain combinations of base size and resize increment--bs=(4,4) and  
inc=(7,15) is known to work--the window receives an XConfigureEvent with an  
obviously overflown dimension (in the 65535 region) when resized down.

What version of the product are you using? On what operating system?
XMonad-darcs-20100902 on Linux, GHC 6.12.3

Are you using an xmonad.hs?  Please attach it and the output of "xmonad
--recompile".
Don't think this is relevant (see below) but if you want it, ask for it.

Please provide any additional information below.
The problem appears to be line 549 of Operations.hs:
  . maybe id (\(bw,bh) (w,h)   -> (w-bw, h-bh)) (sh_base_size  sh)

In the subtraction in this line, all four operands are ::Dimension, an  
unsigned type.  The problem occurs when XMonad subtracts the base size,  
resulting in large integers, then rounds them down according to the resize  
increment.

If the subtraction were performed on Integrals instead of Dimensions, the  
problem would be fixed.

The attached patch appears to fix the bug.  I'm neither an XMonad nor a  
Haskell expert, so this is likely not the best way to do it, but it can at  
least illuminate where the problem lies. :)

Attachments:
	xmonad-resize.patch  1.4 KB



More information about the xmonad mailing list