vkkhrdisplay: Fix output selection

While this platform plugin does not have full multi-screen support,
it at least has the ability to choose the one to use via env.vars.

This currently does not work. What's more, it looks like it chooses
the last display by default, instead of the first.

Fix the display/display-mode logic. This now allows QT_VK_DISPLAY_INDEX
to work correctly, for example on a RPi4 with two screens connected.

Fixes: QTBUG-117416
Change-Id: Ia5ac8fde5827b3a2e1945e8e4f04fb8dd90704e2
Pick-to: 6.6 6.5
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Reviewed-by: Kristoffer Skau <kristoffer.skau@qt.io>
This commit is contained in:
Laszlo Agocs 2023-09-21 10:34:40 +02:00
parent 9cad3fcc97
commit 66be69139c

View File

@ -143,7 +143,7 @@ bool QVkKhrDisplayVulkanInstance::chooseDisplay()
j, (void *) mode.displayMode,
mode.parameters.visibleRegion.width, mode.parameters.visibleRegion.height,
mode.parameters.refreshRate);
if (j == wantedModeIndex) {
if (j == wantedModeIndex && i == wantedDisplayIndex) {
m_displayMode = mode.displayMode;
m_width = mode.parameters.visibleRegion.width;
m_height = mode.parameters.visibleRegion.height;