rocksdanister / lively

Free and open-source software that allows users to set animated desktop wallpapers and screensavers powered by WinUI 3.
https://rocksdanister.com/lively
GNU General Public License v3.0
14.49k stars 1.03k forks source link

Display Number Wrong #2114

Closed sksisme closed 3 months ago

sksisme commented 5 months ago

Describe the bug The display number provided in the Lively Wallpaper app doesn't match the display number as assigned by Windows

To Reproduce Steps to reproduce the behavior:

  1. Open System+Display and click Identify to see the officially assigned numbers for each display
  2. Open Lively Wallpaper app
  3. Click the Choose Display Icon
  4. Compare the numbers provided in the app in comparison to the numbers assigned by windows
  5. In my app vs windows scenario Screen 3 as assigned by windows is showing up as Screen 4 in the Lively app

Expected behavior I would expect the numbers to match

Screenshots/Video Attached LivelyWallPaperDisplayNumberIssue

Desktop (please complete the following information):

Additional context None

Log file (Important) Share the diagnostic files by: lively_log_20240207_110636.zip

rocksdanister commented 5 months ago

The display number is subject to change and it's not fixed. Internally Lively is using DeviceId to identify display which is tied to display hardware, for example: DISPLAY#BNQ802E#5&18b48f67&1&UID4357#{e6f07b5f-ee..

but its not pretty to look at so the number is used instead (which is provided by Windows but it is subject to change.)

I am planning an improvement for the display selector UI to make it visually represent the display arrangement.

sksisme commented 5 months ago

Now it makes sense. Thank you for the response and for the future adjustment. In the meantime a good old fashioned post-it with the mapping will suffice now that I understand what’s happening. Looking forward to the update!

rocksdanister commented 3 months ago

New display selection control:

https://github.com/rocksdanister/lively/assets/17554161/8dad3ce4-4141-447d-abe0-4bc5f92b9e5e

Tried to recreate your 6 display setup:

image

Leaving the 6 display configuration test code for future reference:

public static List<DisplayMonitor> CreateDisplayMonitors()
{
    List<DisplayMonitor> displayMonitors = new List<DisplayMonitor>();

    // Display monitor 5: Positioned vertically on the left
    displayMonitors.Add(new DisplayMonitor
    {
        Bounds = new Rectangle(0, 960, 1080, 1920),
        DeviceId = "DISPLAY5",
        DeviceName = "Display 5",
        DisplayName = "Display 5",
        Index = 5,
        IsPrimary = false,
        WorkingArea = new Rectangle(0, 0, 1080, 1920)
    });

    // Display monitor 6: Positioned horizontally to the right of (5)
    displayMonitors.Add(new DisplayMonitor
    {
        Bounds = new Rectangle(1080, 960, 1920, 1080),
        DeviceId = "DISPLAY6",
        DeviceName = "Display 6",
        DisplayName = "Display 6",
        Index = 6,
        IsPrimary = false,
        WorkingArea = new Rectangle(1080, 960, 1920, 1080)
    });

    // Display monitor 3: Positioned horizontally to the right of (6)
    displayMonitors.Add(new DisplayMonitor
    {
        Bounds = new Rectangle(3000, 960, 1920, 1080),
        DeviceId = "DISPLAY3",
        DeviceName = "Display 3",
        DisplayName = "Display 3",
        Index = 3,
        IsPrimary = false,
        WorkingArea = new Rectangle(3000, 960, 1920, 1080)
    });

    // Display monitor 2: Positioned below (3)
    displayMonitors.Add(new DisplayMonitor
    {
        Bounds = new Rectangle(3000, 2040, 1920, 1080),
        DeviceId = "DISPLAY2",
        DeviceName = "Display 2",
        DisplayName = "Display 2",
        Index = 2,
        IsPrimary = false,
        WorkingArea = new Rectangle(3000, 2040, 1920, 1080)
    });

    // Display monitor 1: Positioned horizontally to the right of (2)
    displayMonitors.Add(new DisplayMonitor
    {
        Bounds = new Rectangle(4920, 2040, 1920, 1080),
        DeviceId = "DISPLAY1",
        DeviceName = "Display 1",
        DisplayName = "Display 1",
        Index = 1,
        IsPrimary = false,
        WorkingArea = new Rectangle(4920, 2040, 1920, 1080)
    });

    // Display monitor 4: Positioned below (2) and to the right
    displayMonitors.Add(new DisplayMonitor
    {
        Bounds = new Rectangle(3960, 3120, 960, 540),
        DeviceId = "DISPLAY4",
        DeviceName = "Display 4",
        DisplayName = "Display 4",
        Index = 4,
        IsPrimary = false,
        WorkingArea = new Rectangle(4920, 3120, 960, 540)
    });

    return displayMonitors;
}