1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-08-07 22:18:30 -04:00

fix(displays): auto-select restores named profiles matching the connected output set

fixes #3012
port 1.5

(cherry picked from commit f16bdda969)
This commit is contained in:
bbedward
2026-08-07 18:56:59 -04:00
committed by dms-ci[bot]
parent 170721a1f1
commit acd82589e2
@@ -302,17 +302,22 @@ Singleton {
function findConfigEntryByFingerprint(data, outputIdentifiers, autoOnly) {
const targetKey = outputSetFingerprint(outputIdentifiers);
const configs = data.configurations || [];
let firstUnnamed = null;
for (let i = 0; i < configs.length; i++) {
if (configFingerprint(configs[i]) === targetKey) {
if (autoOnly && configs[i].name)
continue;
if (configFingerprint(configs[i]) !== targetKey)
continue;
if (configs[i].name && !autoOnly)
return {
entry: configs[i],
index: i
};
}
if (!configs[i].name && !firstUnnamed)
firstUnnamed = {
entry: configs[i],
index: i
};
}
return null;
return firstUnnamed;
}
function getProfileMonitorInclusion(profileId) {
@@ -751,7 +756,7 @@ Singleton {
return;
readMonitorsJson(data => {
const match = findConfigEntryByFingerprint(data, currentOutputSet, true);
const match = findConfigEntryByFingerprint(data, currentOutputSet, false);
if (match) {
if (configEntryMatchesLiveLayout(match.entry)) {
SettingsData.setActiveDisplayProfile(CompositorService.compositor, match.entry.id);