xmonad / xmonad-contrib

Contributed modules for xmonad
https://xmonad.org
BSD 3-Clause "New" or "Revised" License
584 stars 273 forks source link

Is it possible to swap up and down in a sublayout group and between sublayout groups? #179

Open crocket opened 7 years ago

crocket commented 7 years ago

In a sublayout group

I currently have

import qualified XMonad.StackSet as W
import qualified XMonad.Layout.SubLayouts as SL

    , ("M-S-j", SL.onGroup swapDown')
    , ("M-S-k", SL.onGroup swapUp')
    ]
    where swapUp' (W.Stack t (l:ls) rs) = W.Stack t ls (l:rs)
          swapUp' (W.Stack t [] rs) = W.Stack t (reverse rs) []
          swapDown' = reverseStack . swapUp' . reverseStack
          reverseStack (W.Stack t ls rs) = W.Stack t rs ls

I copied swapUp' and swapDown' from https://github.com/xmonad/xmonad/blob/1b17d1c3781f882e8346acd4a3291a5cd632f4be/src/XMonad/StackSet.hs#L348-L364

SL.onGroup swapDown' and SL.onGroup swapUp' don't seem to swap tabs in a sublayout group.

SL.onGroup W.focusUp' and SL.onGroup W.focusDown' work perfectly.

I have the same issue as https://www.reddit.com/r/xmonad/comments/60g643/swap_windows_in_sublayout/

swapUp and swapDown don't just swap inside a sublayout group.

Any idea?

Between sublayout groups

swapDown fails to swap the currently focused master window with a tabbed subgroup that has two windows with its second window in focus.

Although XMonad.Actions.Navigation2D.windowSwap swaps sublayout groups and even cycles, it doesn't work when I want to swap the master window with the second window in a Tall layout with 3 windows.

Thus, I end up having to remember when to use swapDown and windowSwap. This complexity prevents me from moving windows instinctively and requires some thoughts.

I want swap functions aware of sublayout groups.

dongcarl commented 6 years ago

Bump

Mo0dy commented 4 years ago

Bump