SPARK-558 Window controls will not go away.

git-svn-id: http://svn.igniterealtime.org/svn/repos/spark/trunk@7627 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Derek DeMoro
2007-03-21 17:22:28 +00:00
committed by derek
parent a7e5db3eb8
commit be61be4801
3 changed files with 26 additions and 1 deletions

View File

@ -22,6 +22,8 @@ import org.jivesoftware.spark.ui.ContactItem;
import org.jivesoftware.spark.ui.ContactList;
import org.jivesoftware.spark.ui.rooms.GroupChatRoom;
import org.jivesoftware.spark.util.ModelUtil;
import org.jivesoftware.spark.util.SwingTimerTask;
import org.jivesoftware.spark.util.TaskEngine;
import org.jivesoftware.spark.util.log.Log;
import org.jivesoftware.sparkimpl.profile.VCardManager;
@ -50,6 +52,7 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TimerTask;
/**
* Handles all users in the agent application. Each user or chatting user can be referenced from the User
@ -455,8 +458,22 @@ public class UserManager {
contactField.dispose();
parent.removeWindowListener(this);
}
public void windowDeactivated(final WindowEvent windowEvent) {
TimerTask task = new SwingTimerTask() {
public void doRun() {
if (contactField.canClose()) {
windowClosing(windowEvent);
}
}
};
TaskEngine.getInstance().schedule(task, 250);
}
});
}
}
}

View File

@ -274,5 +274,9 @@ public class JContactItemField extends JPanel {
}
}
public boolean canClose(){
return !textField.hasFocus();
}
}

View File

@ -781,6 +781,10 @@ public class ChatContainer extends SparkTabbedPane implements MessageListener, C
}
return;
}
if(room == null){
return;
}
}
// Confirm end session