[xmonad] MultiToggle with WorkspaceCursors

ivan ivan.brennan at gmail.com
Fri Mar 24 15:21:36 UTC 2023


Hi, I'm trying to get MultiToggle and WorkspaceCursors to play nicely with
each other.

Ordinarily, MultiToggle lets you apply a layout transformation to the
current workspace without affecting the layouts of other workspaces. E.g.
if I toggle workspace 1 to Full layout, it won't impact the layouts being
used on workspaces 2, 3, etc.

I've started using WorkspaceCursors (XMonad.Actions.WorkspaceCursors) to
manage independent groups of workspaces, and noticed that if I use it's
functions (e.g. modifyLayer) to navigate between workspaces, layout toggle
states seem to bleed across workspaces rather than remaining independent
per workspace.

For example, starting on workspace 1 with my regular Tall layout, I
navigate to workspace 2 and toggle it to Full layout. Then I go back to
workspace 1 and see that it, too, has been toggled to Full layout.

I can't figure out exactly what's causing this, or how to fix it so that
workspace layouts toggle independently. I'm hoping someone here sees what
I'm missing.

I put together a minimal config to reproduce the problem:
https://github.com/ivanbrennan/xmonad-testing/commit/2e9541b0937eee31ae7f300e130dc55a9c5933af#diff-61bfccbc988708bd118b33f9299c64aa8b3e532e25cc8eaa3b716f53215fb196

The config provides two groups (A and B) of nine workspaces.

    group A: 1A 2A 3A 4A 5A 6A 7A 8A 9A
    group B: 1B 2B 3B 4B 5B 6B 7B 8B 9B

Its layoutHook consists of:

    myLayoutHook =
      workspaceCursors cursors
        . avoidStruts
        . mkToggle1 FULL
        $ Tall 1 (3/100) (1/2)

Keys super+1 .. super+9 use WorkspaceCursors functions to switch between
workspaces within the currently active group.

Keys super+ctrl+1 .. super+ctrl+2 use WorkspaceCursors functions to switch
between groups A and B.

Additionally, keys super+meta+1 .. super+meta+9 use traditional StackSet
functions to switch between workspaces 1A .. 9A. I added these for
comparison, showing that MultiToggle state is recognized per-workspace when
using this form of navigation.

I can't figure out the root cause. I suspect the most relevant pieces of
code from WorkspaceCursors and MultiToggle are the following:

https://github.com/xmonad/xmonad-contrib/blob/e60805bd45ca2feb9ef3335d023daae5d02dbf4f/XMonad/Actions/WorkspaceCursors.hs#L204-L215

https://github.com/xmonad/xmonad-contrib/blob/e60805bd45ca2feb9ef3335d023daae5d02dbf4f/XMonad/Layout/MultiToggle.hs#L193-L218

Does anyone know what I might be missing, or how I could debug further to
get to the root of the problem?

Thanks!
Ivan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/xmonad/attachments/20230324/b39e058e/attachment-0001.html>


More information about the xmonad mailing list