Issues latest dev branch - getMainDisplay()

Yeah but it can be simplified a bit as when we exit the outer loop, the first display in the list should always be the main. I think it’d be safe to just fallback to adding this at line 3497:

if (! displays.isEmpty() && ! displays.getReference(0).isMain)
    displays.getReference(0).isMain = true;

Yeah, that works. I added that assertion in case the code above was changed later, but currently it can never be false. (at least I don’t think it can be false, but the code is a bit hairy, which is another reason I wanted to add an assertion here, to make the code easier to understand)