-
Notifications
You must be signed in to change notification settings - Fork 3k
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
w32_common: implement support for --screen-name #11543
base: master
Are you sure you want to change the base?
Conversation
Since the EDID friendly monitor name can already be obtained, when it exists should also be applied to the property of |
Just to confirm I'm understanding correctly, your suggestion is to also expose the EDID display names in the |
|
||
// Allocate the path and mode arrays | ||
paths = realloc(paths, pathCount * sizeof(DISPLAYCONFIG_PATH_INFO)); | ||
modes = realloc(modes, modeCount * sizeof(DISPLAYCONFIG_MODE_INFO)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should use talloc here instead.
Please don't duplicate code, look at https://github.com/mpv-player/mpv/blob/01c5346d1ada7185710963628012a5c3dcf1ce74/video/out/win32/displayconfig.c You can use existing functions and add new ones there if needed. |
This PR implements Win32 support for
--screen-name
and--fs-screen-name
. Detection is based on the EDID friendly monitor name that also shows up in advanced display settings control panel.Implementation is done through the Display Devices API. This does not directly give us an
HMONITOR
handle, so instead we query the GDI device name in the form of\\.\DISPLAY1
. Once the GDI device name has been found we can useEnumDisplayMonitors
andGetMonitorInfoW
to find the matchingHMONITOR
.Parts of the implementation are based on example code found in the documentation.