fixed excessive context changed calls by non visible windows

This commit is contained in:
ghidravore 2020-01-21 14:06:50 -05:00
parent 6ae0c1ce23
commit 13caf91a21
3 changed files with 13 additions and 0 deletions

View file

@ -405,6 +405,11 @@ class DetachedWindowNode extends WindowNode {
} }
} }
@Override
boolean isVisible() {
return window != null && window.isVisible();
}
void updateDialog() { void updateDialog() {
if (window != null && childComp != null) { if (window != null && childComp != null) {

View file

@ -97,6 +97,11 @@ public class WindowActionManager {
} }
synchronized void contextChanged(ComponentPlaceholder placeHolder) { synchronized void contextChanged(ComponentPlaceholder placeHolder) {
if (!node.isVisible()) {
return;
}
placeHolderForScheduledActionUpdate = placeHolder; placeHolderForScheduledActionUpdate = placeHolder;
// Buffer the events, as they tend to come in 3s. That might not sound like alot, but // Buffer the events, as they tend to come in 3s. That might not sound like alot, but

View file

@ -38,6 +38,8 @@ public abstract class WindowNode extends Node {
abstract Container getContentPane(); abstract Container getContentPane();
abstract boolean isVisible();
void setToolBar(JComponent toolBar) { void setToolBar(JComponent toolBar) {
Container rootPane = getContentPane(); Container rootPane = getContentPane();
if (rootPane == null) { if (rootPane == null) {
@ -98,6 +100,7 @@ public abstract class WindowNode extends Node {
contextTypes = null; contextTypes = null;
} }
@Override
void dispose() { void dispose() {
toolBarPanel = null; toolBarPanel = null;