diff --git a/UI/api-interface.cpp b/UI/api-interface.cpp index 705caaa4ba0d4279a7f492133cfaabfcd1f5bd82..a933a945d32ec60d68d192c8ec6cf1253e707017 100644 --- a/UI/api-interface.cpp +++ b/UI/api-interface.cpp @@ -67,6 +67,11 @@ struct OBSStudioAPI : obs_frontend_callbacks { return (void*)main->winId(); } + void *obs_frontend_get_system_tray(void) override + { + return (void*)main->trayIcon.data(); + } + void obs_frontend_get_scenes( struct obs_frontend_source_list *sources) override { diff --git a/UI/obs-frontend-api/obs-frontend-api.cpp b/UI/obs-frontend-api/obs-frontend-api.cpp index c3c933ab8f2c46a1d5c969203123e9285b100147..f0b9022cf151d92536ecc1e888b8542c90bcbec7 100644 --- a/UI/obs-frontend-api/obs-frontend-api.cpp +++ b/UI/obs-frontend-api/obs-frontend-api.cpp @@ -71,6 +71,13 @@ void *obs_frontend_get_main_window_handle(void) : nullptr; } +void *obs_frontend_get_system_tray(void) +{ + return !!callbacks_valid() + ? c->obs_frontend_get_system_tray() + : nullptr; +} + char **obs_frontend_get_scene_names(void) { if (!callbacks_valid()) diff --git a/UI/obs-frontend-api/obs-frontend-api.h b/UI/obs-frontend-api/obs-frontend-api.h index ae674943a47153aa8085817d7c6e77130c1a29d0..86d53abdc11907afc3ab14bef22cccb3da94e7c4 100644 --- a/UI/obs-frontend-api/obs-frontend-api.h +++ b/UI/obs-frontend-api/obs-frontend-api.h @@ -82,6 +82,7 @@ static inline void obs_frontend_source_list_free( EXPORT void *obs_frontend_get_main_window(void); EXPORT void *obs_frontend_get_main_window_handle(void); +EXPORT void *obs_frontend_get_system_tray(void); EXPORT char **obs_frontend_get_scene_names(void); EXPORT void obs_frontend_get_scenes(struct obs_frontend_source_list *sources); diff --git a/UI/obs-frontend-api/obs-frontend-internal.hpp b/UI/obs-frontend-api/obs-frontend-internal.hpp index b1a90641807455ee404bdd8a378c2e3f21536a5d..331f509ab53d2c8db2c6e51a86c74dd8ebede914 100644 --- a/UI/obs-frontend-api/obs-frontend-internal.hpp +++ b/UI/obs-frontend-api/obs-frontend-internal.hpp @@ -9,6 +9,7 @@ struct obs_frontend_callbacks { virtual ~obs_frontend_callbacks() {} virtual void *obs_frontend_get_main_window(void)=0; virtual void *obs_frontend_get_main_window_handle(void)=0; + virtual void *obs_frontend_get_system_tray(void)=0; virtual void obs_frontend_get_scenes( struct obs_frontend_source_list *sources)=0;