Another call to getenv, as well as a call to the POSIX functions
setenv(), unsetenv(), and putenv() may invalidate the pointer
returned by a previous call or modify the string obtained from a
previous call.
https://en.cppreference.com/w/c/program/getenv
Selection state can change by main thread while UI thread (which
calls DrawSpacingHelpers) tries to evaluate the amount of selected
items. Get amount of selected items by enumerating over the scene data
instead (which stays within the graphics thread).
The old preset "mq" was "Max Quality", which used the old HQ preset with
two-pass enabled. The old preset "hq" was "Quality", which used the old
HQ preset without two-pass. Of the two, "mq" would have been considered
"slower" or "higher quality" than "hq", so let's swap these entries.
Casting a floating point type to an integer type has undefined behaviour
if the value does not fit into the destination type.
As the volume meter is initialized with floats values representing +inf
(as makes sense for a dB meter), values should be explicitly clamped
to integer boundaries.
When the Advanced Output configuration is set to use custom FFmpeg
output, automatic remuxing is disabled. Unfortunately this check will
also take place even if Simple Output is used (as the value is set in
the configuration data, but is not "active").
This check ensures that the check for custom FFmpeg output is only
applied when Advanced Output is enabled.
In the scene tree, we currently prevent deselecting items by
automatically reselecting a new one to workaround a regression in Qt 6.2
that would let users unselect items even in SingleSelection QItemViews.
When clearing however, we explicitly want to unselect the currently
selected item, so we should avoid reselecting it in the SceneTree.
The icons had the wrong name in the qss files. The docks were missing
the icons on at least Linux. I have no idea why the dock icons still
worked on Windows though.
Deleting a filter will trigger a visibility change, which will also
trigger a focus change if the focus has not been on the list itself
(e.g. after interacting with the property view).
When an async filter list is available in the view, it will be the first
candidate to receive focus. If this list is empty, we hide the property
view by default and set the view to a `nullptr`.
When the call for the visibility change returns, we need to check for
this possibility, as another event might have hidden (and deleted) the
view already.
Without this change the decay rate would only be updated when an audio
source is added or when the volume meter itself is changed (e.g. from
horizontal to vertical layout).
- Make the settings a scroll area. This makes it work on smaller screens and
if more items are added in the future, the dialog doesn't get bigger.
- Made the additional settings label bold to distinguish better.
Also removed the colon, as I felt it wasn't needed because it is
now bold.
- Made the margins consistent between the settings and events pages
- Made the scrollbar show only when needed in the events page
- Moved the remember settings checkbox to the top of the settings because
it just seems better to be there.
The Enter key is connected to the `Edit` function and is handled by
Qt with the highest priority in its key event handler. Alas the boolean
return value is not propagated to the shortcut handling system, so
the key event will always be consumed and as such the user will be stuck
in editing state.
To fix this, `Edit` needs to behave like a toggle, saving the current
state of the input at a repeat press of Enter while in editing state.
By default Qt will hand off key events to platform-native input methods
on macOS because the OS or additional software can intercept key input
and transform it (e.g. the international variations popping up when
holding down the key for certain letters).
This functionality can lead to certain key combinations being ignored
because they don't call the delegate methods implemented by Qt to
handle the input after it's been interpreted by the Input Method.
Disabling Input Methods for hotkey input fields fixes this issue, as the
native input methods are bypassed entirely and the key events are
handled by the widget and its keyboard events directly.
This significantly improves undocking behaviour on macOS for most docks.
Previously, undocking would perform an undock rather than undock + drag.
This does not fix the behaviour for browser docks as they are native.
May also improve performance of the main window, regardless of dock state.
See 3224c6d7d1
Due to QTBUG-106395, sources or scenes that are drag-and-dropped into
the spacing between other sources and scenes would currently go to the
bottom of the list, leaving users confused. Until that is fixed, we have
to remove this spacing.
The call in scene-tree.cpp was redundant anyways, should this commit get
reverted in the future it doesn't need to be re-added.
OBS only populates the extraBrowserDocks list if `cef` is valid. By
saving docks regardless of whether `cef` is valid, this can result in
the user's custom docks being cleared unexpectedly.
vsnprintf is called twice; one call must use args, and one must use
args2 (which is how it was supposed to be from the beginning). Each call
"consumes" its va_list parameter, so they each need to use a separate
copy. Fixes potential corruption and/or crashing when calling vsnprintf.
OBS Studio 28 no longer supports Windows 7, 8, or 8.1, and Qt 6 will
fail to run on those versions. Users on those systems being offered the
update will end up in a state where OBS will not run if they install the
update. Let's prevent the updater executable from running on those
versions to avoid that scenario.
Do to multithreading the update process, files of the same hash can
sometimes collide due to race. Ensure the filenames are all unique by
appending an incremented value for each file.
The original change in obsproject/obs-studio#7200 seems to have been
based upon the idea that if the "selected" parameter has no values, then
the "deselected" parameter must have values, which is clearly an unsafe
assumption to have make given that it causes an assert crash in Qt when
both parameters have 0 values contained within them.