From 18a35f17e2f36a9af0f647f04f08b6b5b56e10e4 Mon Sep 17 00:00:00 2001 From: der richter Date: Mon, 14 Sep 2020 17:27:43 +0200 Subject: mac: add an option to prevent focusing of the window on open on macOS 10.15 setting the activation policy behaves quite weirdly. the call changes the current active App to a nameless process, which probably also the reason that prevents the not focusing to work. a workaround for that, is to refocus the previous active app. Fixes #7725 --- options/options.c | 2 ++ options/options.h | 1 + 2 files changed, 3 insertions(+) (limited to 'options') diff --git a/options/options.c b/options/options.c index e1bc5a3c47..6da8e7fbef 100644 --- a/options/options.c +++ b/options/options.c @@ -121,6 +121,7 @@ static const m_option_t mp_vo_opt_list[] = { {"window-scale", OPT_DOUBLE(window_scale), M_RANGE(0.001, 100)}, {"window-minimized", OPT_FLAG(window_minimized)}, {"window-maximized", OPT_FLAG(window_maximized)}, + {"focus-on-open", OPT_BOOL(focus_on_open)}, {"force-window-position", OPT_FLAG(force_window_position)}, {"x11-name", OPT_STRING(winname)}, {"wayland-app-id", OPT_STRING(appid)}, @@ -199,6 +200,7 @@ const struct m_sub_options vo_sub_opts = { .ontop_level = -1, .timing_offset = 0.050, .swapchain_depth = 3, + .focus_on_open = true, }, }; diff --git a/options/options.h b/options/options.h index 9b93588bec..68f8bed052 100644 --- a/options/options.h +++ b/options/options.h @@ -19,6 +19,7 @@ typedef struct mp_vo_opts { int all_workspaces; int window_minimized; int window_maximized; + bool focus_on_open; int screen_id; int fsscreen_id; -- cgit v1.2.3