mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 13:41:21 +00:00
Do not (potentially) set multiple update timers.
This commit is contained in:
@@ -806,18 +806,22 @@ GuacUI.Client.attach = function(guac) {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
var thumbnail_update_interval;
|
var thumbnail_update_interval = null;
|
||||||
|
|
||||||
window.onblur = function() {
|
window.onblur = function() {
|
||||||
|
|
||||||
// Regularly update screenshot if window not visible
|
// Regularly update screenshot if window not visible
|
||||||
|
if (!thumbnail_update_interval)
|
||||||
thumbnail_update_interval =
|
thumbnail_update_interval =
|
||||||
window.setInterval(GuacUI.Client.updateThumbnail, 1000);
|
window.setInterval(GuacUI.Client.updateThumbnail, 1000);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
window.onfocus = function() {
|
window.onfocus = function() {
|
||||||
|
if (thumbnail_update_interval) {
|
||||||
window.clearInterval(thumbnail_update_interval);
|
window.clearInterval(thumbnail_update_interval);
|
||||||
|
thumbnail_update_interval = null;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user