When there are two monitors and they are mirrored, both of them are considered primary. When the first primary monitor happens to be a clone, EnumDisplayMonitors() ends up not reporting any monitors because should_enumerate_monitor() returns FALSE and we break out the loop to enumerate primary monitors after that.
This is a regression from b59619d and my review comments. My indent was to break out of the loop after finding the *master* primary monitor, not cloned primary monitors, to avoid unnecessary iterations. However, the primary monitor count is small and it's cleaner this way so let's break when should_enumerate_monitor() returns TRUE.