summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Geiger <lukas.geiger94@gmail.com>2023-04-03 13:51:38 +0100
committerPiotr BrzeziƄski <piotr@centricular.com>2023-05-12 01:11:19 +0200
commit1815061e26db11c5e8cef35e7b5e3e3fb9eb7017 (patch)
tree8cbc26ff11114bc4d566802a35014017557d6919
parentf60c87769fe0aa249b067c13aa6a622621c08b29 (diff)
downloadgstreamer-1815061e26db11c5e8cef35e7b5e3e3fb9eb7017.tar.gz
macos: Set activation policy in `gst_macos_main`
Setting the policy to NSApplicationActivationPolicyAccessory by default makes sure that we can activate windows programmatically or by clicking on them. Without that, windows would disappear if you clicked outside them and there would be no way to bring them to front again. This change also allows osxvideosink to receive navigation events correctly. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4573>
-rw-r--r--subprojects/gstreamer/gst/gstmacos.m3
1 files changed, 3 insertions, 0 deletions
diff --git a/subprojects/gstreamer/gst/gstmacos.m b/subprojects/gstreamer/gst/gstmacos.m
index e0cd09bb93..b930bbb0f6 100644
--- a/subprojects/gstreamer/gst/gstmacos.m
+++ b/subprojects/gstreamer/gst/gstmacos.m
@@ -31,6 +31,9 @@ run_main_with_nsapp (ThreadArgs args)
GThread *gst_thread;
[NSApplication sharedApplication];
+ if ([NSApp activationPolicy] == NSApplicationActivationPolicyProhibited) {
+ [NSApp setActivationPolicy:NSApplicationActivationPolicyAccessory];
+ }
gst_thread = g_thread_new ("macos-gst-thread", (GThreadFunc) gst_thread_func, &args);
[NSApp run];