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) {
|
function findConfigEntryByFingerprint(data, outputIdentifiers, autoOnly) {
|
||||||
const targetKey = outputSetFingerprint(outputIdentifiers);
|
const targetKey = outputSetFingerprint(outputIdentifiers);
|
||||||
const configs = data.configurations || [];
|
const configs = data.configurations || [];
|
||||||
|
let firstUnnamed = null;
|
||||||
for (let i = 0; i < configs.length; i++) {
|
for (let i = 0; i < configs.length; i++) {
|
||||||
if (configFingerprint(configs[i]) === targetKey) {
|
if (configFingerprint(configs[i]) !== targetKey)
|
||||||
if (autoOnly && configs[i].name)
|
continue;
|
||||||
continue;
|
if (configs[i].name && !autoOnly)
|
||||||
return {
|
return {
|
||||||
entry: configs[i],
|
entry: configs[i],
|
||||||
index: i
|
index: i
|
||||||
};
|
};
|
||||||
}
|
if (!configs[i].name && !firstUnnamed)
|
||||||
|
firstUnnamed = {
|
||||||
|
entry: configs[i],
|
||||||
|
index: i
|
||||||
|
};
|
||||||
}
|
}
|
||||||
return null;
|
return firstUnnamed;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getProfileMonitorInclusion(profileId) {
|
function getProfileMonitorInclusion(profileId) {
|
||||||
@@ -766,7 +771,7 @@ Singleton {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
readMonitorsJson(data => {
|
readMonitorsJson(data => {
|
||||||
const match = findConfigEntryByFingerprint(data, currentOutputSet, true);
|
const match = findConfigEntryByFingerprint(data, currentOutputSet, false);
|
||||||
if (match) {
|
if (match) {
|
||||||
if (configEntryMatchesLiveLayout(match.entry)) {
|
if (configEntryMatchesLiveLayout(match.entry)) {
|
||||||
SettingsData.setActiveDisplayProfile(CompositorService.compositor, match.entry.id);
|
SettingsData.setActiveDisplayProfile(CompositorService.compositor, match.entry.id);
|
||||||
|
|||||||
Reference in New Issue
Block a user