From 6bfd9dc96f083e435a8ba60426f8d66f857a5e89 Mon Sep 17 00:00:00 2001
From: Samuel Mannehed <samuel@cendio.se>
Date: Thu, 16 Feb 2017 15:38:58 +0100
Subject: [PATCH] Update clipping before changing scaling

The scaling is relative the current viewport, so we need to make
sure it is correct before changing the scale setting.
---
 app/ui.js | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/app/ui.js b/app/ui.js
index d4a7555..0ea85b3 100644
--- a/app/ui.js
+++ b/app/ui.js
@@ -1220,6 +1220,9 @@ var UI;
                 var resizeMode = UI.getSetting('resize');
                 display.set_scale(1);
 
+                // Make sure the viewport is adjusted first
+                UI.updateViewClip();
+
                 if (resizeMode === 'remote') {
 
                     // Request changing the resolution of the remote display to
-- 
GitLab