mirror of
https://github.com/correl/mage.git
synced 2024-11-15 11:09:30 +00:00
MageFrame changed logic the handle the activeFrame.
This commit is contained in:
parent
d6789fa383
commit
2427b714a1
1 changed files with 6 additions and 3 deletions
|
@ -526,6 +526,7 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
|||
|
||||
public static void setActive(MagePane frame) {
|
||||
if (frame == null) {
|
||||
activeFrame = null;
|
||||
return;
|
||||
}
|
||||
logger.debug("Setting " + frame.getTitle() + " active");
|
||||
|
@ -552,11 +553,11 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
|||
|
||||
public static void deactivate(MagePane frame) {
|
||||
frame.setVisible(false);
|
||||
MagePane topmost = getTopMost(frame);
|
||||
setActive(getTopMost(frame));
|
||||
if (activeFrame != frame) {
|
||||
frame.deactivated();
|
||||
}
|
||||
setActive(topmost);
|
||||
|
||||
}
|
||||
|
||||
private static MagePane getTopMost(MagePane exclude) {
|
||||
|
@ -568,7 +569,9 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
|||
if (z < best) {
|
||||
if (frame instanceof MagePane) {
|
||||
best = z;
|
||||
topmost = (MagePane) frame;
|
||||
if (!frame.equals(exclude)) {
|
||||
topmost = (MagePane) frame;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue