Skip to content

Commit

Permalink
Workaround and fix for #3195.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexisDrogoul committed Sep 22, 2021
1 parent 48825ba commit fa20941
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
Expand Up @@ -14,6 +14,8 @@
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.events.ControlAdapter;
import org.eclipse.swt.events.ControlEvent;
import org.eclipse.swt.graphics.Resource;
import org.eclipse.ui.IPageListener;
import org.eclipse.ui.IPerspectiveDescriptor;
Expand Down Expand Up @@ -123,6 +125,17 @@ public void postWindowRestore() throws WorkbenchException {}
public void postWindowCreate() {
final IWorkbenchWindow window = getWindowConfigurer().getWindow();
window.getShell().setMaximized(GamaPreferences.Interface.CORE_SHOW_MAXIMIZED.getValue());
if (FLAGS.USE_DELAYED_RESIZE) {
window.getShell().addControlListener(new ControlAdapter() {

@Override
public void controlResized(final ControlEvent e) {
// window.getShell().layout(true, true);
window.getShell().requestLayout();
}

});
}
}

@Override
Expand Down
Expand Up @@ -89,4 +89,12 @@ private static boolean get(final String name, final boolean def) {
*/
public static final boolean USE_OLD_TABS = get("use_old_tabs", true);

/**
* Used in msi.gama.application.workbench.ApplicationWorkbenchWindowAdvisor to work around issue #3195. If true,
* makes the workbench window resize its views asynchronously. True by default on macOS. Could prove useful also in
* other environments, for instance in the presence of slow graphic cards/computers.
*/
public static final boolean USE_DELAYED_RESIZE =
get("use_delayed_resize", System.getProperty("os.name").contains("Mac"));

}

0 comments on commit fa20941

Please sign in to comment.