Skip to content

Commit ece24a8

Browse files
committed
1.7.11
[Bug fixes] -All apps have the same priority; pressing Up crashes the app #57
1 parent 629141c commit ece24a8

File tree

3 files changed

+36
-4
lines changed

3 files changed

+36
-4
lines changed

Source/HDRProfile/AutoHDRDaemon.cs

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,8 @@ private void TrayMenuHelper_CloseApplicationRequested(object sender, EventArgs e
306306
private void LoadSettings()
307307
{
308308
Globals.Instance.LoadSettings();
309-
309+
FixAssignments();
310+
Settings.ApplicationProfileAssignments.Sort(a => a.Position, ListSortDirection.Ascending);
310311
Settings.ApplicationProfileAssignments.CollectionChanged += ApplicationProfileAssigments_CollectionChanged;
311312
Settings.ApplicationProfiles.CollectionChanged += ApplicationProfiles_CollectionChanged;
312313
Settings.Monitors.CollectionChanged += Monitors_CollectionChanged;
@@ -325,6 +326,37 @@ private void LoadSettings()
325326
Globals.Logs.Add("Settings loaded", false);
326327
}
327328

329+
private void FixAssignments()
330+
{
331+
int count = Settings.ApplicationProfileAssignments.Count;
332+
for (int i = 0; i < count; i++)
333+
{
334+
int positionCount = Settings.ApplicationProfileAssignments.Count(a => a.Position == i);
335+
if (positionCount == 0)
336+
{
337+
int u = i;
338+
while (Settings.ApplicationProfileAssignments.Count(a => a.Position == i) == 0)
339+
{
340+
var assignemnt = Settings.ApplicationProfileAssignments.FirstOrDefault(a => a.Position == u);
341+
if (assignemnt != null)
342+
assignemnt.Position = i;
343+
u++;
344+
}
345+
}
346+
if (positionCount > 1)
347+
Settings.ApplicationProfileAssignments.First(a => a.Position == i).Position = i + 1;
348+
}
349+
while (Settings.ApplicationProfileAssignments.Any(a => a.Position >= count))
350+
{
351+
foreach (var assignment in Settings.ApplicationProfileAssignments)
352+
if (assignment.Position >= count)
353+
do
354+
{
355+
assignment.Position = assignment.Position - 1;
356+
} while (Settings.ApplicationProfileAssignments.Count(a => a.Position == assignment.Position) > 1);
357+
}
358+
}
359+
328360

329361
private void TrayMenu_TrayLeftMouseDown(object sender, RoutedEventArgs e)
330362
{

Source/HDRProfile/Displays/DisplayManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ private void UpdateMonitorLoop()
7979
while (!_monitorCancelRequested)
8080
{
8181
bool currentValue = false;
82-
82+
MergeMonitors(GetActiveMonitors());
8383
foreach (Display monitor in Monitors)
8484
{
8585
monitor.UpdateHDRState();

Source/HDRProfile/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,5 @@
5252
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
5353
// indem Sie "*" wie unten gezeigt eingeben:
5454
// [assembly: AssemblyVersion("1.0.*")]
55-
[assembly: AssemblyVersion("1.7.10.0")]
56-
[assembly: AssemblyFileVersion("1.7.10.0")]
55+
[assembly: AssemblyVersion("1.7.11.0")]
56+
[assembly: AssemblyFileVersion("1.7.11.0")]

0 commit comments

Comments
 (0)