summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Fourdan <ofourdan@redhat.com>2016-03-21 09:53:17 +0100
committerAdam Jackson <ajax@redhat.com>2016-03-29 16:42:30 -0400
commit082d5ea9a8f882c5ab7c30c481e2d9a5c5f11376 (patch)
treead8a81ff1011ae2f43ae0d5d0e03fa8b2f3246e8
parentfcb89adb4a6cde585923e63d3c34df465aa78d1b (diff)
xwayland: Pretend we support viewport in vidmode
Some games (namely openttd) will raise an XError and fail with a BadValue if their request to XF86VidModeSetViewPort fails. Support only the default zoom and viewport, fail for everything else. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> (cherry picked from commit 44e1c97ca6fe992bbb6ef9ecb0b82a113adfa57e)
-rw-r--r--hw/xwayland/xwayland-vidmode.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/hw/xwayland/xwayland-vidmode.c b/hw/xwayland/xwayland-vidmode.c
index 6d70e39e6..0bcd11401 100644
--- a/hw/xwayland/xwayland-vidmode.c
+++ b/hw/xwayland/xwayland-vidmode.c
@@ -208,15 +208,26 @@ xwlVidModeDeleteModeline(ScreenPtr pScreen, DisplayModePtr mode)
static Bool
xwlVidModeZoomViewport(ScreenPtr pScreen, int zoom)
{
- /* Unsupported for now */
- return FALSE;
+ /* Support only no zoom */
+ return (zoom == 1);
}
static Bool
xwlVidModeSetViewPort(ScreenPtr pScreen, int x, int y)
{
- /* Unsupported for now */
- return FALSE;
+ RROutputPtr output;
+ RRCrtcPtr crtc;
+
+ output = RRFirstOutput(pScreen);
+ if (output == NULL)
+ return FALSE;
+
+ crtc = output->crtc;
+ if (crtc == NULL)
+ return FALSE;
+
+ /* Support only default viewport */
+ return (x == crtc->x && y == crtc->y);
}
static Bool