Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DisplayIds from the module don't match the Ids in display settings #7

Open
MartinGC94 opened this issue Sep 16, 2024 · 0 comments
Open
Labels
help wanted Extra attention is needed

Comments

@MartinGC94
Copy link
Owner

MartinGC94 commented Sep 16, 2024

Ideally the display IDs used by this module would mirror the IDs listed in display settings for a consistent user experience. Unfortunately I haven't been able to determine the logic they use to set the IDs so I've had to invent my own logic. The logic simply sorts by display adapter and then gives a custom priority number based on the connector type and connection instance number, prioritizing typical "PC" connection types over others. See: https://github.com/MartinGC94/DisplayConfig/blob/main/src/DisplayConfig/API/DisplayConfig.cs#L152

Methods I've tried:
1: The following registry keys seem promising in providing the data but they are not readable by a standard user so it's not a viable solution:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\GraphicsDrivers\Configuration
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\GraphicsDrivers\Connectivity

2: Sorting by the monitor UIDs listed in the device path like: \?\DISPLAY#LGD06B1#4&8bc03bf&0&UID8388688#{e6f07b5f-ee97-4a90-b076-33f57bf4eaa7} the order was completely out of wack on all my test systems.

3: Simply going in the order of the paths returned by QueryDisplayConfig. Disabled paths are put after the live paths so disabling or enabling a display would make the ID assignments inconsistent. This is obviously bad.

4: The registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\monitor\Enum is readable but the order doesn't always line up with the settings app.

If someone happens to know the logic and can share it here I would be happy to try and implement it in the module. For now though, the custom priority logic I've come up with seems to get reasonably close on most systems.

@MartinGC94 MartinGC94 added the help wanted Extra attention is needed label Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant