mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-07-02 21:11:03 +12:00
Small macOS fixes
This commit is contained in:
parent
8261f6f7ec
commit
a2364d6f47
|
@ -34,7 +34,7 @@ public class App extends Application {
|
|||
|
||||
// Set dock icon explicitly on mac
|
||||
// This is necessary in case XPipe was started through a script as it will have no icon otherwise
|
||||
if (OsType.getLocal().equals(OsType.MACOS) && AppProperties.get().isDeveloperMode() && !AppLogs.get().isWriteToFile()) {
|
||||
if (OsType.getLocal().equals(OsType.MACOS) && AppProperties.get().isDeveloperMode() && AppLogs.get().isWriteToSysout()) {
|
||||
try {
|
||||
var iconUrl = Main.class.getResourceAsStream("resources/img/logo/logo_128x128.png");
|
||||
if (iconUrl != null) {
|
||||
|
|
|
@ -43,6 +43,8 @@ public class AppLogs {
|
|||
private final PrintStream originalSysOut;
|
||||
private final PrintStream originalSysErr;
|
||||
private final Path logDir;
|
||||
|
||||
@Getter
|
||||
private final boolean writeToSysout;
|
||||
|
||||
@Getter
|
||||
|
|
|
@ -17,11 +17,22 @@ public class MacOsPermissions {
|
|||
var state = new SimpleBooleanProperty(true);
|
||||
try (var pc = LocalStore.getShell().start()) {
|
||||
while (state.get()) {
|
||||
// We can't wait in the platform thread, so just return instantly
|
||||
if (Platform.isFxApplicationThread()) {
|
||||
pc.osascriptCommand(
|
||||
"""
|
||||
tell application "System Events" to keystroke "t"
|
||||
""")
|
||||
.execute();
|
||||
return true;
|
||||
}
|
||||
|
||||
var success = pc.osascriptCommand(
|
||||
"""
|
||||
tell application "System Events" to keystroke "t"
|
||||
""")
|
||||
.executeAndCheck();
|
||||
|
||||
if (success) {
|
||||
Platform.runLater(() -> {
|
||||
if (alert.get() != null) {
|
||||
|
|
Loading…
Reference in a new issue