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.
This commit is contained in:
Samuel Mannehed 2017-02-16 15:53:48 +01:00
parent 6bfd9dc96f
commit b56772ec43
1 changed files with 4 additions and 2 deletions

View File

@ -266,7 +266,6 @@ var UI;
addResizeHandlers: function() { addResizeHandlers: function() {
window.addEventListener('resize', UI.applyResizeMode); window.addEventListener('resize', UI.applyResizeMode);
window.addEventListener('resize', UI.updateViewClip); window.addEventListener('resize', UI.updateViewClip);
window.addEventListener('resize', UI.updateViewDrag);
}, },
addControlbarHandlers: function() { addControlbarHandlers: function() {
@ -1313,6 +1312,10 @@ var UI;
// the size of the browser window. // the size of the browser window.
display.viewportChangeSize(size.w, size.h); 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 // Handle special cases where clipping is forced on/off or locked
@ -1664,7 +1667,6 @@ var UI;
updateSessionSize: function(rfb, width, height) { updateSessionSize: function(rfb, width, height) {
UI.updateViewClip(); UI.updateViewClip();
UI.updateViewDrag();
}, },
updateDesktopName: function(rfb, name) { updateDesktopName: function(rfb, name) {