mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUAC-642: Remove scrollbars before resize. Delay sending of size until after reflow.
This commit is contained in:
@@ -1475,16 +1475,30 @@ GuacUI.Client.attach = function(guac) {
|
|||||||
/*
|
/*
|
||||||
* Send size events on resize
|
* Send size events on resize
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
var resize_timeout = null;
|
||||||
|
|
||||||
window.onresize = function() {
|
window.onresize = function() {
|
||||||
|
|
||||||
var pixel_density = window.devicePixelRatio || 1;
|
// Remove scrollbars during resize
|
||||||
var width = window.innerWidth * pixel_density;
|
GuacUI.Client.main.style.overflow = "hidden";
|
||||||
var height = window.innerHeight * pixel_density;
|
|
||||||
|
|
||||||
if (GuacUI.Client.attachedClient)
|
// Wait for resize to settle before updating
|
||||||
GuacUI.Client.attachedClient.sendSize(width, height);
|
window.clearTimeout(resize_timeout);
|
||||||
|
resize_timeout = window.setTimeout(function() {
|
||||||
|
|
||||||
GuacUI.Client.updateDisplayScale();
|
var pixel_density = window.devicePixelRatio || 1;
|
||||||
|
var width = window.innerWidth * pixel_density;
|
||||||
|
var height = window.innerHeight * pixel_density;
|
||||||
|
|
||||||
|
GuacUI.Client.main.style.overflow = "auto";
|
||||||
|
|
||||||
|
if (GuacUI.Client.attachedClient)
|
||||||
|
GuacUI.Client.attachedClient.sendSize(width, height);
|
||||||
|
|
||||||
|
GuacUI.Client.updateDisplayScale();
|
||||||
|
|
||||||
|
}, 10);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user