Skip to content

Commit

Permalink
Fall back to Xlib if XRandR isn't available
Browse files Browse the repository at this point in the history
This fixes video initialization on headless systems with VNC

Fixes #8054

(cherry picked from commit 7109914)
  • Loading branch information
slouken committed Jul 31, 2023
1 parent 82cd3bf commit 8825fbf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/video/x11/SDL_x11modes.c
Original file line number Diff line number Diff line change
Expand Up @@ -643,8 +643,9 @@ int X11_InitModes(_THIS)
int xrandr_major, xrandr_minor;
/* require at least XRandR v1.3 */
if (CheckXRandR(data->display, &xrandr_major, &xrandr_minor) &&
(xrandr_major >= 2 || (xrandr_major == 1 && xrandr_minor >= 3))) {
return X11_InitModes_XRandR(_this);
(xrandr_major >= 2 || (xrandr_major == 1 && xrandr_minor >= 3)) &&
X11_InitModes_XRandR(_this) == 0) {
return 0;
}
}
#endif /* SDL_VIDEO_DRIVER_X11_XRANDR */
Expand Down

0 comments on commit 8825fbf

Please sign in to comment.