mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-01-11 14:40:25 +01:00
[FEAT]: Use stable physical monitor identifiers for the multimonitor case #272
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @EBNull on GitHub (Dec 20, 2023).
Hi, I noticed issues like #364, #275, and thought I could add some additional context.
I think your solution in #275 will work most of the time (as I think it relies on GDI's virtual screen coordinates), though if you want to uniquely identify physical monitors, I have some pointers for you.
I was working on a map-virtual-to-physical monitor problem in the past and really found only the
EDIDwas persistent and unique enough to identify monitors. I wrote up my journey at https://gist.github.com/EBNull/d65bacceefc58f5f1d728a66039807d2 .In short, using a combination of
GDI,SetupDi,EDD_GET_DEVICE_INTERFACE_NAME, and a little bit ofEDIDdecoding, you can map these around.This is probably more in-depth than needed (since
komorebiis really exclusively in the "virtual screen" layer of abstraction) since you now remember monitors by virtual position, but I thought you might appreciate the additional context.And thanks for referencing my gist in
e04ba0e033! It was really neat to stumble across this project, read a few commits and issues, and find my old gist helping someone out.@LGUG2Z commented on GitHub (Dec 23, 2023):
Thanks so much for sharing this, and for the gist about programmatically changing focus!
I have started slowly working on assigning EDIDs to monitors in
komorebiif anyone wants to follow along on YouTube: https://www.youtube.com/watch?v=N_IL53wYcXs@EBNull commented on GitHub (Dec 24, 2023):
Thanks for recording! Watching that reminded me of the similar quagmire I found myself in clicking through those docs - I forgot how bad it was.
I added some small notes to the linked commit above.
General thoughts:
SetupDifamily gets you to the right key@EBNull commented on GitHub (Dec 24, 2023):
I started writing more here, but then I figured, eh, have some code. I assume you share the same username on gitlab, so, see https://gitlab.com/ebnull/hudctl/-/blob/master/monman/collectmoninfo_windows.go and https://gitlab.com/ebnull/hudctl/-/blob/master/monman/monitors_windows.go .
@EBNull commented on GitHub (Dec 24, 2023):
Additional pointers (in no specific order):
GetAllDisplayDevices-0d265587d3/sysinfo.go (L70-L92)GetAllDisplayMonitors-0d265587d3/sysinfo.go (L105C6-L119)My own code, "augmented" structures and a combination function:
Usage of the data to get the EDIDs:
EDID stuff:
@gazpachoking commented on GitHub (Feb 8, 2024):
Oh, this seems related to my question here https://github.com/LGUG2Z/komorebi/discussions/657, but I'm not sure if the solution implemented is applicable to my case? Is there a way now I can pin a given monitor workspace to a specific monitor when I change which monitors are plugged in to my laptop?