Skip to content
Permalink
Browse files

Dock Fix (#374)

  • Loading branch information...
Vzor- authored and tresf committed Nov 7, 2018
1 parent cc3b30b commit a6c4ee476cd22db173f7adda691714d3e8c16d2e
Showing with 13 additions and 2 deletions.
  1. +2 −2 ant/apple/apple-launcher.sh.in
  2. +11 −0 src/qz/ui/BasicDialog.java
@@ -22,9 +22,9 @@ fallback=$?

# Fallback on Internet Plug-Ins version if needed
if [ $fallback -eq 0 ]; then
${apple.jvmcmd} java ${launch.opts} -Xdock:name="${project.name}" -Xdock:icon="$iconpath" -jar "$jarpath"
${apple.jvmcmd} java ${launch.opts} -Xdock:name="${project.name}" -Xdock:icon="$iconpath" -jar -Dapple.awt.UIElement="true" "$jarpath"
else
"${apple.jvmfallback}/java" ${launch.opts} -Xdock:name="${project.name}" -Xdock:icon="$iconpath" -jar "$jarpath"
"${apple.jvmfallback}/java" ${launch.opts} -Xdock:name="${project.name}" -Xdock:icon="$iconpath" -jar -Dapple.awt.UIElement="true" "$jarpath"
fi

exit $?
@@ -1,6 +1,8 @@
package qz.ui;

import qz.common.Constants;
import qz.utils.ShellUtilities;
import qz.utils.SystemUtilities;

import javax.swing.*;
import javax.swing.border.EmptyBorder;
@@ -152,4 +154,13 @@ public ImageIcon getIcon(IconCache.Icon icon) {
}
return null;
}

@Override
public void setVisible(boolean b) {
// fix window focus on macOS
if (SystemUtilities.isMac() && !GraphicsEnvironment.isHeadless()) {
ShellUtilities.executeAppleScript("tell application \"" + Constants.ABOUT_TITLE + "\" to activate");
}
super.setVisible(b);
}
}

0 comments on commit a6c4ee4

Please sign in to comment.
You can’t perform that action at this time.