Use weak references on OBS objects that properties view reference in
order to ensure that the objects are still valid.
This fixes a crash where properties views would use objects without
necessarily knowing whether they were still valid or not.
Fixesobsproject/obs-studio#5862Closesobsproject/obs-studio#5863
Removing the first call to `video_output_stop` prevents the `data_mutex`
field in `struct video_output` from being destroyed while still in use.
The `render_preview_source` function will call `video_output_lock_frame`
upon that mutex and encounter a NULL pointer exception.
For some reason, SetWindowDisplayAffinity can make windows visible even
when it sets the same value for affinity that GetWindowDisplayAffinity
reports. Possibly an API bug as this is probably not a widely used API
yet?
Fixes a weird window with no size appearing when browsing for files on
Windows.
OBS_PROPERTY_GROUP creates neither a widget nor a label, causing
AddProperty to create a default one. Without a widget, it does not
get attached to the layout, resulting in a memory leak.
This commit also simplifies a bit of the code to avoid repeatedly
testing the same condition.
They detection for this was not checking the n selected items but the
first n items in the list, which would lead to the options being enabled
or disabled based on the whether other items were locked.
This uses the SetWindowDisplayAffinity API to hide windows from capture
applications (including OBS). This is not perfect - internal windows
such as context menus, combo box dropdowns, etc will still be displayed.
Even with these limitations, it should help people with single monitors
capture content with less interference from the OBS window.
This implementation is for Windows only but the code is generic enough
that adding other platforms should be straightforward.
This needs to match the base name of the .desktop file name.
This is needed for propagating the correct App ID on Wayland,
which is needed e.g. for proper window icons on Plasma.
If streaming and recording was selected in the Auto-Configuration
Wizard, a memory leak would occur. When obs_service_resolution appeared
elsewhere in C++ files, it used a BPtr. Use BPtr here too.
Reordering the filters makes the filter mutex of the source locked
while loading a new the properties of a filter which may require other
locks. By loading the properties of the filter on a QueuedConnection
we make sure the filter mutex is cleared when that happens.
Rather than showing the main window, then hiding it again when the
tray icon initialization happens, just don't show the main window.
When deciding whether to show the window, we need to know whether
the tray icon is available or not - if it's not and we don't show
the window, there would be no way to restore OBS.