UI: fixed windows layer problems when old window overlapped new window (see #4318, #4320 and other)

This commit is contained in:
Oleg Agafonov 2018-01-01 18:00:42 +04:00
parent 89f8b1420e
commit 78d036b6bb
9 changed files with 74 additions and 20 deletions

View file

@ -120,15 +120,19 @@ public class ShowCardsDialog extends MageDialog {
this.cardArea.addCardEventListener(eventListener);
}
if (getParent() != MageFrame.getDesktop() /*|| this.isClosed*/) {
MageFrame.getDesktop().add(this, JLayeredPane.DEFAULT_LAYER);
}
pack();
this.revalidate();
this.repaint();
this.setModal(modal);
// window settings
if (this.isModal()){
MageFrame.getDesktop().add(this, JLayeredPane.MODAL_LAYER);
}else{
MageFrame.getDesktop().add(this, JLayeredPane.PALETTE_LAYER);
}
SwingUtilities.invokeLater(() -> {
if (!positioned) {
int width = ShowCardsDialog.this.getWidth();