From 5af5c75108d717f5d94ae3cbde892456d70d62fc Mon Sep 17 00:00:00 2001 From: Wojtek Mach Date: Fri, 20 May 2022 14:27:04 +0200 Subject: [PATCH] Run Mac app in the background (#1199) --- app_builder/lib/app_builder/macos.ex | 9 +++++++-- mix.exs | 8 +++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/app_builder/lib/app_builder/macos.ex b/app_builder/lib/app_builder/macos.ex index 2c4976887..be6c2e8a4 100644 --- a/app_builder/lib/app_builder/macos.ex +++ b/app_builder/lib/app_builder/macos.ex @@ -98,7 +98,8 @@ defmodule AppBuilder.MacOS do :info_plist, :url_schemes, :document_types, - :additional_paths + :additional_paths, + :is_agent_app ]) app_name = Keyword.fetch!(options, :name) @@ -301,7 +302,11 @@ defmodule AppBuilder.MacOS do <% end %> - + <%= if options[:is_agent_app] do %> + LSUIElement + + <% end %> + """ diff --git a/mix.exs b/mix.exs index 73435dbde..075d1cb29 100644 --- a/mix.exs +++ b/mix.exs @@ -192,12 +192,18 @@ defmodule Livebook.MixProject do ] defp build_mac_app(release) do - AppBuilder.build_mac_app(release, @app_options) + options = + [ + is_agent_app: true + ] ++ @app_options + + AppBuilder.build_mac_app(release, options) end defp build_mac_app_dmg(release) do options = [ + is_agent_app: true, codesign: [ identity: System.fetch_env!("CODESIGN_IDENTITY") ],