winex11.drv: xrandr1.2 don't assume CRTC 0 is active

Alexandre Julliard julliard at winehq.org
Mon Jul 30 13:13:29 CDT 2012


Patrick Rudolph <siro at das-labor.org> writes:

> @@ -279,15 +279,34 @@ static int xrandr12_get_current_mode(void)
>          return 0;
>      }
>  
> -    if (!resources->ncrtc || !(crtc_info = pXRRGetCrtcInfo( gdi_display, resources, resources->crtcs[0] )))
> +    if (!resources->ncrtc)
>      {
>          pXRRFreeScreenResources( resources );
>          wine_tsx11_unlock();
> -        ERR("Failed to get CRTC info.\n");
> +        ERR("No CRTCs found.\n");
>          return 0;
>      }
> +    for(i=0;resources->ncrtc;i++)
> +    {
> +	
> +        if (!(crtc_info = pXRRGetCrtcInfo( gdi_display, resources, resources->crtcs[i] )))
> +        {
> +            pXRRFreeScreenResources( resources );
> +            wine_tsx11_unlock();
> +            ERR("Failed to get CRTC info.\n");
> +            return 0;
> +        }
> +	/* verify that crtc i is active */
> +        if((!crtc_info->mode) && (!crtc_info->width) && (!crtc_info->height)) 
> +	    if(i+1 < resources->ncrtc)   /* crtc i is disabled, test for more crtcs */ 
> +                pXRRFreeCrtcInfo( crtc_info );
> +            else
> +                break;
> +	else
> +	    break;
> +    }

This clearly needs a helper function.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list