macOS fixes

This commit is contained in:
crschnick 2024-08-27 15:30:57 +00:00
parent 14867ba09c
commit a49077cc09
2 changed files with 10 additions and 1 deletions

View file

@ -177,10 +177,13 @@ public interface KittyTerminalType extends ExternalTerminalType {
return false; return false;
} }
var time = System.currentTimeMillis();
sc.executeSimpleCommand(CommandBuilder.of() sc.executeSimpleCommand(CommandBuilder.of()
.add("open", "-a", "kitty.app", "--args") .add("open", "-a", "kitty.app", "--args")
.add("-o", "allow_remote_control=socket-only", "--listen-on", "unix:" + getSocket())); .add("-o", "allow_remote_control=socket-only", "--listen-on", "unix:" + getSocket()));
ThreadHelper.sleep(1000); var elapsed = System.currentTimeMillis() - time;
// Good heuristic on how long to wait
ThreadHelper.sleep(5 * elapsed);
return true; return true;
} }
} }

View file

@ -1,7 +1,9 @@
package io.xpipe.app.util; package io.xpipe.app.util;
import io.xpipe.app.core.AppProperties;
import io.xpipe.app.issue.ErrorEvent; import io.xpipe.app.issue.ErrorEvent;
import io.xpipe.core.process.OsType; import io.xpipe.core.process.OsType;
import io.xpipe.core.util.ModuleHelper;
import io.xpipe.core.util.XPipeInstallation; import io.xpipe.core.util.XPipeInstallation;
import com.sun.jna.Library; import com.sun.jna.Library;
@ -24,6 +26,10 @@ public class NativeBridge {
} }
public static Optional<MacOsLibrary> getMacOsLibrary() { public static Optional<MacOsLibrary> getMacOsLibrary() {
if (!ModuleHelper.isImage() || !AppProperties.get().isFullVersion()) {
return Optional.empty();
}
if (macOsLibrary == null && !loadingFailed) { if (macOsLibrary == null && !loadingFailed) {
try { try {
System.setProperty( System.setProperty(