We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dd56100 commit e9235deCopy full SHA for e9235de
src/ThemeDialogUtils.cs
@@ -35,7 +35,12 @@ internal class ThemeDialogUtils
35
internal static string[] GetDisplayNames()
36
{
37
// https://github.com/winleafs/Winleafs/blob/98ba3ba/Winleafs.Wpf/Helpers/ScreenBoundsHelper.cs#L36=
38
- var activeDisplays = WindowsDisplayAPI.Display.GetDisplays();
+ var task = Task.Run(() => WindowsDisplayAPI.Display.GetDisplays());
39
+ if (Task.WaitAny(task, Task.Delay(10000)) == 1)
40
+ {
41
+ return [];
42
+ }
43
+ var activeDisplays = task.Result;
44
var activeDisplayDevicePaths = activeDisplays.OrderBy(d => d.DisplayName)
45
.Select(d => d.DevicePath).ToArray();
46
return PathDisplayTarget.GetDisplayTargets()
0 commit comments