[PATCH] winex11.drv: Prefer Xinerama handler over XRandr10.

Derek Lesho dlesho at codeweavers.com
Wed Nov 27 14:56:38 CST 2019


Hi Zhiyi,

When testing UFO: Aftershock (289500) under XWayland, the full-screen 
window would fail to appear, and the game would run in the background.  
I noticed that switching from the Xinerama handler to the XRandr handler 
caused the breakage, and assumed this was due to a non-functional 
xrandr10_init_modes function, as xrandr12_init_modes fails with "Failed 
to get primary CRTC info." for me.

If this isn't the case, then I agree, we should instead focus on fixing 
the XRandr handler.  I'm not very familiar with this area of the code, 
but I'll take another look sometime soon.

Regards,

Derek

On 11/26/19 7:29 PM, Zhiyi Zhang wrote:

> Hi Derek,
>
> The raised Xinerama priority when query_screens() fails was unintentional.
> So it was removed by 914b551.
>
> The XRandR 1.4 display device handler is working fine here with XWayland.
> XWayland's XRandR doesn't report any provider(GPU) but Wine currently have
> a workaround for that. So I don't see why you need this change. If it's
> something that can be handled in the XRandR handler, we should handle it
> there and continue to use XRandR.
>
> My XWayland version:
> ~$ apt-cache show mutter | grep Version
> Version: 3.34.1+git20191107-1ubuntu1~19.10.1
> Version: 3.34.1-1ubuntu1
>
> Thanks,
> Zhiyi
>
> On 11/27/19 1:57 AM, Derek Lesho wrote:
>> This fixes a regression on XWayland introduced by 914b551's removal of
>> the raised Xinerama priority when query_screens failed.
>>
>> Ideally, we'd like XWayland to fix their issues with XRandr and Xinerama,
>> but this helps out users until then.
>>
>> Signed-off-by: Derek Lesho <dlesho at codeweavers.com>
>> ---
>>   dlls/winex11.drv/xrandr.c | 7 ++++++-
>>   1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/dlls/winex11.drv/xrandr.c b/dlls/winex11.drv/xrandr.c
>> index 5616857347..6bbf1b67ee 100644
>> --- a/dlls/winex11.drv/xrandr.c
>> +++ b/dlls/winex11.drv/xrandr.c
>> @@ -1096,6 +1096,7 @@ void X11DRV_XRandR_Init(void)
>>       int event_base, error_base, minor, ret;
>>       static int major;
>>       Bool ok;
>> +    INT priority = 200;
>>   
>>       if (major) return; /* already initialized? */
>>       if (!usexrandr) return; /* disabled in config */
>> @@ -1121,13 +1122,17 @@ void X11DRV_XRandR_Init(void)
>>   
>>       if (!pXRRGetScreenResourcesCurrent || xrandr12_init_modes() < 0)
>>   #endif
>> +    {
>> +        /* lower priority below Xinerama if we need to resort to xrandr10 */
>> +        priority = 50;
>>           xrandr10_init_modes();
>> +    }
>>   
>>   #ifdef HAVE_XRRGETPROVIDERRESOURCES
>>       if (ret >= 4 && (major > 1 || (major == 1 && minor >= 4)))
>>       {
>>           handler.name = "XRandR 1.4";
>> -        handler.priority = 200;
>> +        handler.priority = priority;
>>           handler.get_gpus = xrandr14_get_gpus;
>>           handler.get_adapters = xrandr14_get_adapters;
>>           handler.get_monitors = xrandr14_get_monitors;



More information about the wine-devel mailing list