From b1a6dffafa27d689389b512668fd5c34757dbd1d Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Wed, 22 Jan 2014 21:54:28 +0200 Subject: [PATCH] Set panning when changing modes with XRandR Apparently, certain sequences can confuse Nvidia drivers at least and result in weird configurations if this is not done. --- source/graphics/x11/display.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/source/graphics/x11/display.cpp b/source/graphics/x11/display.cpp index fe489ec..c2a4eaf 100644 --- a/source/graphics/x11/display.cpp +++ b/source/graphics/x11/display.cpp @@ -300,6 +300,23 @@ void Display::set_mode(const VideoMode &requested_mode, bool exclusive) { XRROutputInfo *o = XRRGetOutputInfo(priv->display, res, priv->monitors[i->index]); XRRSetCrtcConfig(priv->display, res, o->crtc, CurrentTime, x, y, priv->modes[i->current_mode->index], rotation_to_sys(i->current_rotation), &priv->monitors[i->index], 1); + + XRRPanning panning; + panning.timestamp = CurrentTime; + panning.left = x; + panning.top = y; + panning.width = i->current_mode->width; + panning.height = i->current_mode->height; + panning.track_left = panning.left; + panning.track_top = panning.top; + panning.track_width = panning.width; + panning.track_height = panning.height; + panning.border_left = 0; + panning.border_top = 0; + panning.border_right = 0; + panning.border_bottom = 0; + XRRSetPanning(priv->display, res, o->crtc, &panning); + XRRFreeOutputInfo(o); i->x = x; -- 2.45.2