Grid layout eats other layouts

Using xmonad 0.7 and KDE 3.5 with the xmonad.hs from http://haskell.org/haskellwiki/Xmonad/Using_xmonad_in_KDE I want to add Grid to the default list of layouts. When I do: 3a4
import XMonad.Layout.Grid 10c11 < , layoutHook = avoidStruts $ layoutHook defaultConfig
, layoutHook = avoidStruts $ layoutHook defaultConfig ||| Grid
I only get Tall and Grid. The last two layouts from defaultConfig - Mirror Tall and Full - disappear, seemingly "eaten" by Grid. If I specify the entire layout list manually: 3a4
import XMonad.Layout.Grid 10c11,12 < , layoutHook = avoidStruts $ layoutHook defaultConfig
, layoutHook = avoidStruts $ let t = Tall 1 (3/100) (1/2) in t ||| Mirror t ||| Full ||| Grid
I get all four layouts as expected. Any ideas why? Thanks, Yitz

* Yitzchak Gale
Using xmonad 0.7 and KDE 3.5 with the xmonad.hs from http://haskell.org/haskellwiki/Xmonad/Using_xmonad_in_KDE
I want to add Grid to the default list of layouts. When I do:
3a4
import XMonad.Layout.Grid 10c11 < , layoutHook = avoidStruts $ layoutHook defaultConfig
, layoutHook = avoidStruts $ layoutHook defaultConfig ||| Grid
I only get Tall and Grid. The last two layouts from defaultConfig - Mirror Tall and Full - disappear, seemingly "eaten" by Grid.
If I specify the entire layout list manually:
3a4
import XMonad.Layout.Grid 10c11,12 < , layoutHook = avoidStruts $ layoutHook defaultConfig
, layoutHook = avoidStruts $ let t = Tall 1 (3/100) (1/2) in t ||| Mirror t ||| Full ||| Grid
I get all four layouts as expected.
Any ideas why?
Thanks, Yitz
It's because code which works with Choose data type expects the tree to grow to the left. If you write layoutHook = avoidStruts $ Grid ||| layoutHook defaultConfig it will work. This is undocumented (afaik) and should be considered as a bug. By the way, NewSelect combinator from LayoutCombinators does not have this issue, so one more reason to merge it to the core. -- Roman I. Cheplyaka (aka Feuerbach @ IRC)

I wrote:
I want to add Grid to the default list of layouts. When I do: ,layoutHook = avoidStruts $ layoutHook defaultConfig ||| Grid I only get Tall and Grid. The last two layouts from defaultConfig - Mirror Tall and Full - disappear, seemingly "eaten" by Grid... Any ideas why?
Roman Cheplyaka
It's because code which works with Choose data type expects the tree to grow to the left. If you write ,layoutHook = avoidStruts $ Grid ||| layoutHook defaultConfig it will work.
But that would put Grid as the first layout instead of the last. That is not what I want.
This is undocumented (afaik) and should be considered as a bug. By the way, NewSelect combinator from LayoutCombinators does not have this issue, so one more reason to merge it to the core.
Thanks, Yitz

* Yitzchak Gale
I wrote:
I want to add Grid to the default list of layouts. When I do: ,layoutHook = avoidStruts $ layoutHook defaultConfig ||| Grid I only get Tall and Grid. The last two layouts from defaultConfig - Mirror Tall and Full - disappear, seemingly "eaten" by Grid... Any ideas why?
Roman Cheplyaka
wrote: It's because code which works with Choose data type expects the tree to grow to the left. If you write ,layoutHook = avoidStruts $ Grid ||| layoutHook defaultConfig it will work.
But that would put Grid as the first layout instead of the last. That is not what I want.
Right. It's not a solution, I'm just illustrating the problem (your question was "why", not "what to do"). Now your options are: - compose needed layouts explicitely (again, layouts like (a|||b)|||c won't work), or - use NewSelect combinator from XMonad.Layout.LayoutCombinators. -- Roman I. Cheplyaka :: http://ro-che.info/ ...being in love is totally punk rock...

Roman Cheplyaka
Right. It's not a solution, I'm just illustrating the problem (your question was "why", not "what to do").
Yep, not a hard problem to solve in this case. I was just supporting your position that it would be nice if this weird behavior could be improved in some way, e.g., merging NewSelect into the core :) Thanks again, Yitz

* Roman Cheplyaka
* Yitzchak Gale
[2008-04-27 18:54:03+0300] I wrote:
I want to add Grid to the default list of layouts. When I do: ,layoutHook = avoidStruts $ layoutHook defaultConfig ||| Grid I only get Tall and Grid. The last two layouts from defaultConfig - Mirror Tall and Full - disappear, seemingly "eaten" by Grid... Any ideas why?
Roman Cheplyaka
wrote: It's because code which works with Choose data type expects the tree to grow to the left. If you write ,layoutHook = avoidStruts $ Grid ||| layoutHook defaultConfig it will work.
But that would put Grid as the first layout instead of the last. That is not what I want.
Right. It's not a solution, I'm just illustrating the problem (your question was "why", not "what to do").
Now your options are: - compose needed layouts explicitely (again, layouts like (a|||b)|||c won't work), or - use NewSelect combinator from XMonad.Layout.LayoutCombinators.
BTW, I'm not sure about the last. Since your "layoutHook defaultConfig" will use the old combinator, they may not play nicely. Then, just write down layouts explicitely. -- Roman I. Cheplyaka (aka Feuerbach @ IRC)

roma:
* Yitzchak Gale
[2008-04-27 17:45:57+0300] Using xmonad 0.7 and KDE 3.5 with the xmonad.hs from http://haskell.org/haskellwiki/Xmonad/Using_xmonad_in_KDE
I want to add Grid to the default list of layouts. When I do:
3a4
import XMonad.Layout.Grid 10c11 < , layoutHook = avoidStruts $ layoutHook defaultConfig
, layoutHook = avoidStruts $ layoutHook defaultConfig ||| Grid
I only get Tall and Grid. The last two layouts from defaultConfig - Mirror Tall and Full - disappear, seemingly "eaten" by Grid.
If I specify the entire layout list manually:
3a4
import XMonad.Layout.Grid 10c11,12 < , layoutHook = avoidStruts $ layoutHook defaultConfig
, layoutHook = avoidStruts $ let t = Tall 1 (3/100) (1/2) in t ||| Mirror t ||| Full ||| Grid
I get all four layouts as expected.
Any ideas why?
Thanks, Yitz
It's because code which works with Choose data type expects the tree to grow to the left. If you write layoutHook = avoidStruts $ Grid ||| layoutHook defaultConfig it will work. This is undocumented (afaik) and should be considered as a bug. By the way, NewSelect combinator from LayoutCombinators does not have this issue, so one more reason to merge it to the core.
Ah, sounds like we should get a ticket for this. Can you open that up? -- Don
participants (3)
-
Don Stewart
-
Roman Cheplyaka
-
Yitzchak Gale