This commit only contains Qt UI components that are self-contained,
i.e. the translation units only contain code for a single class or
interface and don't mix implementations.
The new Scene Collection code uses the lazy creation behaviour of
OBSBasic::Load, which itself uses obs_data_create_from_json_file_safe.
The internal implementation will create a new scene collection with the
contents of an existing backup file with the same name however, thus
users would end up with a nominally "new" scene collection that
contains contents of an old backup.
This update will remove any existing backup file colliding with the
name of the new, duplicated, or renamed, scene collection and remove it
before activating it (and having OBSBasic::Load create a new one).
When custom module and module data paths are provided via environment
variables, the module paths generated by current code will not be
compatible with the plugin bundle structure used on macOS.
Using environment variables is a simple way to test plugins,
as this allows OBS to discover them from alternative user-provided
locations.
This lambda would be called from the Qt event loop rather than the
original call stack when continuing from an error, resulting in the
captured references being invalid.
To solve this must explicitly use a copy instead of reference capture.
The function InitBasicConfigDefaults2's purpose is to set up encoder-
related settings for a profile, which requires all available encoders
to have been discovered first.
As encoders are added by runtime modules, this also means that discovery
needs to be delayed until after modules have been loaded, but modules
themselves require a valid profile to exist and be loaded.
This leads to the requirement of profiles needing to exist in a
half-initialized state when modules are loaded and only becoming
fully initialized after that.
This distinction is not necessary after the initial launch of obs-studio
because runtime plugins are not hot-loadable, so the update can happen
unconditionally at any time a plugin is changed, which implicitly
couples every call to ActivateProfile with a call to
UpdateProfileEncoders.
Translate window or game capture sources to xcomposite or pipewire
depending on the window system used.
This change prevents xcomposite being assigned on non-X11 systems
which causes a crash
The frontend API events "OBS_FRONTEND_EVENT_SCENE_CHANGED" and
"OBS_FRONTEND_EVENT_PREVIEW_SCENE_CHANGED" are not dispatched if
disableSaving has a value > 0. Prior code decremented disableSaving to
0 globally (regardless of whether saving was necessary, which is only
the case if a new collection is created as a fallback for a missing
scene collection).
Thus the updated code exhibits different event dispatch behavior then
old code which some plugins might have relied on. To avoid introducing
new behavior, explicitly create the environment to allow the dispatch
to take place and remove/refactor the events in a later version.
This widget was created primarily for the custom YouTube chat input and
used solely for that. With the custom YouTube input gone, it serves no
further purpose. If it's needed again in the future, it can be recreated
from the history.
Effectively reverts 5a298106bc.
The custom chat was originally introduced as a workaround because the
ability to chat was always missing due to limitations on YouTube's side.
With the introduction of first-party YouTube chat features in
9b8fa0f0ca, it only has the limited use
case when the user is logged in via the API (in OBS settings), but isn't
logged in in the integration docks. As it's quite a bit of code for not
a lot of value, I think it's worth removing. Users should log in via the
panel instead.
Effectively reverts 3513c78be2.
CEF crashes on shutdown if any browser window remains open during the
shutdown flow. Reproducible 100% of the time on Linux with What's New.
The previous implementation of the What's New dialog correctly deleted
all the Qt widgets, but the CEF internal event flow would only call the
"preparing to close" function, and never the "window safely closed"
function. Moving the code (practically unchanged) to a custom QDialog
solves the problem entirely, and is more consistent with other uses.
On some platforms (e.g. KDE) accelerators are automatically added to
the text properties of QActions, thus changing the value returned by
text().
Thus we cannot rely on the text to always represent the same text that
we set originally and have to explicitly store and retrieve the value
as a property.
Coincidentally this not only fixes possible issues on other platforms,
but is also architecturally more correct.
The old method to update the profile menu iterated over the directory
entries of the profile directory in the order provided by the operating
system.
The system calls used for this explicitly state that the order of items
is "undefined" but seems to have followed a case-insensitive
alphabetical order on Windows, an order which users have come to expect.
The new code uses a std::map to store discovered profiles and scene
collections, which is ordered by key and with std::string used for keys
this means a lexicographical sorting of keys which is case-sensitive.
To restore the old behavior, profiles and scene collections need to be
added to their respective menus sorted by case-insensitive order, which
has to be done manually before adding the items.
That is, leave only the code that was under USE_XDG. Previously the
Linux CMake build defined USE_XDG unconditionally, while it was not set
by the FreeBSD build.
The non-USE_XDG code was broken, and FreeBSD should follow the XDG
convention anyway (in particular, storing config files typically under
$HOME/.config/obs-studio). Defining USE_XDG in the os-freebsd.cmake
files would leave the non-USE_XDG code unused anywhere, so instead just
remove it.
During development on FreeBSD I encountered an uncaught exception abort
from the copy in MigrateGlobalSettings. Catch the error and print a
user-facing message:
error: Unable to migrate global configuration - copy failed.
SetupNewProfile is used to create new profiles when OBS is already
running, which requires resetting program state for the new profile.
This function cannot be used to create a new profile as a fallback
for either a non-existing profile or for a fresh installation of OBS
Studio because by the point this is called from OBSBasic::OBSInit, the
runtime modules are not loaded yet and as such no services exist.
Activating the new profile without a profile reset fixes this issue
as the reset will be done explicitly by OBSBasic::OBSInit later.
cb026964b0 changed most instances of
MuteCheckBox as a selector for the button that mutes/unmutes a source in
the mixer to indicator-mute, but left a few instances of the old
selector, especially in variant themes while the base theme got changed.
This lead to competing selections where apparently indicator-mute won
which meant that the variant themes wouldn't override the base.
Changing all instances of MuteCheckBox to to indicator-mute fixes this
and hopefully prevents future uses of MuteCheckBox as a selector
anywhere.