#151 Xrandr version 1.1 check refresh rate

closed-fixed
nobody
nuisance (37)
1
2011-09-05
2011-08-01
Anonymous
No

Just caught this while browsing the trunk. Not an issue yet, but something to keep in mind.
freeglut_gamemode.c
static int xrandr_resize(int xsz, int ysz, int rate, int just_checking)
58 /* we only heed the rate if we CAN actually use it (Xrandr >= 1.1) and
59 * the user actually cares about it (rate > 0)
60 */
61 use_rate = rate > 0 && ver_major >= 1 && ver_minor >= 1;

Shouldn't this be:

use_rate = rate > 0 && ( ver_major > 1 || (ver_major == 1 && ver_minor >= 1) );

Otherwise version 2.0 (if it gets up that high) will yield false cause minor is not one or greater?

Also for same reason, these conditional compile statements:
#if RANDR_MAJOR >= 1 && RANDR_MINOR >= 1
should be something like:
#if RANDR_MAJOR > 1 || (RANDR_MAJOR == 1 && RANDR_MINOR >= 1)

Discussion

  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous - 2011-08-01
    • priority: 5 --> 1
     
  • John F. Fay

    John F. Fay - 2011-09-05
    • status: open --> closed-fixed
     
  • John F. Fay

    John F. Fay - 2011-09-05

    Fixed in change set 935

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks