Remember Layout based on Monitor
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 116
- PR merge metrics
- No merged PRs in 30d
Description
### Status Quo - The Good
Tilingshell currently remembers which layout I selected for each virtual desktop (workspace), and this even persists across restarts — which is great. It lets me use different layouts on each virtual desktop and also maintain separate layouts for each monitor when multiple displays are connected.
### Problem - The bad
When I connect or disconnect external monitors, the selected layouts on each screen tend to get shuffled around. This becomes especially noticeable when GNOME switches the primary display from one monitor to another. I want the layout configuration to stick to the monitor, even as the monitor IDs or primary monitor changes.
### My Use Case
I use a laptop for work (Fedora Workstation with GNOME). Part of the day I work at my office desk with an ultrawide external monitor connected; the rest of the time I’m on the go, using only the laptop’s built-in screen.
I’ve configured GNOME to treat the **external monitor as the primary display** when it’s connected. When it’s not connected, GNOME falls back to the laptop screen as the primary display. Sometimes I also work with only the external monitor active, completely disabling the laptop screen.
As a result, I regularly switch between three states:
1. Only the laptop screen active — laptop screen is primary
2. Laptop screen + external monitor active — external monitor is primary
3. Only external monitor active — external monitor is primary
On the laptop screen, I typically use a simple layout with two tiles. On the ultrawide monitor, I use layouts with five or more tiles.
**The issue:**
Every time I disconnect the external monitor, the laptop screen switches to the layout previously used on the external monitor. I then have to manually change it back. When I reconnect the external monitor, the layouts get shuffled again, and I need to fix the layout on the external display.
I assume this happens because the primary display changes, and the selected layout follows whichever monitor becomes primary — but I’m not certain.
### Proposal
It seems GNOME reassigns monitor IDs to different physical screens when the primary display changes. To avoid layouts being tied to unstable identifiers, tilingshell should store monitor information using more reliable parameters such as the monitor connector or vendor/model identifiers.
**I propose using a combination of GNOME’s monitor ID *and* the connector ID instead of relying solely on the monitor ID.**
If available, additional parameters like vendor and model IDs could also be incorporated to make the mapping even more stable.
Contributor guide
Assessment
This issue has not been assessed yet.