Issue 414 in xmonad: Wrong floating window sizes on multimon setup

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Issue 414 in xmonad: Wrong floating window sizes on multimon setup

codesite-noreply@google.com
Status: New
Owner: ----

New issue 414 by einars: Wrong floating window sizes on multimon setup
http://code.google.com/p/xmonad/issues/detail?id=414

I have a dual monitor setup using twinview, left is 1280x1024, right -  
1920x1200.

The windows that should be floating in some exact sizes appear correctly on  
4:3 screen, but have a bad size on the right, 16:10 monitor, having weird  
borders around.

To reproduce, I can open, e.g winecfg on the one or other monitor; see the  
attached image for its appearance.

Running the latest darcs version of xmonad and xmonad-contrib, can  
reproduce with minimal xmonad.hs, the problem doesn't appear when running  
single monitor.



Attachments:
        1920x1200.png  12.1 KB

Reply | Threaded
Open this post in threaded view
|

Re: Issue 414 in xmonad: Wrong floating window sizes on multimon setup

codesite-noreply@google.com

Comment #1 on issue 414 by einars: Wrong floating window sizes on multimon  
setup
http://code.google.com/p/xmonad/issues/detail?id=414

Unfloating and then floating the window again sets its size back properly,  
so the bug happens only when the window is first created.

Reply | Threaded
Open this post in threaded view
|

Re: Issue 414 in xmonad: Wrong floating window sizes on multimon setup

codesite-noreply@google.com

Comment #2 on issue 414 by FelixBlanke: Wrong floating window sizes on  
multimon setup
http://code.google.com/p/xmonad/issues/detail?id=414

Doesn't happens for me with winecfg and a 3 monitor setup (1x 16:10, 2x 4:3)

But I have the same problem with opera when I install it with gtk. Does  
winecfg use gtk? Then it would be a generic problem with gtk and xmonad :/

Reply | Threaded
Open this post in threaded view
|

Re: Issue 414 in xmonad: Wrong floating window sizes on multimon setup

codesite-noreply@google.com

Comment #3 on issue 414 by einars: Wrong floating window sizes on multimon  
setup
http://code.google.com/p/xmonad/issues/detail?id=414

It happens with gcolor2 (gtk), and the same thing happens with the windows  
created by OCaml graphics library (it creates windows by calling X  
directly, without toolkits), but I haven't seen the issues with KDE  
applications, though I don't know any similar adequate applications.
The afterwards-created floating dialog windows (various preference windows,  
help-abouts etc I just tried looking at) seem to be correct both in KDE and  
GTK applications.

Reply | Threaded
Open this post in threaded view
|

Re: Issue 414 in xmonad: Wrong floating window sizes on multimon setup

codesite-noreply@google.com

Comment #4 on issue 414 by liskni.si: Wrong floating window sizes on  
multimon setup
http://code.google.com/p/xmonad/issues/detail?id=414

I think the problem is that xmonad internally represents window dimensions  
as fractions of screen size, and these are computed from the initial window  
position and size. So, if an application creates a new window at (0,0) and  
then asks the window manager to position it, xmonad computes the size as a  
fraction relative to the screen containing (0,0) and then places the window  
on whatever screen is currently active. If the size of this screen is  
different, so is the size of the placed window.

Reply | Threaded
Open this post in threaded view
|

Re: Issue 414 in xmonad: Wrong floating window sizes on multimon setup

codesite-noreply@google.com

Comment #5 on issue 414 by FelixBlanke: Wrong floating window sizes on  
multimon setup
http://code.google.com/p/xmonad/issues/detail?id=414

Yeah that could be possible.

At my problem xmonad sometimes creates a windows which is width > 5000px.  
My total screen size is 4960x1600.
The problem (at me) typ. only occurs with the width, not the height.

Reply | Threaded
Open this post in threaded view
|

Issue 414 in xmonad: Wrong floating window sizes on multimon setup

codesite-noreply@google.com

Comment #6 on issue 414 by ezy... at mit.edu: Wrong floating window sizes on  
multimon setup
https://code.google.com/p/xmonad/issues/detail?id=414

This chunk of code in XMonad.Operations is the buggy code:

-- ---------------------------------------------------------------------
-- |
-- Window manager operations
-- manage. Add a new window to be managed in the current workspace.
-- Bring it into focus.
--
-- Whether the window is already managed, or not, it is mapped, has its
-- border set, and its event mask set.
--
manage :: Window -> X ()
manage w = whenX (not <$> isClient w) $ withDisplay $ \d -> do
     sh <- io $ getWMNormalHints d w

     let isFixedSize = sh_min_size sh /= Nothing && sh_min_size sh ==  
sh_max_size sh
     isTransient <- isJust <$> io (getTransientForHint d w)

     rr <- snd `fmap` floatLocation w
     -- ensure that float windows don't go over the edge of the screen
     let adjust (W.RationalRect x y wid h) | x + wid > 1 || y + h > 1 || x <  
0 || y < 0
                                               = W.RationalRect (0.5 -  
wid/2) (0.5 - h/2) wid h
         adjust r = r

         f ws | isFixedSize || isTransient = W.float w (adjust rr) .  
W.insertUp w . W.view i $ ws
              | otherwise                  = W.insertUp w ws
             where i = W.tag $ W.workspace $ W.current ws

     mh <- asks (manageHook . config)
     g <- appEndo <$> userCodeDef (Endo id) (runQuery mh w)
     windows (g . f)

Notice the floatLocation query throws out the recommended screen for the  
float to be placed on.

I don't actually know what the right version of this code is.

--
You received this message because this project is configured to send all  
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings