The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

c/direct: Fix direct display RandR leased output on multi-X-Screen.

The old code assumes the HMD is always connected to a RandR
output on X-Screen 0, but this is not neccessarily the case
on multi-X-Screen setups. Use a loop to iterate over all
X-Screens outputs until the HMD output is found.

Tested on single and dual X-Screen setups, also with Oculus
Rift CV1 connected to 2nd X-Screen.

This is rather useful for porting applications from "OpenHMD Rift
on separate X-Screen for performance" to OpenXR Monado direct
mode, so one can quickly switch between Monado and OpenHMD native
without cumbersome xorg.conf + logout + login games.

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>

authored by

Mario Kleiner and committed by
Jakob Bornecrantz
a6185490 f4075362

+5 -3
+5 -3
src/xrt/compositor/main/comp_window_direct_randr.c
··· 190 190 191 191 xcb_screen_iterator_t iter = xcb_setup_roots_iterator(xcb_get_setup(connection)); 192 192 193 - w_direct->screen = iter.data; 194 - 195 - comp_window_direct_randr_get_outputs(w_direct); 193 + while (iter.rem > 0 && w_direct->num_displays == 0) { 194 + w_direct->screen = iter.data; 195 + comp_window_direct_randr_get_outputs(w_direct); 196 + xcb_screen_next(&iter); 197 + } 196 198 197 199 if (w_direct->num_displays == 0) { 198 200 COMP_ERROR(ct->c, "No non-desktop output available.");