Skip to content

Commit 8961598

Browse files
author
zhourenjian
committed
Fixing a bug that task bar's title is not updating according to Shell's window title
1 parent 22ec18d commit 8961598

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

  • sources/net.sf.j2s.java.org.eclipse.swt/src/org/eclipse/swt/widgets

sources/net.sf.j2s.java.org.eclipse.swt/src/org/eclipse/swt/widgets/TaskBar.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -306,14 +306,14 @@ public void updateItems() {
306306
TaskItem item = this.items[i];
307307
item.itemHandle.style.top = offset + (i * hh + 24) + "px";
308308
if (item.shell != null) {
309-
if (item.shell.getText() != item.text) {
309+
String text = item.shell.getText();
310+
if (text != item.text) {
310311
for (int j = item.textHandle.childNodes.length - 1; j >= 0; j--) {
311-
item.textHandle
312-
.removeChild(item.textHandle.childNodes[j]);
312+
item.textHandle.removeChild(item.textHandle.childNodes[j]);
313313
}
314-
item.textHandle.appendChild(document
315-
.createTextNode(item.shell.getText()));
316-
item.itemHandle.title = item.shell.getText();
314+
item.textHandle.appendChild(document.createTextNode(text));
315+
item.itemHandle.title = text;
316+
item.text = text;
317317
}
318318
Image image = item.shell.getImage();
319319
CSSStyle handleStyle = item.iconHandle.style;

0 commit comments

Comments
 (0)