]> git.proxmox.com Git - mirror_novnc.git/commitdiff
Update drag button at right time
authorSamuel Mannehed <samuel@cendio.se>
Thu, 16 Feb 2017 14:53:48 +0000 (15:53 +0100)
committerSamuel Mannehed <samuel@cendio.se>
Thu, 16 Feb 2017 15:07:55 +0000 (16:07 +0100)
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

index 0ea85b337779ada645bf5fc26be824f80081205e..7854b5cbaaed97f39b4273f719a1513b34adbe4e 100644 (file)
--- 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) {