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

mode hide not working since 0.10.4 #3473

Closed
7ff04da4aa6ac37197e249299066ac30 opened this issue Jul 24, 2024 · 12 comments
Closed

mode hide not working since 0.10.4 #3473

7ff04da4aa6ac37197e249299066ac30 opened this issue Jul 24, 2024 · 12 comments

Comments

@7ff04da4aa6ac37197e249299066ac30

On Arch Linux, swaywm, my sway config states the following:

bar {
	swaybar_command waybar | tee -a /tmp/waybar.log & disown"
	mode hide
	modifier $mod
	hidden_state hide
}

This used to work flawlessly until the last update. Since then, whenever I (re)start sway, the bar starts up hidden and comes to the top layer whenever I press the mod key. Then, it stays there, on top, forever, contrary to how the hide mode should work. Is this just me?

@khaneliman
Copy link
Contributor

Have you tried waybar-git to see if it's related to the SIGUSR1 / setVisible bug that was fixed?

@7ff04da4aa6ac37197e249299066ac30
Copy link
Author

@khaneliman Just tried waybar-git and no, the problem persists. My fix, for now, is using mode dock

@7ff04da4aa6ac37197e249299066ac30
Copy link
Author

Also, I should add that I tried the same configuration as in the first comment, only substituting the swaybar_command with swaybar proper, and it works as it should. So this should serve, imo, as further confirmation that this issue is related to waybar, not with sway.

@alebastr
Copy link
Contributor

Can you show your waybar config and the output of WAYLAND_DEBUG=client waybar with #3528 applied?

@7ff04da4aa6ac37197e249299066ac30
Copy link
Author

7ff04da4aa6ac37197e249299066ac30 commented Aug 20, 2024

@alebastr uh, okay, this will sound dumb, but, with your comment, I was inspired to read my configuration file over and ended up solving my issue myself. It doesn't even require your pull request, but, in any case, thanks for helping and being proactive about this, you're positively great.

In case anyone else stumbles into this, this is what fixed this issue for me: my configuration previously started with the following:

// -*- mode: json -*-

{
	"modes": {
		"dock": {
			"layer": "top"
		},
		// show overlay bar over fullscreen applications
		"overlay": {
			"layer": "overlay"
		},
		// hide bar under the current window instead of making it invisible
		"invisible": {
			"passthrough": false,
			"visible": true,
		},
		"hide": {
			"layer": "top",
		}
},

The relevant sections here are "invisible" and "hide". Unbeknownst to me, sway switches between modes hide and invisible (or so it appears, it's still unclear to me) when setting mode hide; it is invisible when the relevant modifier key is not pressed, and hide when it is. In my case, I suspect that it acquired the property of being on the top layer after the first press of the mod key because the mode hide specifies this, and did not lose this property when letting go of the key because mode invisibile does not specify a layer. So, what ended up solving this for me was simply adding a line to mode invisibile stating the desired layer to be the bottom one, as follows:

…
"invisible": {
			"passthrough": false,
			"visible": true,
			"layer": "bottom",
		},
…

Also, note that I use the "visible" property for mode invisible so that the bar appears when no windows are open and the modifier key is not pressed.

In any case, I will close this issue because it is now solved for me.

@alebastr
Copy link
Contributor

alebastr commented Aug 20, 2024 via email

@7ff04da4aa6ac37197e249299066ac30
Copy link
Author

Well, that is weird. Either in your version or in the one distributed in Arch Linux, changing the configuration is what did it for me

@khaneliman
Copy link
Contributor

Well, that is weird. Either in your version or in the one distributed in Arch Linux, changing the configuration is what did it for me

He's saying your addition of "layer":"bottom" shouldn't be required but is in 0.10.4. If you use that PR branch, you shouldn't have to change your config. this is how I interpreted the discussion and PR

@7ff04da4aa6ac37197e249299066ac30
Copy link
Author

7ff04da4aa6ac37197e249299066ac30 commented Aug 20, 2024

Well, that is weird. Either in your version or in the one distributed in Arch Linux, changing the configuration is what did it for me

He's saying your addition of "layer":"bottom" shouldn't be required but is in 0.10.4. If you use that PR branch, you shouldn't have to change your config. this is how I interpreted the discussion and PR

Yes, that's how I interpretd things thus far too. I meant that changing my configuration file was required either on his branch or in 0.10.4, even though that wasn't supposed to be the case with the PR. I could've done something wrong somewhere, though, and will probably check this again later today. In any case, do you believe I should reopen the issue? The problem is still there ("layer":"bottom" is still not implicit in mode invisible), but it can be solved by only tinkering with the configuration file.

@khaneliman
Copy link
Contributor

Well, that is weird. Either in your version or in the one distributed in Arch Linux, changing the configuration is what did it for me

He's saying your addition of "layer":"bottom" shouldn't be required but is in 0.10.4. If you use that PR branch, you shouldn't have to change your config. this is how I interpreted the discussion and PR

Yes, that's how I interpretd things thus far too. I meant that changing my configuration file was required either on his branch or in 0.10.4, even though that wasn't supposed to be the case with the PR. I could've done something wrong somewhere, though, and will probably check this again later today. In any case, do you believe I should reopen the issue? The problem is still there ("layer":"bottom" is still not implicit in mode invisible), but it can be solved by only tinkering with the configuration file.

Oh, I see, I misread your response. Sorry, about that.

@evakkuri
Copy link

Hi! I'm also facing this issue with waybar 0.10.4, but I can't figure out where I'm supposed to configure the sway-bar modes as explained by OP @7ff04da4aa6ac37197e249299066ac30. Would someone be able to help?

@VlctM
Copy link

VlctM commented Sep 12, 2024

Hi! I'm also facing this issue with waybar 0.10.4, but I can't figure out where I'm supposed to configure the sway-bar modes as explained by OP @7ff04da4aa6ac37197e249299066ac30. Would someone be able to help?

~/.config/waybar/config

    "modes": {
		"dock": {
			"layer": "top"
		},
		// show overlay bar over fullscreen applications
		"overlay": {
			"layer": "overlay"
		},
		// hide bar under the current window instead of making it invisible
		"invisible": {
			"passthrough": false,
			"visible": true,
			"layer": bottom
		},
		"hide": {
			"layer": "top"
		}
    },
    "ipc": true,
    "position": "bottom",
    [...]

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

No branches or pull requests

5 participants