Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tabs persist after layout switch #635

Open
3 tasks done
ixzh opened this issue Oct 28, 2021 · 3 comments
Open
3 tasks done

tabs persist after layout switch #635

ixzh opened this issue Oct 28, 2021 · 3 comments

Comments

@ixzh
Copy link

ixzh commented Oct 28, 2021

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
@ixzh
Copy link
Author

ixzh commented Oct 28, 2021

After rename WS 1 to 2, tabs persist behind the BSP layout:

WS 2
WS 2

WS 8
WS 8 tabs persist on every other workspaces

rename WS 2 back to 1, back to normal, and tabs disappear from other workspaces:
WS 1
WS 1

@slotThe
Copy link
Member

slotThe commented Oct 28, 2021

I guess tabbed doesn't clean up after itself—sounds like one of the reasons we now broadcast ReleaseResources, right? Admittedly, I haven't looked into all of this too deeply but perhaps @liskin knows more

@liskin
Copy link
Member

liskin commented Oct 28, 2021

It's not tabbed not cleaning up after itself, it's PerWorkspace not telling it to clean up when it switches to the other layout. It's a known issue (#75) affecting several layouts. I guess I might want to prioritize #582 after all and deal with these issues at the same time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants