From cd8f47e3bbc6a92a0bdac471d8fac2ee8bcf933f Mon Sep 17 00:00:00 2001 From: Lars Vogel Date: Thu, 19 Jun 2025 14:25:09 +0200 Subject: [PATCH] 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 --- .../eclipse/e4/ui/workbench/renderers/swt/WBWRenderer.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/WBWRenderer.java b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/WBWRenderer.java index d411fbff817..05ef533e4ac 100644 --- a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/WBWRenderer.java +++ b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/WBWRenderer.java @@ -534,8 +534,11 @@ public void hookControllerLogic(MUIElement me) { @Override public void controlResized(ControlEvent e) { // Don't store the maximized size in the model + // But set the maximized tag so that the user can access the current state if (shell.getMaximized()) { - return; + me.getTags().add(ShellMaximizedTag); + } else { + me.getTags().remove(ShellMaximizedTag); } try {