Summary: | NEWT MonitorDevice on Windows reports wrong physical size [mm] | ||
---|---|---|---|
Product: | [JogAmp] Newt | Reporter: | Sven Gothel <sgothel> |
Component: | windows | Assignee: | Sven Gothel <sgothel> |
Status: | RESOLVED FIXED | ||
Severity: | major | ||
Priority: | --- | ||
Version: | 2.3.0 | ||
Hardware: | All | ||
OS: | all | ||
Type: | --- | SCM Refs: |
70faf070f50ea66fd4cc8f5f586614810f378787
559ecad2a2387ba0aa34ce9e35ca8a2c5a31e655
aba21ccaebb2acf20690a77f5c0914f12d736755
|
Workaround: | --- |
Description
Sven Gothel
2015-02-09 12:15:12 CET
70faf070f50ea66fd4cc8f5f586614810f378787 NEWT MonitorDevice's physical size on Windows must be read via EDID On Windows, one must read the monitor's EDID data as stored in the registry, no 'simple' API works otherwise. The proper way requires utilizing the Windows Setup-API. This code is inspired by Ofek Shilon's code and blog post: <http://ofekshilon.com/2014/06/19/reading-specific-monitor-dimensions/> See: function 'NewtEDID_GetMonitorSizeFromEDIDByModelName' In contrast to Ofek's code, function 'NewtEDID_GetMonitorSizeFromEDIDByDevice' uses the proper link from DISPLAY_DEVICE.DeviceID -> SP_DEVICE_INTERFACE_DETAIL_DATA.DevicePath, where DISPLAY_DEVICE.DeviceID is the monitor's enumeration via: EnumDisplayDevices(adapterName, monitor_idx, &ddMon, EDD_GET_DEVICE_INTERFACE_NAME); Hence the path to the registry-entry is well determined instead of just comparing the monitor's model name. commit 559ecad2a2387ba0aa34ce9e35ca8a2c5a31e655: NEWT MonitorDevice: - Identify cloned devices (fully covered) - MonitorDevice gets 'isCloned()' to identify whether it is a cloned device, i.e. fully covered by another monitor. This detection may happen natively but will always performed platform agnostic. - getMainMonitor(..) now exclude 'cloned' devices - Windows: Iterate-over and identify all adapter:monitor - Since we also list cloned monitor, we need to iterate over all adapter and all it's monitor-devices. - The native monitor-id is now defined as: ( adapter-idx << 8 ) | monitor-idx. - Bug 1129 <- listed under this bug entry for convenience aba21ccaebb2acf20690a77f5c0914f12d736755 Fix regression of commit 559ecad2a2387ba0aa34ce9e35ca8a2c5a31e655 IDX_MONITOR_DEVICE_VIEWPORT needed to be updated! |