Better checking when setting tooltip text
This commit is contained in:
parent
3125fb6b0e
commit
78b78b80b9
|
@ -49,7 +49,7 @@ class _AwtTray extends Tray implements NativeUI {
|
|||
// is the system tray visible or not.
|
||||
private volatile boolean visible = true;
|
||||
private volatile File imageFile;
|
||||
private volatile String tooltipText = null;
|
||||
private volatile String tooltipText = "";
|
||||
|
||||
private final Object keepAliveLock = new Object[0];
|
||||
private Thread keepAliveThread;
|
||||
|
@ -212,6 +212,9 @@ class _AwtTray extends Tray implements NativeUI {
|
|||
@Override
|
||||
protected
|
||||
void setTooltip_(final String tooltipText) {
|
||||
if (this.tooltipText.equals(tooltipText)){
|
||||
return;
|
||||
}
|
||||
this.tooltipText = tooltipText;
|
||||
|
||||
SwingUtil.invokeLater(new Runnable() {
|
||||
|
|
|
@ -54,6 +54,7 @@ class _GtkStatusIconNativeTray extends Tray implements NativeUI {
|
|||
// is the system tray visible or not.
|
||||
private volatile boolean visible = true;
|
||||
private volatile File imageFile;
|
||||
private volatile String tooltipText = "";
|
||||
|
||||
private final GtkMenu gtkMenu;
|
||||
|
||||
|
@ -205,6 +206,11 @@ class _GtkStatusIconNativeTray extends Tray implements NativeUI {
|
|||
@Override
|
||||
protected
|
||||
void setTooltip_(final String tooltipText) {
|
||||
if (this.tooltipText.equals(tooltipText)){
|
||||
return;
|
||||
}
|
||||
this.tooltipText = tooltipText;
|
||||
|
||||
Gtk.dispatch(new Runnable() {
|
||||
@Override
|
||||
public
|
||||
|
|
|
@ -49,7 +49,7 @@ class _SwingTray extends Tray implements SwingUI {
|
|||
// is the system tray visible or not.
|
||||
private volatile boolean visible = true;
|
||||
private volatile File imageFile;
|
||||
private volatile String tooltipText = null;
|
||||
private volatile String tooltipText = "";
|
||||
|
||||
// Called in the EDT
|
||||
public
|
||||
|
@ -202,6 +202,9 @@ class _SwingTray extends Tray implements SwingUI {
|
|||
@Override
|
||||
protected
|
||||
void setTooltip_(final String tooltipText) {
|
||||
if (this.tooltipText.equals(tooltipText)){
|
||||
return;
|
||||
}
|
||||
this.tooltipText = tooltipText;
|
||||
|
||||
SwingUtil.invokeLater(new Runnable() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user