OpenColorIO icon indicating copy to clipboard operation
OpenColorIO copied to clipboard

Improve naming of ICC-based displays on Windows

Open doug-walker opened this issue 4 years ago • 0 comments

The current ICC support provides two methods to instantiate a new display from an ICC profile:

int instantiateDisplayFromMonitorName(const char * monitorName);
int instantiateDisplayFromICCProfile(const char * ICCProfileFilepath);

The argument for the former one comes from the SystemMonitors class which creates a monitorName string for each monitor on the system based on info from the OS (on Mac and Windows). The string has the form: "<Description from ICC profile> [<Display info from OS>]" This was done in order to get something that is informative and unique across displays (keeping in mind that either of the sub-strings could be empty or non-helpful). But it has the potential of being either too long or having spurious info.

Unfortunately the display strings returned from Windows seem to vary a lot and there are cases where the current string does not make a good name for a display (for example, containing garbage characters such as "\\.\").

Here is a real world example (with thanks to Cuneyt!): "UP2716D #1 2021-04-17 21-33 180cdm2 D6500 sRGB F-S XYZLUT+MTX [\\.\DISPLAY1, Dell UP2716D (DP)]"

The application should have the ability to override the string, perhaps even allowing the end-user to name it as desired.

Note that the name should be finalized before the display is created, trying to change the name after it's added would be bad since the display name and display color space name need to stay in sync.

Also, it probably does not make sense to add the feature to the SystemMonitors class since the same functionality is desirable on Linux (where SystemMonitors currently does not work).

The proposal is to add a "displayName" string argument to the above two methods that would give the application control over the name of the created display name. (Or add two new methods if there is a need to preserve API compatibility for a given release.)

In addition, some investigation should be done to see if there is an alternate function that could be used on Windows to obtain the string seen in the Windows display system preferences without any garbage characters such as "\\.\" that are sometimes returned currently.

doug-walker avatar Apr 28 '21 03:04 doug-walker