fix: more stable output arrangement for identical external displays#1988
fix: more stable output arrangement for identical external displays#1988hojjatabdollahi wants to merge 2 commits intopop-os:masterfrom
Conversation
|
I have been using this for the past few days and it has fixed the annoying random assignment of outputs to monitors after each sleep, or every time I connect my USB C dock. This saves the config the way @Drakulix mentioned a while back: #1575 (comment). And is fairly human readable. If this approach is satisfactory I can update other packages that need to be updated to use this format too. |
58bb7f5 to
3ef448b
Compare
|
I noticed that cosmic-greeter have to update to avoid ruining the outputs.ron file. I did that last week and I've had a very nice experience since then. I moved the logic for matching the outputs to their config to cosmic-comp-config to avoid duplicating the logic. The last commit needs some clean up. But I'll do that if you guys are onboard with this approach. This has fixed the most annoying issue I've had with COSMIC since last year that I got these external monitors. |
3ef448b to
a6ec098
Compare
3953081 to
6724d1f
Compare
|
I clean up this PR. It's two small commits now, a lot more readable. The code in 6724d1f is mostly coming from cosmic-greeter. It's ready for review. |
ea0aa20 to
e8fab0d
Compare
bcb78bc to
7495692
Compare
garrettjwilke
left a comment
There was a problem hiding this comment.
the new outputs.ron file correctly distinguishes between similar displays.
This code is moved from cosmic-greeter to avoid needing to duplicate the matching logic in multiple places
7495692 to
6a01219
Compare
Monitors connected to an external USB C dock may get assigned different connectors (DP-5, DP-6...) on every reconnection or when the OS sleeps depending on the order the kernel sees them. This causes the outputs to rearrange often. This commit removes the connector as a part of the hash key for the outputs if and only if all outputs are unique (when their EDID is considered). This way no matter where the monitor is connected or if the USB C dock randomly assigns a different connector to it, the arrangements of the outputs stays the same.
If the external monitors have identical EDID info, then their connector is taken into account as a fallback, similar to what exists in cosmic-comp now.
The
outputs.ronnow looks like this:As opposed to something like this:
I've marked this as a draft since I guess we need to update cosmic-greeter and cosmic-randr because cosmic-greeter also reads outputs.ron and applies it using cosmic-randr. But I'm not sure if that's true and would like your input.More importantly I'm interested to know what the team thinks of this approach? To me it makes sense since workspaces are assigned using this exact data structure. And in case you have completely identical monitors, then it just revert back to using the connector id as we do now. So, no regressions.