From: Mikko Rasa Date: Wed, 22 Jan 2014 19:54:28 +0000 (+0200) Subject: Set panning when changing modes with XRandR X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=b1a6dffafa27d689389b512668fd5c34757dbd1d;p=libs%2Fgui.git 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. --- 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;