Skip to content

Use workspace idx/name and output to restore windows instead of workspace id#2

Open
fmuehlis wants to merge 1 commit intoMTeaHead:mainfrom
fmuehlis:main
Open

Use workspace idx/name and output to restore windows instead of workspace id#2
fmuehlis wants to merge 1 commit intoMTeaHead:mainfrom
fmuehlis:main

Conversation

@fmuehlis
Copy link
Copy Markdown

Hi! I really like the idea of this project and I have been using it for a few weeks now. However, I noticed that windows will not always be spawned on the correct workspace, but seemingly on random workspaces. I've read through the code and saw that windows currently get restored by workspace id. Sadly workspace IDs are not really consistent and the same workspace index on the same output can have different IDs when created and deleted multiple times.
So I propose this solution to recreate windows per monitor and workspace. The current solution prefers the workspace name over the workspace index on a given monitor because it is possible for named workspaces to have different indices too (e.g. there can be workspace 1 before a named workspace shifting the index of each workspace). To get the MoveWindowToMonitor functionality I had to bump the niri-ipc dependency version.

This is only supposed to be a draft and a proof of concept, as I would like to hear your thoughts on it hence the two TODOs in the code. If this is something you would be interested in I will refine this PR and test it more thoroughly.

…t` to restore windows to the correct monitor and workspace
@MTeaHead MTeaHead self-requested a review August 4, 2025 21:40
@MTeaHead MTeaHead self-assigned this Aug 4, 2025
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

Successfully merging this pull request may close these issues.

2 participants