You are not logged in.

#1 2009-03-18 09:59:46

ArchArael
Member
Registered: 2005-06-14
Posts: 504

[GIVEN UP]xmonad: How to prevent the resizing of floating clients?

Hi guys,

I was playing with xmonad. I am working on a laptop and at work I have a pretty large external display. My laptop screen is 1280x800 and my external screen is 1920x1200.
On workspace 8 I put my floating clients, skype, sonata ecc. I also use launchy to start new programs.

So what's the problem? When I put my workspace 8 on the big screen the clients display well and I don't have problems. But when I put workspace 8 on laptop screen all my floating clients are resized.
That's pretty annoying. It's worse with launchy. If I start launchy on big screen no problems. If I start it on laptop screen it is resized. What's strange is that if I start it again it is resized again. mad It keeps resizing the damn resized window. So after a while I have just a little small square on the screen.

Does someone know how to fix this thing? Is it possible to configure xmonad and make floating applications re-sizable only by me regardless the screen? hmm

Last edited by ArchArael (2009-04-03 19:14:30)

Offline

#2 2009-03-18 18:17:11

muunleit
Member
From: Germany
Registered: 2008-02-23
Posts: 234

Re: [GIVEN UP]xmonad: How to prevent the resizing of floating clients?

Do you have your own xmonad.hs or do you use the example from the xmonad documentation? => http://haskell.org/haskellwiki/Xmonad/C … _xmonad.hs

The one I linked has an easy to use option to set windows to float and it works on my PC on two screens witout problems.


"The mind can make a heaven out of hell or a hell out of heaven" -- John Milton

Offline

#3 2009-03-18 19:55:32

ArchArael
Member
Registered: 2005-06-14
Posts: 504

Re: [GIVEN UP]xmonad: How to prevent the resizing of floating clients?

The problem is not having floating windows. I have that. The problem is that the floating windows are resized when I switch workspaces on smaller screen.

If I start launchy on smaller screen I see it resized. Then if I press esc and start it again is even smaller. After I have started launchy a bunch of times on the smaller screen it is resized so much that I cannot see it any more. hmm That's really annoying.

I would like to have fixed size for floating windows, regardless screen size. The floating windows should be re-sizable only by me...when I wish it. The window manager shouldn't manage the floating windows size. Is this possibile?

Thank you for the suggestion. I tried with the xmonad.hs on the page you provided but the problem still persists. hmm Maybe you don't notice this strange xmonad's behavior because your screens have similar resolutions.
My laptop is 1280x800 and my external screen is 1920x1200. Well, switching workspaces on laptop screen resizes floating windows. I would like to prevent this. Lurking on web didn't provided any useful information so far. That's why I'm bothering my lovely arch community. wink

This is my xmonad.hs:

import XMonad
import System.Exit


import qualified XMonad.StackSet as W
import qualified Data.Map        as M


main = xmonad $ defaultConfig
    { 
    modMask = mod4Mask
    , borderWidth            = 2
    , terminal                = "terminal"
    , normalBorderColor        = "#cccccc"
    , focusedBorderColor    = "#8bcd00" 
    , manageHook            = myManageHook
    , keys                    = myKeys
    }

myManageHook = composeAll
    [ 
    className =? "MPlayer"                                  --> doFloat
    , className =? "Gimp"                                   --> doFloat
    , className =? "Zenity"                                 --> doFloat
    , className =? "Skype"                                    --> doFloat
    , className =? "Sonata"                                    --> doFloat
    , className =? "Dialog"                                    --> doFloat
    , title =? "Gran Paradiso - Restore Previous Session"   --> doFloat
    , title =? "Close Firefox"                              --> doFloat
    , title =? "Password Required"                             --> doFloat
    , title =? "Downloads"                                    --> doFloat
    ]

------------------------------------------------------------------------
-- Key bindings. Add, modify or remove key bindings here.
--
myKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $
    -- launch a terminal
    [ ((modMask, xK_Return), spawn $ XMonad.terminal conf)
    -- APPLICATION BINDINGS 
    -- launch gmrun
    , ((modMask,               xK_p     ), spawn "gmrun")
    -- XF86StandBy
    , ((0,                  0x1008ff10    ), spawn "sudo pm-suspend")  
    -- XF86AudioLowerVolume
    , ((0,                  0x1008ff11    ), spawn "amixer -q sset Master 5-")  
    -- XF86AudioMute
    , ((0,                  0x1008ff12    ), spawn "amixer -q sset Master mute") 
    -- XF86AudioRaiseVolume
    , ((0,                  0x1008ff13    ), spawn "amixer -q sset Master 5+") 
    -- close focused window 
    , ((modMask .|. shiftMask, xK_c     ), kill)
 
     -- Rotate through the available layout algorithms
    , ((modMask,               xK_space ), sendMessage NextLayout)
 
    --  Reset the layouts on the current workspace to default
    , ((modMask .|. shiftMask, xK_space ), setLayout $ XMonad.layoutHook conf)
 
    -- Resize viewed windows to the correct size
    , ((modMask,               xK_n     ), refresh)
 
    -- Move focus to the next window
    , ((modMask,               xK_Tab   ), windows W.focusDown)
 
    -- Move focus to the next window
    , ((modMask,               xK_j     ), windows W.focusDown)
 
    -- Move focus to the previous window
    , ((modMask,               xK_k     ), windows W.focusUp  )
 
    -- Move focus to the master window
    , ((modMask,               xK_m     ), windows W.focusMaster  )
 
    -- Swap the focused window and the master window
    , ((modMask .|. shiftMask, xK_Return), windows W.swapMaster)
 
    -- Swap the focused window with the next window
    , ((modMask .|. shiftMask, xK_j     ), windows W.swapDown  )
 
    -- Swap the focused window with the previous window
    , ((modMask .|. shiftMask, xK_k     ), windows W.swapUp    )
 
    -- Shrink the master area
    , ((modMask,               xK_h     ), sendMessage Shrink)
 
    -- Expand the master area
    , ((modMask,               xK_l     ), sendMessage Expand)
 
    -- Push window back into tiling
    , ((modMask,               xK_t     ), withFocused $ windows . W.sink)
 
    -- Increment the number of windows in the master area
    , ((modMask              , xK_comma ), sendMessage (IncMasterN 1))
 
    -- Deincrement the number of windows in the master area
    , ((modMask              , xK_period), sendMessage (IncMasterN (-1)))
 
    -- Quit xmonad
    , ((modMask .|. shiftMask, xK_q     ), io (exitWith ExitSuccess))
 
    -- Restart xmonad
    , ((modMask              , xK_q     ),
          broadcastMessage ReleaseResources >> restart "xmonad" True)
    ]
    ++
 
    --
    -- mod-[1..9], Switch to workspace N
    -- mod-shift-[1..9], Move client to workspace N
    --
    [((m .|. modMask, k), windows $ f i)
        | (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9]
        , (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
    ++
 
    --
    -- mod-{w,e,r}, Switch to physical/Xinerama screens 1, 2, or 3
    -- mod-shift-{w,e,r}, Move client to screen 1, 2, or 3
    --
    [((m .|. modMask, key), screenWorkspace sc >>= flip whenJust (windows . f))
        | (key, sc) <- zip [xK_w, xK_e, xK_r] [0..]
        , (f, m) <- [(W.view, 0), (W.shift, shiftMask)]]

Last edited by ArchArael (2009-03-19 09:58:15)

Offline

#4 2009-03-18 22:22:00

muunleit
Member
From: Germany
Registered: 2008-02-23
Posts: 234

Re: [GIVEN UP]xmonad: How to prevent the resizing of floating clients?

Sorry, it was just an idea.


"The mind can make a heaven out of hell or a hell out of heaven" -- John Milton

Offline

#5 2009-03-19 09:58:50

ArchArael
Member
Registered: 2005-06-14
Posts: 504

Re: [GIVEN UP]xmonad: How to prevent the resizing of floating clients?

Thank you again. I appreciated. smile

Offline

#6 2009-04-03 19:12:33

ArchArael
Member
Registered: 2005-06-14
Posts: 504

Re: [GIVEN UP]xmonad: How to prevent the resizing of floating clients?

After I have searched online for a while a solution for this problem I asked to guys of #xmonad irc channel on freenode. I have met a guy that has the same problem I have. He told me that he has written to xmonad's developers explaining this problem but he has never received a response.

I give up on xmonad. In any case it was just a possible tiling window manager candidate for my machine.

Maybe the next release will fix this problem or maybe not.

Last edited by ArchArael (2009-04-04 10:27:35)

Offline

#7 2009-04-04 13:21:24

vogt
Member
From: Toronto, Canada
Registered: 2006-11-25
Posts: 389

Re: [GIVEN UP]xmonad: How to prevent the resizing of floating clients?

XMonad stores the ratios of floating windows as a ratio of the current screen size. This means that they should get resized when shifted to a smaller screen, but they should return to the same size when returned. The behavior you want (you want to have windows that mostly off of the screen?) is certainly possible to implement as an extension, though.

Offline

Board footer

Powered by FluxBB