Skip to content

Commit

Permalink
#1491: set the favicon to the window icon of the currently focused wi…
Browse files Browse the repository at this point in the history
…ndow

git-svn-id: https://xpra.org/svn/Xpra/trunk@15544 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Apr 9, 2017
1 parent 3187892 commit 2d91d0a
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/html5/js/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ XpraClient.prototype.close_windows = function() {
var iwin = this.id_to_window[i];
iwin.destroy();
}
}
}

XpraClient.prototype.close_protocol = function() {
if (this.protocol) {
Expand Down Expand Up @@ -1102,6 +1102,14 @@ XpraClient.prototype._window_set_focus = function(win) {
iwin.updateFocus();
iwin.update_zindex();
}
//set favicon to the icon of this window:
var icon = jQuery('#windowicon' + String(wid)).attr('src');
console.log("icon=", icon);
if (!icon || icon.endsWith("/noicon.png")) {
//none available, use the default instead:
icon = "/favicon.png";
}
jQuery("#favicon").attr("href", icon);
}
}

Expand Down Expand Up @@ -1724,10 +1732,12 @@ XpraClient.prototype._process_cursor = function(packet, ctx) {
}
var w = packet[4];
var h = packet[5];
var xhot = packet[6];
var yhot = packet[7];
var img_data = packet[9];
for (var wid in ctx.id_to_window) {
var window = ctx.id_to_window[wid];
window.set_cursor(encoding, w, h, img_data);
window.set_cursor(encoding, w, h, xhot, yhot, img_data);
}
}

Expand Down

0 comments on commit 2d91d0a

Please sign in to comment.