fix taskbar image on MacOs
@@ -86,6 +86,8 @@ import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.apache.hop.ui.util.EnvironmentUtils;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StackLayout;
+import org.eclipse.swt.events.ShellAdapter;
+import org.eclipse.swt.events.ShellEvent;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
@@ -159,6 +161,8 @@ public class HopGui
public static final String DEFAULT_HOP_GUI_NAMESPACE = "hop-gui";
+ public boolean firstShowing = true;
+
private static final String UNDO_UNAVAILABLE =
BaseMessages.getString(PKG, "HopGui.Menu.Undo.NotAvailable");
private static final String REDO_UNAVAILABLE =
@@ -318,6 +322,25 @@ public class HopGui
protected void open() {
shell.setImage(GuiResource.getInstance().getImageHopUiTaskbar());
+ /**
+ * On macOs the image gets loaded too soon, add a listener to set the image when the shell is
+ * loaded
+ */
+ if (OsHelper.isMac()) {
+ shell
+ .getShell()
+ .addShellListener(
+ new ShellAdapter() {
+ @Override
+ public void shellActivated(ShellEvent shellevent) {
+ if (firstShowing) {
+ shell.setImage(GuiResource.getInstance().getImageHopUiTaskbar());
+ firstShowing = false;
+ }
+ }
+ });
+ }
+
shell.setText(BaseMessages.getString(PKG, "HopGui.Application.Name"));
addMainMenu();
addMainToolbar();
