]> git.tdb.fi Git - libs/gui.git/commitdiff
Set panning when changing modes with XRandR
authorMikko Rasa <tdb@tdb.fi>
Wed, 22 Jan 2014 19:54:28 +0000 (21:54 +0200)
committerMikko Rasa <tdb@tdb.fi>
Wed, 22 Jan 2014 19:54:28 +0000 (21:54 +0200)
Apparently, certain sequences can confuse Nvidia drivers at least and
result in weird configurations if this is not done.

source/graphics/x11/display.cpp

index fe489ec86cf27760daecbb843497360759e87583..c2a4eaf26371d1a190f8051f9e198590192d95a4 100644 (file)
@@ -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;