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

[tabbed-layout] tab-bar disappearing when switching workspaces (tags) on another monitor #163

Open
ad-on-is opened this issue Mar 31, 2022 · 6 comments

Comments

@ad-on-is
Copy link

ad-on-is commented Mar 31, 2022

I'm encountering a strange behavior with my multi-monitor setup (laptop + 3 external monitors)

Steps to reproduce

  • Switch to tabbed layout on monitor A
  • move focus to monitor B and navigate to another tag (workspace)
  • tab-bar on monitor A just disappears (although the spacing is still present)
  • tab-bar reappears when spawning a new client on monitor A or switching workspaces/tags

EDIT:
After inspecting the code, I modified mstab.lua as follows

-- Change visibility of the tab bar when layout, selected tag or number of clients (visible, master, slave) changes
local function adjust_visiblity( t )
    s.tabbar.visible = true
    -- s.tabbar.visible = (#t:clients() - t.master_count > 1) and (t.layout.name == mylayout.name)
end

Are there any side-effects to this?

@ad-on-is
Copy link
Author

ad-on-is commented Mar 31, 2022

Turned out setting the visibility to true introduced a weird issue... here's what I have so far and it seems to work

local layout = require( "awful.layout" )

local function adjust_visiblity( t )
	local name = layout.getname( layout.get( s ) )
	s.tabbar.visible = (name == mylayout.name)
end

@Nooo37
Copy link
Member

Nooo37 commented Apr 1, 2022

Can't reproduce, I only got one monitor here. Yea I can totally see that mstab doesn't work with multi-monitor given that I didn't really create it with that in mind.

Maybe checking whether the tags screen (the screen of the tag currently being examined in adjust_visibility) is indeed the screen on which we currently are setting the tabbar visibility (screen s) is enough to encompass that usecase?

- s.tabbar.visible = (#t:clients() - t.master_count > 1) and (t.layout.name == mylayout.name)
+ s.tabbar.visible = (t.screen == s) and (#t:clients() - t.master_count > 1) and (t.layout.name == mylayout.name)

@lkschu
Copy link

lkschu commented Apr 21, 2022

Turned out setting the visibility to true introduced a weird issue... here's what I have so far and it seems to work

local layout = require( "awful.layout" )

local function adjust_visiblity( t )
	local name = layout.getname( layout.get( s ) )
	s.tabbar.visible = (name == mylayout.name)
end

I'm using this approach and i haven't encountered a bug yet. @Nooo37 s proposal is not working for me.

@Nooo37
Copy link
Member

Nooo37 commented Apr 21, 2022

Epic, @ad-on-is do you want to PR your fix?

@ad-on-is
Copy link
Author

Epic, @ad-on-is do you want to PR your fix?

The create PR button is disabled for me here, but feel free to do it yourself with the code above.

Btw. it's still running without any issues, even switching to another tag, where tabbed is set as layout, the tabbar changes accordingly.

@Nooo37
Copy link
Member

Nooo37 commented Apr 21, 2022

Huh, the PR button is disabled for you? Is that because of our repo settings or is it on you? Haven't heard of such a thing here before and PRs should be fine from our side. Otherwise I'll patch your fix in there

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