Ticket #3401: noxrandr.1.patch

File noxrandr.1.patch, 1.5 KB (added by Dibblah, 18 years ago)

This patch is a similar fix. Fixes in the case where XRandR has been configured, but is no longer available as well.

  • libs/libmyth/DisplayResX.cpp

     
    5252                                              desired_screen, rate);
    5353    if (idx >= 0)
    5454    {
    55         Display *display = NULL;
    56         XRRScreenConfiguration *cfg = GetScreenConfig(display);
     55        Display *display = MythXOpenDisplay();
     56        if (!display)
     57            return false;
     58        XRRScreenConfiguration *cfg = NULL;
     59        if (XRRQueryExtension(display,NULL,NULL))
     60            cfg = GetScreenConfig(display);
    5761        if (!cfg)
    5862            return false;
    5963
     
    8286    if (m_video_modes.size())
    8387        return m_video_modes;
    8488
    85     Display *display = NULL;
    86     XRRScreenConfiguration *cfg = GetScreenConfig(display);
     89    Display *display = MythXOpenDisplay();
     90    if (!display)
     91        return m_video_modes;
     92    XRRScreenConfiguration *cfg = NULL;
     93    if (XRRQueryExtension(display,NULL,NULL))
     94        cfg = GetScreenConfig(display);
    8795    if (!cfg)
    8896        return m_video_modes;
    8997
     
    121129
    122130    X11L;
    123131    Window root = RootWindow(display, DefaultScreen(display));
    124     XRRScreenConfiguration *cfg = XRRGetScreenInfo(display, root);
     132    XRRScreenConfiguration *cfg = NULL;
     133    if (XRRQueryExtension(display,NULL,NULL))
     134        cfg = XRRGetScreenInfo(display, root);
    125135    if (!cfg)
    126136    {
    127137        if (display)