Skip to content

Commit c53df5b

Browse files
committed
Prevent popup shells from gettin prematurely disposed by parenting off-of context-sensitive popups.
1 parent b6abcf8 commit c53df5b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/java/com/diffplug/common/swt/Shells.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,11 @@ public Shell openOnActive() {
209209
//
210210
// as a workaround, if an active shell is found, but it isn't visible, we count that as though
211211
// there isn't an active shell
212+
//
213+
// we have a similar workaround for ON_TOP shells, which are commonly used for context-sensitive
214+
// popups which may close soon after
212215
Shell shell;
213-
if (parent == null || parent.isVisible() == false) {
216+
if (parent == null || parent.isVisible() == false || SwtMisc.flagIsSet(SWT.ON_TOP, parent)) {
214217
shell = new Shell(display, style);
215218
} else {
216219
shell = new Shell(parent, style);

0 commit comments

Comments
 (0)