From b56772ec43773b67981027dc1774a584e1d8bb23 Mon Sep 17 00:00:00 2001 From: Samuel Mannehed Date: Thu, 16 Feb 2017 15:53:48 +0100 Subject: [PATCH] Update drag button at right time It needs to update whenever the viewport or clipping changes, so let's make sure that actually happens and not trigger on mildly related events. --- app/ui.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/ui.js b/app/ui.js index 0ea85b33..7854b5cb 100644 --- a/app/ui.js +++ b/app/ui.js @@ -266,7 +266,6 @@ var UI; addResizeHandlers: function() { window.addEventListener('resize', UI.applyResizeMode); window.addEventListener('resize', UI.updateViewClip); - window.addEventListener('resize', UI.updateViewDrag); }, addControlbarHandlers: function() { @@ -1313,6 +1312,10 @@ var UI; // the size of the browser window. display.viewportChangeSize(size.w, size.h); } + + // Changing the viewport may change the state of + // the dragging button + UI.updateViewDrag(); }, // Handle special cases where clipping is forced on/off or locked @@ -1664,7 +1667,6 @@ var UI; updateSessionSize: function(rfb, width, height) { UI.updateViewClip(); - UI.updateViewDrag(); }, updateDesktopName: function(rfb, name) {