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

Workspaces sometimes get scrambled after monitor hotplugging #942

Open
Kirottu opened this issue Jan 7, 2025 · 6 comments · May be fixed by #947
Open

Workspaces sometimes get scrambled after monitor hotplugging #942

Kirottu opened this issue Jan 7, 2025 · 6 comments · May be fixed by #947
Labels
bug Something isn't working

Comments

@Kirottu
Copy link

Kirottu commented Jan 7, 2025

I have a very unconventional setup where my desktop is linked to both my desktop monitors (3 of them) and to a TV and I have a script that allows me to switch between them automatically and that works for the most part. The only issue I have noticed after using it for a while is that sometimes Niri seems to "forget" the original placement of named workspaces and dynamic workspaces alike on the desktop side when switching back. So if for example I were to have workspaces "VR" and "Browser" on my leftmost monitor originally, after switching to the TV and back sometimes they can end up on the wrong monitors and/or in the wrong order. Most of the time they are returned to where they are supposed to be but not always, and fixing them up is a bit of a chore.

Currently there is no way to solve this through scripting, as there are no absolute actions to move workspaces (as in something along the lines of move-workspace-to-monitor-by-id where a specific workspace could be moved to a specific monitor or specific place in the workspace stack). Implementing those actions wouldn't be too hard, but I'm not sure if there's some other fix that could be implemented for this issue that's better suited to the purpose.

System Information

  • niri version: 0.1.10
  • Distro: Arch Linux
  • GPU: RX 6700 XT
  • CPU: Ryzen 7 5700X
@Kirottu Kirottu added the bug Something isn't working label Jan 7, 2025
@YaLTeR
Copy link
Owner

YaLTeR commented Jan 7, 2025

Niri will reset the "original output" of a workspace any time you open or move a window to it. Could this be what is happening?

@Kirottu
Copy link
Author

Kirottu commented Jan 7, 2025

After a limited amount of testing the workspaces landing on different monitors seems to be caused by that. Although I'm not sure if the ordering of them is a separate problem or a byproduct of that.

@YaLTeR
Copy link
Owner

YaLTeR commented Jan 7, 2025

Well, it's an intentional design decision. The idea was that after you disconnected a monitor (e.g. left from home to somewhere with a laptop), as you're doing something on your workspaces, you will mix up the windows, so then it would be confusing if upon your return home, a random set of workspaces moved "back" to your external monitor.

I guess that thinking doesn't apply as much to named workspaces.

@Kirottu
Copy link
Author

Kirottu commented Jan 7, 2025

That does make sense for that use case yes. And is definitely a far more prevalent use case than what I have going on. So would you say implementing more scriptability for moving workspaces around through IPC is a better idea for handling this?

@YaLTeR
Copy link
Owner

YaLTeR commented Jan 7, 2025

Adding more missing by-id addressing to the IPC would be nice regardless

@Kirottu
Copy link
Author

Kirottu commented Jan 7, 2025

Alright, I'll start tinkering with that soon enough & make a PR when ready enough for review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants