[PATCH] winex11.drv: call XRRSetScreenSize when changing resolution

Stefan Dösinger stefandoesinger at gmail.com
Thu Nov 20 12:45:11 CST 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am 2014-11-20 17:49, schrieb Mark Harmstone:
> Oops, sorry, yes I did.
> 
> How about the attached patch? It only calls XRRSetScreenSize if 
> there's only one active CRTC. I've managed to scrounge another 
> monitor now, and it works for me with both single and multiple 
> monitors.
- From a usability point of view I'm for it, but (fortunately or
unfortunately) this is not how we operate. Using such a workaround makes
it less likely that the problem is fixed properly in a way that works on
multi-monitor systems.

To answer your previous points:

On 11/20/14 14:03, Mark Harmstone wrote:
> I tested this with KDE 4.14.3 and kwin 4.11.14, and it worked fine
> - if there's a KDE bug, it must have been fixed in the latest
> versions. I only have a single monitor to test with, though.
I did not see a problem with my experimental hacks myself. Caron saw
problems on KDE with some games. I've asked her if she remembers the
details, and I'll grep my IRC logs.

> Setting crtc_info->x and crtc_info->y to 0 in XRRSetCrtcConfig
> does stop it from failing outright, but in my experience these are
> only non-zero when panning is already on. For the first resolution
> change, it won't prevent the drivers from going into panning mode,
> and won't (for instance) stop Icewind Dale from failing on startup
> on low resolutions.
In which way does Icewind Dale fail?

Thinking about it: What happens when the desktop is running at 640x480
and a game tries to set 1024x768 (and this is supported by the monitor).
I'd expect this to fail with the current code, maybe this is what you
mean with "Icewind Dale fails".

> Plus all this patch is doing is what xrandr is doing already -
> does that mean that xrandr also messes up multi-monitor setups, or
> would you need to pass it different arguments? And I'm not sure
> what the official Wine line is on this, but it seems to me sensible
> to prioritize simple common setups over complicated rare ones - I'm
> sure far more people use nvidia-drivers than have two monitors.
This is a good question. I've experimented a bit with the xrandr command
line tool and found it to be a pretty bad mess. Even if you don't pass
- --q1 it handles the average mode setting cases with the Xrandr 1.0
functions.

So it's either that different options are needed or that xrandr takes a
different internal codepath. I'll have to do some tests again.

Stefan


> On 20/11/14 13:19, Stefan Dösinger wrote: Hi,
> 
> Did you accidentally drop the wine-devel CC, or was this on
> purpose? I'd like to CC wine-devel on my reply but don't want to
> forward your mail without your consent.
> 
> Stefan
> 
> On 11/20/14 14:03, Mark Harmstone wrote:
>>>> Hi,
>>>> 
>>>> I tested this with KDE 4.14.3 and kwin 4.11.14, and it
>>>> worked fine - if there's a KDE bug, it must have been fixed
>>>> in the latest versions. I only have a single monitor to test
>>>> with, though.
>>>> 
>>>> Setting crtc_info->x and crtc_info->y to 0 in
>>>> XRRSetCrtcConfig does stop it from failing outright, but in
>>>> my experience these are only non-zero when panning is already
>>>> on. For the first resolution change, it won't prevent the
>>>> drivers from going into panning mode, and won't (for
>>>> instance) stop Icewind Dale from failing on startup on low
>>>> resolutions.
>>>> 
>>>> Plus all this patch is doing is what xrandr is doing already
>>>> - does that mean that xrandr also messes up multi-monitor
>>>> setups, or would you need to pass it different arguments? And
>>>> I'm not sure what the official Wine line is on this, but it
>>>> seems to me sensible to prioritize simple common setups over
>>>> complicated rare ones - I'm sure far more people use
>>>> nvidia-drivers than have two monitors.
>>>> 
>>>> Mark
>>>> 
>>>> 
>>>> On 20/11/14 12:48, Stefan Dösinger wrote: On 11/20/14 13:11, 
>>>> Mark Harmstone wrote:
>>>>>>> This changes xrandr12_set_current_mode so it behaves
>>>>>>> the same way as xrandr does in 1.2 mode (e.g, `xrandr 
>>>>>>> --output HDMI-0 --crtc 0 --mode 640x480`). Before 
>>>>>>> XRRSetCrtcConfig is called, the CRTC is temporarily 
>>>>>>> disabled, then XRRSetScreenSize is called. 
>>>>>>> (XRRSetCrtcConfig will fail if the CRTC isn't disabled 
>>>>>>> first.)
>>>> I've experimented with this a few weeks ago, and it
>>>> drastically improves the usability of fullscreen applications
>>>> on Metacity-based window managers. Unfortunately I'm afraid
>>>> it is not quite that simple. It breaks KDE (may be a bug) and
>>>> it breaks multi-monitor setups.
>>>> 
>>>> Testing on Windows (sorry, I did not write formal tests)
>>>> shows that in single monitor setups the virtual screen size
>>>> is adjusted to match the monitor's resolution when the
>>>> resolution is changed. So the change is correct in single
>>>> monitor setups, but needs tests.
>>>> 
>>>> In multi-monitor setups the virtual screen size is changed
>>>> too, but it still takes both monitors into account. E.g. you
>>>> had two monitors at 1920x1080, where one is to the right of
>>>> the other. So you have a virtual screen of 3840x1080. If you
>>>> change the res of the left monitor to 640x480 you get a
>>>> virtual screen size of 2560x1080.
>>>> 
>>>> I hackily "fixed" the Nvidia panning bug by replacing 
>>>> crtc_info->x and crtc_info->y in pXRRSetCrtcConfig with 0,
>>>> 0. That way the mode set succeeds and the CRTC is positioned 
>>>> correctly. The direct3d mouse grab takes care of the mouse 
>>>> moving outside the window, but only after clicking in the 
>>>> window once. The d3d grab is incorrect though as far as I
>>>> can see. Windows doesn't grab the mouse in fullscreen d3d
>>>> games in dual monitor setups.
>>>> 
>>>> Passing an offset of 0, 0 to pXRRSetCrtcConfig may be the 
>>>> correct thing to do. It seems that the content of
>>>> crtc_info->x and crtc_info->y depends on the mouse pointer
>>>> location, which would be an odd thing for a mode change to
>>>> depend on. May be an Nvidia bug.
>>>> 
>>>> Finally, there is a bug in all window managers forked from 
>>>> Metacity. If the new resolution is smaller in width or
>>>> height than half the virtual screen size (= old resolution
>>>> for single-monitor setups) then the WM places the window 
>>>> incorrectly. xwininfo reports where the window *should* be -
>>>> at 0x0-WxH. But the real display location is something
>>>> different, depending on the exact incarnation of the WM. In
>>>> Unity it is shifted by 64x64 (unity bar I guess) and
>>>> stretched to the virtual screen size. In MATE I think the
>>>> window is centered. I suspect this is caused by the window
>>>> positioning logic breaking. I have not been able to isolate
>>>> the bug in the window manager code yet.
>>>> 
>>>> All in all I'm afraid we have a number of different bugs to
>>>> fix in all Metacity forks, Wine, the Nvidia driver and maybe
>>>> KDE.
>>>> 
>>>> Fwiw, KDE and FVWM place fullscreen windows properly. MATE
>>>> and Unity also adjust their title bars and window
>>>> maximization to match the new CRTC size, not the screen
>>>> size.
>>>> 
>>>>> 
>>>> 
> 
>> 
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJUbja3AAoJEN0/YqbEcdMwWagP/3wd0P4nmifoBdMk+ww6oPPN
NctyL1cZzyAAKGlEzenu6W1UaCimEWbB4uy1qnCEv/vJSP6vn8cAD+5ry79jURWJ
Oz98Uzefxih0cXVgru1MUcB2XQkq0eftOkCYVgl9zVqDSzcKWmJF/Adqowa9K6da
6FjtSsd/Xzi1HPe5xGyxXZ0oyKJdwwzyaYW7g+OWZMxgRSUu1jM1+MnWhSrmMirx
fbiRUEK3az4ClLCVRT/d8zueePNK1YC4Dxz7uD/wo1KPW5W08C6JPft+YlLVv8XV
6MOHIZkBPH9anfBxWSe1cQUXDMwz5OaP4GXsTGO7LfgkIPw0S/Jg2OfNG53bddWN
8Owz6LlU6L8TXy0KRJEzJp4M53ML5yj32sEbiVTRq5CW0ZIaoB1sXd/W685ZDnjn
6eO0/zYBtDbEcekIKX5tN3Om5yEA/WM+nEuMz6W7lOo7DqzLvai2m5trf0SzlzA9
WhdqfgdnEoWwXm2RIRt7v7OSoikzUEZScqIQqUcJvVxC6tnlsRhg1R0Tva2Vl4h3
sqT7dsrMYbpcPxKc96nZqVg4sK3bYgTAjmcr+pJtyFxCRPWCBMP6LdTgGbzDdZHs
mEgk3+KMydDt21ddDxKnyOdRa1kVRIbXGyQaqtOekwFR3EnIklTdd6Z4S8awkrWq
Nwk2jDiUA0iT3LTWBoJH
=rH6x
-----END PGP SIGNATURE-----



More information about the wine-devel mailing list