The current logic requires primary->output to not be specified, or
match the output number. This fails when the output by that number
doesn't currently have a display attached, as non-connected outputs
are skipped. This means setting the display to :0.1 for Qt5 will put
the window on :0.0 and it can't be moved to :0.1 after the fact. The
solution is to pick the first output on the requested screen, then
override if an output exactly matches the primary output value. That
way it will at least be on the requested screen.
Tested with Xephyr, ATI, and nVidia (proprietary driver), where the
nVidia had the primary output disconnected.
Task-number: QTBUG-15418
Change-Id: I7951dcef74cb135dc12a6e133a71c5852eae9778
Reviewed-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>