macos: Set activation policy in osxvideosink and glimagesink
Upon creating a window, glimagesink and osxvideosink now set the policy to NSApplicationActivationPolicyRegular, which lets us show an icon in the Dock for convenience and appear in the top menu bar like other apps. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4573>
This commit is contained in:
parent
1815061e26
commit
5e45a1b1bd
@ -236,6 +236,8 @@ gst_gl_window_cocoa_create_window (GstGLWindowCocoa *window_cocoa)
|
||||
gst_gl_window_cocoa_set_window_handle (window,
|
||||
(guintptr) priv->external_view);
|
||||
|
||||
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -84,7 +84,6 @@ static void
|
||||
gst_osx_video_sink_call_from_main_thread(GstOSXVideoSink *osxvideosink,
|
||||
NSObject * object, SEL function, NSObject *data, BOOL waitUntilDone)
|
||||
{
|
||||
|
||||
NSThread *thread;
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
@ -148,6 +147,10 @@ gst_osx_video_sink_osxwindow_create (GstOSXVideoSink * osxvideosink, gint width,
|
||||
@selector(createInternalWindow), nil, YES);
|
||||
GST_INFO_OBJECT (osxvideosink, "No superview, creating an internal window.");
|
||||
}
|
||||
|
||||
gst_osx_video_sink_call_from_main_thread (osxvideosink, osxvideosink->osxvideosinkobject,
|
||||
@selector(setActivationPolicy), nil, YES);
|
||||
|
||||
[osxwindow->gstview setNavigation: GST_NAVIGATION(osxvideosink)];
|
||||
[osxvideosink->osxwindow->gstview setKeepAspectRatio: osxvideosink->keep_par];
|
||||
|
||||
@ -659,6 +662,11 @@ gst_osx_video_sink_get_type (void)
|
||||
|
||||
}
|
||||
|
||||
- (void) setActivationPolicy
|
||||
{
|
||||
[NSApp setActivationPolicy: NSApplicationActivationPolicyRegular];
|
||||
}
|
||||
|
||||
- (void) setView: (NSView*)view
|
||||
{
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
@ -814,7 +822,6 @@ no_texture_buffer:
|
||||
static gboolean
|
||||
plugin_init (GstPlugin * plugin)
|
||||
{
|
||||
|
||||
if (!gst_element_register (plugin, "osxvideosink",
|
||||
GST_RANK_MARGINAL, GST_TYPE_OSX_VIDEO_SINK))
|
||||
return FALSE;
|
||||
|
Loading…
x
Reference in New Issue
Block a user