DEP: Enable DEP as it's still opt-in even on Windows 10. No OBS code or
plugins should be executing data as code and this is an important
mitigation against stack-based buffer overflows.
ASLR: Enable and force ASLR. This makes it harder for any potential
exploits to use fixed offsets into OBS or Windows DLLs to run gadgets.
Extension Points: Disable extension points. These are typically used for
system-wide code injection, and we have generally had trouble with
various things injecting into OBS and causing issues.
Handle Check: Enable strict handle checks when running debug builds.
This will raise an exception if we operate on an invalid handle,
something that should hopefully not ever happen in the current code.
The Yami theme provides colours for checked QPushButtons, but does not
do the same for checked QToolButton. This commit adds colors for the
QToolButton:checked: state that match the QPushButton:checked: colors
To support upgrades from older versions move_to_xdg was reintroduced for
FreeBSD. This has now been available since release 31.0, so users have
likely upgraded across this version and it is no longer needed.
This reverts commit 39b91d8875.
QT_TO_UTF8 returns a const char * that, in general, shouldn't be stored.
This is because QT_TO_UTF8(str) expands to str.toUtf8().constData():
toUtf8() returns a QByteArray, and constData() the pointer to its data
which is only valid until the QByteArray goes out of scope, which is
immediately after the call.
The original code that is changed here only works because in all of the
situations, the object that is stored to is actually a std::string that
gets constructed implicitly, so the constData() pointer is valid long
enough for the std::string constructor to copy the data.
The issue is that any "... = QT_TO_UTF8" code *looks* unsafe, and may
lead new or unfamiliar contributors to assume that they can also use it,
only to do "const char *... = QT_TO_UTF8(...)" which is dangerous.
Additionally, it introduces an unnecessary round of implicit conversions
and copies when QString.toStdString() already exists and copies into the
string buffer directly.
The strings (broadcast.id, stream.[id|name]) are stored as QString,
converted to const char * by QT_TO_UTF8 in OBSYoutubeActions, implicitly
converted back to QString because the OBSYoutubeActions::ok takes
const QString &, only to be converted back to const char * by QT_TO_UTF8
in OBSBasic_YouTube and immediately implicitly turned into
const std::strings, only to have .c_str() called on those to get their
const char * again which is needed for libobs. This is insane.
Let's just pass const std::string & and be happy.
RemoteTextThread and WhatsNewInfoThread explicitly convert their results
into QString, but many consumers need std::string, converting them
back. Let's just use std::string directly and only convert to QString
where actually needed.
While it is canonical to use the backspace key as an alternative to the
dedicated "delete" key (which is omitted on many smaller-sized Apple
keyboards), the delete key is still available on full-size Apple
keyboards and obviously third-party keyboards.
This change adds the delete key as an alternative to the backspace key
to allow removal of scene items from the scene list in the UI.
This issue was brought back by a somewhat recent change to fix slow
shutdown times in Linux.
To paraphrase tfo from the OBS Discord:
"I think the issue is that all the tray actions are parented to
trayIcon, so when it's deleted, Qt auto deletes them as children, then
delete trayMenu on the next line accesses those dead actions."
We now create the tray menu first, then setting the parent of the
actions (show / hide, stop / start streaming, etc.) to the tray menu.
Strip the PDB. Provide an alternate path for the PDB.
We already use /PDBALTPATH for set_target_properties_obs, but this
target understandably does not use that.