diff --git a/src/net/java/sip/communicator/impl/gui/main/chat/ChatWindow.java b/src/net/java/sip/communicator/impl/gui/main/chat/ChatWindow.java index adb3593e5..743507467 100755 --- a/src/net/java/sip/communicator/impl/gui/main/chat/ChatWindow.java +++ b/src/net/java/sip/communicator/impl/gui/main/chat/ChatWindow.java @@ -50,8 +50,7 @@ public class ChatWindow extends SIPCommFrame implements ExportedWindow, PluginComponentListener, - WindowFocusListener, - WindowListener + WindowFocusListener { private final Logger logger = Logger.getLogger(ChatWindow.class); @@ -91,11 +90,6 @@ public ChatWindow() } this.addWindowFocusListener(this); - this.addWindowListener(this); - - // prevent focus stealing at opening - // the window is made focusable again in windowOpened() - this.setFocusableWindowState(false); this.setHierarchicallyOpaque(false); @@ -405,6 +399,8 @@ public void setCurrentChatPanel(ChatPanel chatPanel) mainToolBar.enableInviteButton(false); mainToolBar.changeHistoryButtonsState(chatPanel); + + chatPanel.requestFocusInWriteArea(); } /** @@ -1170,37 +1166,11 @@ public void setParams(Object[] windowParams) {} public void windowGainedFocus(WindowEvent evt) { this.removeNonReadChatState(); - this.getCurrentChatPanel().requestFocusInWriteArea(); } public void windowLostFocus(WindowEvent arg0) {} - public void windowOpened(WindowEvent evt) - { - // the window was previously set non focusable - // to prevent focus stealing at opening - this.setFocusableWindowState(true); - } - - public void windowActivated(WindowEvent evt) - {} - - public void windowDeactivated(WindowEvent evt) - {} - - public void windowClosing(WindowEvent evt) - {} - - public void windowClosed(WindowEvent evt) - {} - - public void windowIconified(WindowEvent evt) - {} - - public void windowDeiconified(WindowEvent evt) - {} - /** * Removes the non read state of the currently selected chat session. This * will result in removal of all icons representing the non read state (like