Finding current display topology clone/extend if the primary monitor is in a extended mode

Viewed 37

This question has been asked many times but my configuration is a little different. To simply get the display config topology this code works well

But my internal (laptop) display is set to extended mode and other two monitors are set to clone mode, everytime I run this code it returns extended but my requirement is even if one monitor is set to clone I should get clone as output, irrespective of what the internal display is set to.

any pointers would be helpful..

UINT32 ModeArraySize = 0;
DISPLAYCONFIG_PATH_INFO* PathArray;
DISPLAYCONFIG_MODE_INFO* ModeArray;
DISPLAYCONFIG_TOPOLOGY_ID CurrentTopology;

GetDisplayConfigBufferSizes(QDC_ALL_PATHS, &PathArraySize, &ModeArraySize);

PathArray =   (DISPLAYCONFIG_PATH_INFO*)malloc(PathArraySize * sizeof(DISPLAYCONFIG_PATH_INFO));
memset(PathArray, 0, PathArraySize * sizeof(DISPLAYCONFIG_PATH_INFO));

ModeArray =   (DISPLAYCONFIG_MODE_INFO*)malloc(ModeArraySize * sizeof(DISPLAYCONFIG_MODE_INFO));
memset(ModeArray, 0, ModeArraySize * sizeof(DISPLAYCONFIG_MODE_INFO));

LONG ret = QueryDisplayConfig(QDC_DATABASE_CURRENT,&PathArraySize, PathArray, &ModeArraySize, ModeArray, &CurrentTopology);

free(PathArray);
free(ModeArray);```

1 Answers

According to DISPLAYCONFIG_SOURCE_MODE and my test, the cloning source surface position is same as primary source surface position (0,0). However, When in extending mode, the other source surfaces extends surface.
enter image description here enter image description here

Related