Only take the focus if the "auto popup" property is switched on. Patch provided by Vieri on July 26.

cusax-fix
Yana Stamcheva 14 years ago
parent 0d2df924f5
commit 20a28fa8c2

@ -1141,14 +1141,27 @@ public void fileDropped(File file, Point point)
*/
public void openChat(ChatPanel chatPanel, boolean setSelected)
{
boolean isWindowVisible = isVisible();
if(getExtendedState() != JFrame.ICONIFIED)
{
if(ConfigurationManager.isAutoPopupNewMessage() || setSelected)
{
if (!isVisible())
setVisible(true);
toFront();
}
else
{
setFocusableWindowState(false);
setVisible(true);
setFocusableWindowState(true);
}
}
else
{
if(setSelected)
if (setSelected)
{
setExtendedState(JFrame.NORMAL);
toFront();
@ -1160,7 +1173,7 @@ public void openChat(ChatPanel chatPanel, boolean setSelected)
setTitle("*" + chatWindowTitle);
}
if(setSelected)
if (setSelected || !isWindowVisible)
{
setCurrentChat(chatPanel);
}

@ -79,15 +79,7 @@ public void run()
if(!chatPanel.isShown())
chatContainer.addChat(chatPanel);
if(chatContainer.getFrame().isVisible())
{
chatContainer.openChat(chatPanel, setSelected);
}
else
{
chatContainer.getFrame().setVisible(true);
chatContainer.setCurrentChat(chatPanel);
}
chatContainer.openChat(chatPanel, setSelected);
}
}

Loading…
Cancel
Save