Skip to content

Commit 607d41e

Browse files
committed
Sync maximized flag from the shell size with the application model
Before this change the WBWRenderer did not update the application model if the information that the shell was maximized, only during dispose this information was updated. This lead to outdated information in the application model and forces clients which are interested in the actual size of the Window to check in the Shell instead in the model. This was introduced by https://bugs.eclipse.org/bugs/attachment.cgi?id=183776&action=diff. The actual logic of restoring of size is done via a tag, so putting the size in the application should not affect the application behavior. This also supports the scenario in which the user re-starts the application in maximized state, as the user can still restore to the previous state from the application model. Fixes #3054
1 parent ca63f41 commit 607d41e

File tree

1 file changed

+4
-1
lines changed
  • bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt

1 file changed

+4
-1
lines changed

bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/WBWRenderer.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,8 +534,11 @@ public void hookControllerLogic(MUIElement me) {
534534
@Override
535535
public void controlResized(ControlEvent e) {
536536
// Don't store the maximized size in the model
537+
// But set the maximized tag so that the user can access the current state
537538
if (shell.getMaximized()) {
538-
return;
539+
me.getTags().add(ShellMaximizedTag);
540+
} else {
541+
me.getTags().remove(ShellMaximizedTag);
539542
}
540543

541544
try {

0 commit comments

Comments
 (0)