Fix RandR 1.5 check: use RANDR_PREF_MINOR_VERSION (#918)

XCB_RANDR_MAJOR_VERSION/XCB_RANDR_MINOR_VERSION are the maximum supported (in code) version.

Before this commit, the check verified that your libxcb did not support a newer RandR version than your running server.
After this commit, the check verifies the server’s RandR version is at least 1.5.
This commit is contained in:
Michael Stapelberg 2019-02-21 16:03:34 +01:00 committed by Dave Davenport
parent 335adc30b3
commit 6bbbd08941
1 changed files with 2 additions and 2 deletions

View File

@ -362,8 +362,8 @@ static void x11_build_monitor_layout ()
if ( rversion ) {
g_debug ( "Found randr version: %d.%d", rversion->major_version, rversion->minor_version );
// Check if we are 1.5 and up.
if ( ( ( rversion->major_version == XCB_RANDR_MAJOR_VERSION ) && ( rversion->minor_version >= XCB_RANDR_MINOR_VERSION ) ) ||
( rversion->major_version > XCB_RANDR_MAJOR_VERSION ) ) {
if ( ( ( rversion->major_version == RANDR_PREF_MAJOR_VERSION ) && ( rversion->minor_version >= RANDR_PREF_MINOR_VERSION ) ) ||
( rversion->major_version > RANDR_PREF_MAJOR_VERSION ) ) {
xcb_randr_get_monitors_cookie_t t = xcb_randr_get_monitors ( xcb->connection, xcb->screen->root, 1 );
xcb_randr_get_monitors_reply_t *mreply = xcb_randr_get_monitors_reply ( xcb->connection, t, NULL );
if ( mreply ) {