MacOS fixes

This commit is contained in:
crschnick
2023-02-05 19:57:14 +00:00
parent 45b4b84bf3
commit 137c6ff9f8
3 changed files with 29 additions and 19 deletions

View File

@@ -11,6 +11,7 @@ import io.xpipe.core.process.OsType;
import io.xpipe.core.util.XPipeDaemonMode;
import io.xpipe.extension.event.ErrorEvent;
import io.xpipe.extension.event.TrackEvent;
import io.xpipe.extension.util.ThreadHelper;
import picocli.CommandLine;
import java.awt.*;
@@ -75,6 +76,14 @@ public class LauncherCommand implements Callable<Integer> {
con.performSimpleExchange(
OpenExchange.Request.builder().arguments(inputs).build());
}
if (OsType.getLocal().equals(OsType.MAC)) {
Desktop.getDesktop().setOpenURIHandler(e -> {
con.performSimpleExchange(
OpenExchange.Request.builder().arguments(List.of(e.getURI().toString())).build());
});
ThreadHelper.sleep(1000);
}
}
TrackEvent.info("Another instance is already running on this port. Quitting ...");
OperationMode.halt(0);

View File

@@ -5,6 +5,7 @@ import io.xpipe.app.core.mode.OperationMode;
import io.xpipe.core.impl.FileStore;
import io.xpipe.extension.DataSourceProvider;
import io.xpipe.extension.event.ErrorEvent;
import io.xpipe.extension.event.TrackEvent;
import io.xpipe.extension.util.ActionProvider;
import lombok.Getter;
import lombok.Value;
@@ -20,6 +21,8 @@ import java.util.List;
public abstract class LauncherInput {
public static void handle(List<String> arguments) {
TrackEvent.withDebug("launcher", "Handling arguments").elements(arguments).handle();
var all = new ArrayList<ActionProvider.Action>();
arguments.forEach(s -> {
try {