58 Commits
Author SHA1 Message Date
Warchamp7 ff9b4eb099 frontend: Fix transition duration not loading correctly 2025-12-12 13:44:47 -05:00
Warchamp7 e3df8722bd frontend: Switch off deleted scenes immediately 2025-12-12 13:08:40 -05:00
Warchamp7 34a0a6a530 frontend: Remove crash handler earlier in shutdown 2025-12-04 15:05:23 -05:00
Dennis Sädtler 606e1932b8 frontend: Fix recursion during canvas removal causing crashes 2025-12-03 15:10:44 -05:00
Warchamp7 14572498dc frontend: Adjust application shutdown logic
Improves app shutdown in a few ways, including separating out different
pieces of the OBSBasic close handler into their own functions.

Removes the crash handler sentinel earlier when the main window is closed,
preventing unclean shutdown warnings when a plugin causes issues. While not
ideal, the dialog is not useful when we cannot specify which plugin caused the
problem.

Increases shutdown priority of the main application so that when OBS interrupts
the session ending, CEF is not closed at the same time. This fixes a crash.

Additional safeguards and event handling to try to ensure a smoother shutdown.
2025-12-01 16:40:34 -05:00
Richard Stanway efca325c2c frontend, plugins: Set default bitrate to 6000 kbps
The default of 2500 kbps was chosen 10 years ago and times have changed.
Logs and forums posts show that many users of OBS for recording don't
change their bitrate and end up with a 2.5 mbps recording which looks
terrible.

Now that service bitrate enforcement exists, this will be automatically
capped to the maximum bitrate for streaming services, so the only time
this should result in a problem is if the user's upload speed is the
limiting factor, hopefully rarer these days with increasing internet
speeds.
2025-09-17 19:56:04 -04:00
derrod 2c65cb82ea frontend: Remove "BETA" from Hybrid MP4/MOV and make them the default 2025-09-12 15:45:57 -04:00
Sebastian Beckmann fca07b4ce4 frontend: Include OBSIdianPlayground MOC
Also puts the include in the correct place in OBSBasic_MainControls.
2025-09-04 14:17:02 -04:00
FiniteSingularity 23b67268e7 frontend: Provide UI for phase 1 of plugin manager
For phase 1 of the plugin manager, the ability to toggle off/on plugins
to be loaded at launch is provided.

This commit adds a new Plugin Manager dialog which can be accessed from
the Tools menu, which shows a list of all installed 3rd party plugins
with a checkbox to toggle them off or on.  If a change is made, the user
is prompted to restart OBS. To allow this, the plugin manager uses a
json based config file stored in the OBS config directory. Additionally
for sources in the source tree, a sample UI has been provided that
indicates any sources whose parent module is disabled, by turning its
title red.
2025-08-28 14:29:10 -04:00
PatTheMav c8ec906844 frontend: Change overflow texture rendering to be sRGB-aware
Current code assumes that the overflow texture and the render target
always share the same color format including transfer function.

This assumption is incorrect however as OBS might use a 16-bit floating
point texture with a linear gamma transfer function when a high-bitrate
format is selected. On top of that OBS Studio wants rendering code to
ensure that linear color blending is used throughout the application.

The DrawOverflow function had not been updated to reflect this. This
change brings it in line with other functions involved in preview
rendering, which enable automatic sRGB conversion for the framebuffer
and the texture used in the fragment shader.
2025-08-24 15:29:33 -04:00
tytan652 ffcc3acd9d frontend: Replace transition duration spinbox direct access 2025-08-22 16:48:23 -04:00
tytan652 d22ddfd395 frontend: Reduce reliance on transition indexes 2025-08-22 16:48:23 -04:00
tytan652 2962770813 frontend: Replace transitions combobox direct access 2025-08-22 16:48:23 -04:00
tytan652 11562b6696 frontend: Remove some shadowing 2025-08-22 16:48:23 -04:00
Sebastian Beckmann de9fcd6b42 frontend: Unify naming of Idian Playground
It's called Idian Playground in some places and Widget Playground in
others. Idian Playground is more precise so let's use that.
2025-08-22 16:21:52 -04:00
Warchamp7andderrod e8f6143769 frontend: Add new Idian widgets
Co-Authored-By: derrod <rodney@rodney.io>
2025-08-22 16:21:52 -04:00
PatTheMav de997b1e2f frontend: Update crash handling and log upload functionality
Updates include:

* Use of CrashHandler to provide automatic uploads of the most recent
crash log if an unclean shutdown was detected and it has not been
uploaded yet.
* Detection and handling of unclean shutdowns is delegated entirely to
the CrashHandler class
* Use of OBSLogReply has been replaced with the LogUploadDialog, which
asks for confirmation before new uploads of log files (confirmation is
skipped for files with available upload URLs already - only available
for crash logs with this change)

Architectural changes:
* OBSApp is the layer responsible for application launch and shutdown
states, as well as crash logs and application logs
* The actual handling is delegated to purpose-made classes which OBSApp
owns instances of
* OBSBasic in turn refers to OBSApp for all this functionality, and can
subscribe/connect to appropriate events exposed by OBSApp to this
purpose
* Implementation details (like the existence of the CrashHandler class)
are not exposed to OBSBasic or the LogUploadDialog

The amount of changes for normal log file upload have been purposefully
limited. A proper refactoring of the application log file handling will
move this code out of OBSBasic as well.
2025-08-22 15:38:12 -04:00
derrod 4c05feed69 frontend: Make Hybrid MOV the default for beta builds on macOS 2025-08-21 18:14:33 -04:00
Sebastian Beckmann 5730f86050 frontend/api: Remove obs_frontend_add_dock
Deprecated since cde5545f8f (30.0).
2025-08-20 18:05:15 -04:00
cg2121 33e8a23386 frontend: Auto release OBSDataArray objects
Makes sure that all obs data array objects in cpp files are using
auto release RAII wrappers.
2025-08-20 12:59:53 -04:00
Sebastian Beckmann 268e30a52b frontend: Remove unused macOS window icons
Commit [1] originally made a differentiation between the operating
systems for the window icon. However, on macOS the window icon is only
respected for the main window (and used for the entire app, as windows
themselves don't have icons), and that got removed in [2]. This means
that this code doesn't actually do anything anymore, and thus should be
removed.

[1] 9ac92f61be
[2] 4afafaac6d
2025-08-19 14:48:06 -04:00
Sebastian Beckmann d3c5d2ce0b frontend: Set Frontend-API QActions role to NoRole
When no role is set, the default is QAction::TextHeuristicRole. This
means that the text of the item gets fuzzy-matched in Qt against a set
of possible strings that could indicate that the menu should be in the
application menu on macOS.
For us this meant however that on some languages, the translation of
"WebSocket Server Settings" would begin with "Config", and as such the
related QAction replaces our "Settings" action for the PreferencesRole,
and clicking "Preferences..." in the application menu would open the
websocket settings. It should probably be considered a bug in Qt that
implicit matches via TextHeuristicRole can overwrite ones that are
explicitly set (like our PreferencesRole). However we explicitly set our
roles ourselves anyways and there is no scenario where a  plugin should
overwrite them, we can just default actions added via the Frontend API
to be NoRole; and worry about the Qt bug later.
2025-06-16 15:20:41 -04:00
PatTheMav 059fd6210c frontend: Fix visibility issues of meta type stream operators
For custom types to become usable as QVariants they not only need to
be declared as meta types, but also need to have appropriate stream
operators declared.

These declarations (both of the meta type itself, which provides a
static meta type ID getter via the macro, as well as the operators)
need to be visible to the compiler in any compilation unit where they
might be used in their QVariant form, otherwise the templates will
be incomplete.

A blanket include of "qt-wrappers.hpp" in "OBSBasic.hpp" is not the
most subtle fix, but it's necessary to ensure that the meta types
are always "complete". Putting both declarations in the qt-wrappers
header (instead of splitting them up) ensures that (as the classes
themselves are declared in "obs.hpp", which is included by
"qt-wrappers.hpp", and thus qt-wrappers can provide a complete class.
2025-06-16 14:44:27 -04:00
PatTheMav 8b7331642f frontend: Fix metatype declaration for scenes' SignalContainer
To be used as a QVariant, stream operators need to be provided
as the meta type will otherwise be considered "incomplete". These were
implemented before the frontend reorganization but not migrated as part
of it.
2025-06-04 14:15:11 -04:00
Warchamp7 dd71444069 frontend: Update projector menu for disabled preview 2025-06-04 12:30:51 -04:00
Ryan Foster 9bd4514b45 frontend: Ensure cookie ID is always 16 hexadecimal characters
At a glance, the GenId function looks like it can only return a
16-character hexadecimal string with all characters being [0-9A-F].
However, it seems that it can rarely return a 16-character string that
has one or two space characters at the beginning due to the value of id,
from which the final string is derived, being too low (lower than
1152921504606846976 or 0x1000000000000000) and the printf format
specifier having a width of 16. This results in a string of less than 16
characters that is padded with blank spaces. The end result is a cookie
directory that has leading spaces in its name, which can cause various
issues, such as breaking syncing on OneDrive.

If we set the format specifier to pad with zeroes instead of spaces, the
resulting hexadecimal value is always 16 characters long without spaces.
2025-05-28 12:42:22 -04:00
shiina424 b4e8fa78fb frontend: Fix multiview translation string 2025-05-22 16:55:49 -04:00
Exeldro cae8d8a3da frontend: Fix canvas remove event 2025-05-21 11:45:14 -04:00
tytan652 b65ee89451 frontend: Use winId for Wayland surface in Qt 6.9+
As of Qt 6.9, winId return a wl_surface pointer which allows us to move
away completely from QPlatformNativeInterface.

https://github.com/qt/qtwayland/commit/32f9b4d
2025-05-13 14:40:31 -04:00
PatTheMav 16216b2e30 frontend: Fix character encoding issue during profile import
The directory name string passed into libobs functions needs to be
converted into a 8-bit-based encoding (e.g., UTF-8) to avoid mangling
of characters and encoding issues particularly on Windows systems which
use UTF-16 for file names.
2025-05-07 14:58:38 -04:00
cg2121 d7cce79d7e frontend: Use static_cast when casting from void pointers
Using static_cast is preferred here, as it is safer to use than
reinterpret_cast.
2025-05-05 20:47:10 -04:00
cg2121 345fe56b6e frontend: Make sure all QObject subclasses have Q_OBJECT macro
Went through and found all QObject subclasses that didn't have
a Q_OBJECT macro.
2025-05-05 13:10:39 -04:00
Dennis Sädtler 368185019e frontend: Add support loading/saving additional canvases 2025-05-02 14:35:22 -04:00
gxalpha 281f8137f5 UI,libobs,obs-outputs: Remove HAVE_OBSCONFIG_H ifdefs
With the removal of all legacy code paths, obsconfig.h always exists and
the compile definition always gets set. As such, it's no longer
necessary to check for it.

As removing the definition itself could be seen as a breaking change,
this simply moves the definition to pc.in and cmake.in files for now to
preserve the value for plugins that might expect this to be set. We may
remove the definition entirely in a later release.
2025-04-30 13:05:35 -04:00
Norihiro Kamae 1643470a85 frontend: Add dedicated translation of remaining time 2025-04-28 13:06:03 -04:00
gxalpha 76e1818866 frontend: Highlight control dock buttons using style class
Checkable buttons are troublesome because QAccessible interprets them as
checkboxes, and doesn't pass the "clicked" signal to them (see
QTBUG-110737). Instead, we only get the "toggled" signal, which also
gets triggered by things other than user input (i.e., the button getting
changed by the program).

Making them uncheckable means that they behave like normal buttons
again. To style them, we can just add a class and address them that way.
Note that uncheckable here means *actually* not checkable - unlike the
cursed NonCheckableButton class previously used that makes a button
that *is* checkable ignore the user input (and only allow check state
changes via code, effectively making it solely a styling tool).
2025-04-24 15:37:50 -04:00
Lain 9b0ac7c01c frontend/widgets: Optimize preview primitive rendering
Certain draw calls were creating/destroying vertex buffers. Every call.
That's kind of not a great thing to do, so instead use the new
gs_draw_quadf() function to optimize rendering and reduce the need for
swapping vertex buffers.

Also uses a shader for DrawStripedLine so it does not have to split it
up into separate draw calls.
2025-04-23 15:23:29 -04:00
Warchamp7 13b3c8d033 frontend: Clean up various strings 2025-04-23 14:46:51 -04:00
Lain 7f09344989 frontend/widgets: Fix integer overflow
If the crop values combined are larger than the width or height of the
source, an integer overflow will occur.

This fix converts the width/height values to int, and then clamps
any negative values to 0.
2025-04-23 14:07:09 -04:00
PatTheMav cce189011e frontend: Migrate scene collection usage to new SceneCollection class 2025-04-21 15:17:11 -04:00
Warchamp7 69ecfcd9f6 frontend: Reorganize Preview/Source context menu 2025-04-15 15:00:43 -07:00
cg2121 86f7475f14 frontend: Add preview zoom controls 2025-04-01 17:31:09 -04:00
Warchamp7 ca762b9460 frontend: Remove Exit button (#11887) 2025-03-24 17:57:44 -04:00
PatTheMav 577e3504d5 frontend: Only emit frontend events for existing scene collection
To emit frontend events early during OBS' initialization, the
disableSaving state variable needs to be "falsy" (as events will not be
emitted otherwise).

The code path taken for generating a new fallback scene collection
has disableSaving decremented to "enable" saving (and thus frontend
events) already, so it's just the code paths for existing collections
that need this workaround.

Emitting the scene changed and preview scene changed events when a
fallback scene collection has been created has side-effects when
OBS Studio is set to studio mode and can lead to potential crashes,
as the studio mode is still in an invalid state at this point.
2025-03-20 15:05:42 -04:00
Chris (Flaeri) 08f2374b44 frontend: Round up Resize Output (Source Size)
This is to ensure usable resolutions, and conform to existing paradigms.
See https://github.com/obsproject/obs-studio/commit/21ec81ebcc43e465160fcc880e4088c64d407a23
2025-02-05 15:50:56 -05:00
cg2121 4e8b131509 frontend: Use OBSBasic::Get() in all places
This reduces duplicated code when getting the OBSBasic context.
2025-02-05 15:15:52 -05:00
gxalpha a562b8bf52 frontend: Add Input Monitoring to permissions dialog
The previous commit switched global hotkeys from requiring Accessibility
to just Input Monitoring permissions. This adds the matching changes to
the permissions dialog, also accounting for the fact that Accessibility
includes Input Monitoring.
2025-02-05 14:33:06 -05:00
cg2121 43be123b73 frontend: Simplify how projectors are saved/loaded
This removes unnecessary code when loading and saving projectors.
2025-01-31 12:20:33 -05:00
cg2121 708c5f7426 frontend: Remove unnecessary projector variable
This variable is not needed, as there is a screen() function.
2025-01-30 15:16:24 -05:00
Dennis Sädtler 7e24a6093c frontend: Restart multitrack output if stream key has become invalid 2025-01-29 13:16:47 -05:00