Skip to content

Commit

Permalink
only assign a new title value if it has actually changed
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Oct 25, 2021
1 parent a5af520 commit 558bbe2
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions html5/js/Window.js
Original file line number Diff line number Diff line change
Expand Up @@ -506,11 +506,13 @@ XpraWindow.prototype.set_metadata_safe = function(metadata) {
this.log("unable to decode title string '"+title+"' received from ", this.client.protocol.packet_encoder, ": "+e);
}
}
this.title = title;
this.log("title=", this.title, typeof this.title, this.title.constructor)
jQuery('#title' + this.wid).html(this.title);
const trimmedTitle = Utilities.trimString(this.title, 30);
jQuery('#windowlistitemtitle'+this.wid).text(trimmedTitle);
if (this.title!=title) {
this.title = title;
this.log("title=", this.title)
jQuery('#title' + this.wid).html(this.title);
const trimmedTitle = Utilities.trimString(this.title, 30);
jQuery('#windowlistitemtitle'+this.wid).text(trimmedTitle);
}
}
if ("has-alpha" in metadata) {
this.has_alpha = metadata["has-alpha"];
Expand Down

0 comments on commit 558bbe2

Please sign in to comment.