winex11: Resize the screen when changing CRTC modes.
commit70d842b106d3ccbb0a786a41474903bddc4ea879
authorZebediah Figura <z.figura12@gmail.com>
Thu, 11 Apr 2019 03:30:32 +0000 (10 22:30 -0500)
committerAlexandre Julliard <julliard@winehq.org>
Thu, 11 Apr 2019 07:15:32 +0000 (11 09:15 +0200)
tree03768ebb0dc2ace5268a86c5debeab9cdd9dba24
parent7aa9a04f26be828b5db0200f2c59d00f99afa586
winex11: Resize the screen when changing CRTC modes.

Based on a patch by Gabriel Corona.

According to the RandR spec for RRSetCrtcConfig:

"The entire area of the CRTC must fit within the screen size, else a Match
error results. As an example, rotating the screen so that a single CRTC fills
the entire screen before and after may necessitate disabling the CRTC,
resizing the screen, then re-enabling the CRTC at the new configuration to
avoid an invalid intermediate configuration."

This patch involves resizing the screen also when shrinking a CRTC, not just
when expanding it past the current screen size. This is partially because we
have no way to reliably determine the current display width (DisplayWidth() is
never updated past opening the connection, and RandR exposes no way to
retrieve the screen dimensions), and partially because it's probably what the
user wants anyway (e.g. it's what the `xrandr` configuration app does when the
screen size is not expliticly specified).

This patch fixes TestBot failures on the Debian machines for ddraw, d3d8, and
d3d9 device tests.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=33290
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
dlls/winex11.drv/xrandr.c