diff --git a/src/net/java/sip/communicator/util/swing/SIPCommDialog.java b/src/net/java/sip/communicator/util/swing/SIPCommDialog.java index 75a31cf2f..ff0dc2b4f 100644 --- a/src/net/java/sip/communicator/util/swing/SIPCommDialog.java +++ b/src/net/java/sip/communicator/util/swing/SIPCommDialog.java @@ -417,4 +417,31 @@ public void dispose() * the Esc key; otherwise, false */ protected abstract void close(boolean escaped); + + /** + * Sets the title for this frame to the specified string. + * @param title the title to be displayed in the frame's border. + */ + public void setTitle(String title) + { + super.setTitle(title); + + if(title != null) + { + // under linux and gnome3 there is a bug in java where all windows + // have the name java-lang-thread, this is a fix for it + try + { + Toolkit xToolkit = Toolkit.getDefaultToolkit(); + java.lang.reflect.Field awtAppClassNameField = + xToolkit.getClass().getDeclaredField("awtAppClassName"); + awtAppClassNameField.setAccessible(true); + awtAppClassNameField.set(xToolkit, title); + } + catch(Throwable t) + { + // we do nothing for it + } + } + } } diff --git a/src/net/java/sip/communicator/util/swing/SIPCommFrame.java b/src/net/java/sip/communicator/util/swing/SIPCommFrame.java index 07160466b..0b30c818a 100644 --- a/src/net/java/sip/communicator/util/swing/SIPCommFrame.java +++ b/src/net/java/sip/communicator/util/swing/SIPCommFrame.java @@ -735,4 +735,31 @@ protected void close(boolean isEscaped) { } + + /** + * Sets the title for this frame to the specified string. + * @param title the title to be displayed in the frame's border. + */ + public void setTitle(String title) + { + super.setTitle(title); + + if(title != null) + { + // under linux and gnome3 there is a bug in java where all windows + // have the name java-lang-thread, this is a fix for it + try + { + Toolkit xToolkit = Toolkit.getDefaultToolkit(); + java.lang.reflect.Field awtAppClassNameField = + xToolkit.getClass().getDeclaredField("awtAppClassName"); + awtAppClassNameField.setAccessible(true); + awtAppClassNameField.set(xToolkit, title); + } + catch(Throwable t) + { + // we do nothing for it + } + } + } }