feat(display): Fix and implement display auto-switching with JSON profile storage#2275
feat(display): Fix and implement display auto-switching with JSON profile storage#2275DK0280705 wants to merge 2 commits intoAvengeMedia:masterfrom
Conversation
…sabled. Co-authored-by: Copilot <copilot@github.com>
|
Have you tested this on niri? With hot plugging displays. The reason it was temp disabled mainly was because of that, there would be crashes or display freezes on resume I think from some race between niri and dms writing display configurations. |
Yes, actually i only used niri to test automatic display configuration, so i don't know if this going to work on hyprland or dwl/mango too. I'm using this configuration for a while and there are no problems so far. Probably only when i suddenly unplug my external monitor from my laptop, some electron apps like vscode or discord freeze then crash, but that's not from the dms side as they also crash when i test with kanshi. I don't think the problem comes from the race between niri and dms(?) |
The display auto-configuration feature was previously broken and explicitly disabled throughout the codebase — the UI toggle was hidden, the IPC toggleAuto command returned a hardcoded error, and the feature never ran at startup. This PR fixes all of that and delivers a fully working auto-switching system backed by a new compositor-neutral JSON profile format.
Changes:
.conf, Niri.kdl, DWL.conf) are generated from this JSON at apply time, unifying profile logic across compositors.DisplayConfigStateis force-initialized at shell startup (DMSShell.qml) so auto-config runs on login.toggleAutofixed. Previously returned a hardcoded error, now properly togglesSettingsData.displayProfileAutoSelect, persists it, and callsautoSelectProfile().statusfixed. It was hardcoded to report auto: "off"; now reflects the real setting.SettingsData.displayProfileAutoSelectand triggeringapplyAutoConfig()on enable.getProfileMonitorInclusion().canDisableOutput()to prevent disabling the last active monitor.