Skip to content

tabs persist after layout switch #635

@ixzh

Description

@ixzh

Problem Description

I have a combined layout with tabbed as a sub-layout, and use PerWorkspace to have BSP on WS2. (see myLayout below)

When I rename WS 1 to 2, the layout changes to BSP as expected, but the the tabs persist (instead of disappearing). In effect, it appears on every workspace.

Steps to Reproduce

  1. myStartupHook have 7 terminal and 1 FF browser launched in a combined layout on WS1.
  2. rename WS 1 to 2.
  3. Layout changes to BSP, but the tabs persist on WS1, and every other workspaces.
  4. rename WS 2 back to 1, the layout changes back to the combined one, and tabs appear only on WS 1 (as expected)

Configuration File

import System.IO
import System.Exit

import XMonad hiding ( (|||) )

import XMonad.Layout.LayoutCombinators hiding ( (|||) )
import XMonad.Layout.Renamed
import XMonad.Layout.PerWorkspace
import XMonad.Layout.ShowWName

-- Theme for showWName which prints current workspace when you change workspaces.
myShowWNameTheme :: SWNConfig
myShowWNameTheme = def
    { 
    swn_font                = "xft:JetBrainsMono Nerd Font Mono:style=bold:size=36"
    , swn_fade              = 0.5
    , swn_bgcolor           = "#1c1f24"
    , swn_color             = "#ffffff"
    }

myStartupHook = do
    startupHook myBaseConfig
    spawnNOnOnce 7 "1" "alacritty"
    spawnOnOnce "1" "firefox"
    adjustEventInput 

myBaseConfig = desktopConfig

myLayout = 
           showWName' myShowWNameTheme .
           onWorkspaces ["2","3"] myBSP $
           myDefaultLayout
    where
           myDefaultLayout = tmsCombineTwo True 1 (3/100) (1/3) layout1 layout2
           layout1 = tall   
           layout2 = tmsCombineTwo False 3 (3/100) (1/2) layout3 layout4
           layout3 =
               mySpiral 
           layout4 =
               tab
           mySpiral     =   renamed [Replace "spiral"] $ 
                            spiral (6/7)
           tab          =   renamed [Replace "tab"] $ tabbed shrinkText tabConfig

tabConfig = def {
    fontName = "xft:Sarasa UI SC:10"
    , activeColor         = "#46d9ff"
    , inactiveColor       = "#313846"
    , activeBorderColor   = "#46d9ff"
    , inactiveBorderColor = "#282c34"
    , activeTextColor     = "#282c34"
    , inactiveTextColor   = "#d0d0d0"
}

myWorkspaces = ["1","2","3","4","5","6","7","8","9","10"]
              
myKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $ [
   ((modMask .|. shiftMask, xK_r), renameWorkspace myXPConfig)
  ]
 
main :: IO ()
main = do
    xmonad $
            myBaseConfig {
                startupHook = myStartupHook 
, layoutHook = myLayout
, workspaces = myWorkspaces
, keys = myKeys
} 

Checklist

  • I've read CONTRIBUTING.md

  • I tested my configuration

    • With xmonad version 0.17.0
    • With xmonad-contrib version 0.17.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions