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
This commit is contained in:
@@ -320,17 +320,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) {
|
||||
@@ -766,7 +771,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);
|
||||
|
||||
Reference in New Issue
Block a user