Skip to content

Commit 5fb9a41

Browse files
fix: trigger shell layout and SWT.Activate on open in web mode
1 parent ad6dc40 commit 5fb9a41

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

swt_native/src/web/java/org/eclipse/swt/widgets/DartShell.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -955,6 +955,9 @@ public void open() {
955955
}
956956
bringToTop(false);
957957
setWindowVisible(true, true);
958+
if (isDisposed())
959+
return;
960+
sendEvent(SWT.Activate);
958961
if (isDisposed())
959962
return;
960963
if (!restoreFocus() && !traverseGroup(true)) {

swt_native/src/web/java/org/eclipse/swt/widgets/SwtFlutterBridge.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,6 @@ public boolean hasFocus(DartControl widget) {
188188
public void setVisible(DartControl control, boolean visible) {
189189
if (control instanceof DartShell dartShell) {
190190
Shell shell = (Shell) dartShell.getApi();
191-
boolean resizedToDisplayBounds = false;
192191
if (visible && forDisplay != null) {
193192
if (shouldTrackDisplayBounds(shell)) {
194193
Rectangle displayBounds = forDisplay.bounds;
@@ -199,11 +198,10 @@ public void setVisible(DartControl control, boolean visible) {
199198
&& shellBounds.width < displayBounds.width
200199
&& shellBounds.height < displayBounds.height) {
201200
shell.setBounds(0, 0, displayBounds.width, displayBounds.height);
202-
resizedToDisplayBounds = true;
203201
}
204202
}
205203
}
206-
if (resizedToDisplayBounds) {
204+
if (visible) {
207205
shell.layout(true, true);
208206
}
209207
sendDisplayUpdate(forDisplay);

0 commit comments

Comments
 (0)