Commit graph

139 commits

Author SHA1 Message Date
Richard Stanway 2727dd96bd UI: Handle prefixes when using paths in recording format
The replay buffer and screenshot functions add a prefix to the output
filename. The code in GetFormatString assumed the format string was the
entire filename, and inserted the prefix at the beginning. This caused
illegal paths such as "Screenshot /2021/05/22-35.mkv" to be created if
the user had specified a path in the format string, resulting in lost
files.

This commit inserts the prefix before the last / character to ensure it
only affects the filename portion of the format string.

Fixes #4707
2021-07-24 22:34:44 +02:00
tt2468 502bc3bf0a UI: Add startup flag to disable missing files window
Adds a startup flag (--disable-missing-files-check) to disable the
missing files dialog from appearing on load. For some users, the
missing files dialog may interfere with automation of OBS, or the
user may also purposefully have missing files in their scene
collection which they do not want to be warned about.
2021-07-09 18:32:56 +12:00
Kurt Kartaltepe 346e268a3d UI: Remove x11info dependency
This moves X11 platform to the qt private functions, as x11info was
removed from Qt6 so this is required for a clean Qt5/6 transition.

This is the implementation of x11info::getdisplay so it should still
work on older platforms. This "API" doesnt really guarantee anything
though.

Also clean up wayland only bits as we use them for all windowing systems
now, and the name of the native pointer we want is the same on both
platforms for now.
2021-03-16 18:50:52 -07:00
Georges Basile Stavracas Neto 7e36331c98 UI: Only set AA_DontCreateNativeWidgetSiblings on Wayland
It seems this introduced various regressions on X11 (and, potentially, on other
platforms too, but needs confirmation). Let's preserve the old ways on current
platforms, and only use this flag on the new Wayland platform.
2021-03-16 01:48:29 -07:00
Ryan Foster 7214feba73 UI: Set Qt::AA_UseHighDpiPixmaps only on Qt5
Qt6 enables Qt::AA_UseHighDpiPixmaps by default and will emit a warning
if you try to enable it. To prevent the warning, only set this on Qt5.
2021-03-09 10:28:19 -05:00
Ryan Foster 1793515bbf UI: Explicitly include QFile
Explicitly include QFile to prevent a build failure with VS2019 and Qt6.
2021-03-09 09:31:10 -05:00
Georges Basile Stavracas Neto 2b3cb54771 libobs: Add a Wayland platform
Introduce the OBS_NIX_PLATFORM_WAYLAND enum value, and try to detect
it when OBS Studio runs by looking into the platform name.
2021-02-09 09:39:04 -03:00
Georges Basile Stavracas Neto 27d0182fdb UI: Set the Unix platform on startup
Move the OBS_USE_EGL environment variable check to obs-app.cpp,
and set the OBS platform to be either OBS_NIX_PLATFORM_X11_GLX
or OBS_NIX_PLATFORM_X11_EGL.
2021-02-01 19:05:11 -03:00
Georges Basile Stavracas Neto 506b950d02 libobs: Introduce the concept of a Unix platform
This is a Unix-specific code. The only available platforms
at this point are the X11/GLX and X11/EGL platforms.

The concept of a platform display is also introduced. Again,
the only display that is set right now is the X11 display.
2021-02-01 19:05:10 -03:00
Lordmau5 5b899788da UI: Add launch parameter to disable high-DPI scaling 2021-02-01 05:44:37 -08:00
Georges Basile Stavracas Neto f12dbc87b8 UI: Don't define QT_NO_GLIB
The same reasoning of the previous patch means we can also stop
force-disabling Qt/GLib integration.
2021-01-28 23:58:13 -08:00
David Edmundson 4a32d1cec5 UI: Don't create native widget siblings
Native windows really only make sense for previews. They can be a new
xcb_window or a wayland subsurface.

For historical reasons setting a widget to native will also affect
ancestors. Qt will still draw them as part of the parent as they are
never mapped, but a window is nonetheless created.

This is especially problematic on wayland as then the subsurface is
parented to an unmapped window.

This default behaviour can be turned off. Now only the native widgets
(the video previews) are actually native.
2021-01-26 09:43:16 -08:00
Matt Gajownik 46118470ab UI: Only apply passthrough DPI scaling on Windows
Fixes #4031

It seems Qt on various flavours of Linux behaves erratically when scaled,
and for the moment macOS doesn't require fractional scaling support.

This commit can be reverted when Qt fixes issues on their side.
2021-01-13 20:26:35 +11:00
Ryan Foster 9b1d1c1b3d UI: Make GetUnusedSceneCollectionFile usable elsewhere 2021-01-11 14:49:59 -08:00
pkv c8155d491d UI: Enable HW acceleration switch for browser sources on Mac
This enables in Settings the checkbox for hardware acceleration for
Browser Sources in MacOs.
2020-12-18 18:13:35 +01:00
Ryan Foster 1bb71e1f7f UI: Use Qt::MiddleButton instead of deprecated Qt::MidButton 2020-12-01 10:54:21 -05:00
Matt Gajownik e08a8fc356 UI: Don't round non-integer High DPI scale
This fixes an issue on Windows where loading on a
150% scale display renders OBS windows at 200%.

Reference: https://doc.qt.io/qt-5/qguiapplication.html#setHighDpiScaleFactorRoundingPolicy
2020-11-28 11:08:11 +11:00
VodBox 89b4e9136f UI: Various screen reader fixes
This commit fixes various issues with screen readers in the main OBS
interface. These were tested using NVDA on Windows 10 2004.

Audio track selection in Settings now says Track 1, 2, etc, rather than
just the number.

Various checkboxes that just say "Enable" now have accessible text that
says what the enable is for (since it says "checkbox", the fact it's an
enable should hopefully be clear).

Type in the recording tab of output now has accessible text which says
"Recording Type".

Items in the Advanced Audio Properties window now have accessible text
for what they are for. Currently some do not report correct values, but
that will require an accessible interface in Qt to be written
specifically for that, which will be done at a later date.

Buttons in the filters window now have accessible text for what they do.

All the right side buttons in hotkeys now have tooltips, and by
extension, accessible text.
2020-11-25 19:38:05 -08:00
Matt Gajownik a88b262d5f UI: Set default source toolbar visibility to true
This significantly simplifies the
configuration setting's initial load.

This also fixes as issue where the source toolbar
would initialise as "TextLabel" with enabled
buttons if the user had not yet toggled the setting.

Fixes #3722
2020-11-24 14:19:57 -08:00
Ka Ho Ng f8aa02897f UI: Detect other instances of obs on FreeBSD
Detect other instances of the obs by creating an extra dummy thread,
named "OBS runonce". The process of threads enumeration of current user
is guarded by an O_EXLOCK file advisory lock when opening the lock file.
Such file lock would be dropped once the thread name is changed.

This should be usable on FreeBSD and possibly compile on DragonFly BSD.

fixes: #3053
2020-11-14 12:04:31 -08:00
Vadim Zhukov 0d222b6b56 Add OpenBSD support 2020-11-14 11:55:22 -08:00
PatTheMav 9ac92f61be
UI: Use macOS app icon for Qt app on macOS 2020-11-13 17:17:45 +01:00
Christian Lockley ad528bef17 UI: Detect other instances of obs on Linux
fixes: obsproject#3053
2020-10-30 11:50:47 -07:00
Johann Garces ade4c4cf49 UI: Run Autoconfig Wizard on New Profile Creation
New profile state is similar to first start: settings are wiped, encoders
not setup. It may make sense to show the auto configuration wizard when
a new profile is made as well.

There is a checkbox option to show the wizard. If a profile is created
with the checkbox off, the checkbox will remain defaulted to off next
prompt.
2020-10-29 14:15:57 -07:00
Mikhail Kochegarov 117d35433f UI: Detect other instances of obs on macOS
Detect other instances of the obs by inspecting running applications
with same bundle ID.

fixes: #3053
2020-10-16 05:48:37 -07:00
Ed Maste 92076f5c8c UI: Skip ChromeOS test on FreeBSD
As with Windows and macOS there's no need to check for ChromeOS on
FreeBSD.
2020-10-02 06:27:04 -07:00
jp9000 e5d8f345fc UI: Fix screenshots preventing auto-remux
Due to the fact that a global was used on GenerateSpecifiedFilename to
save the remux file name, when a screenshot was made, it would overwrite
the filename being remuxed, because screenshots use the same function to
generate filenames as well.

This solves that problem by removing the global and the changes to
GeneratedSpecifiedFilename, and isolating that to the output handler.

Coincidentally, this bug probably also happened with replay buffers
under certain circumstances.

Fixes obsproject/obs-studio#3497
Closes obsproject/obs-studio#3498
2020-09-26 08:19:27 -07:00
jp9000 5978094fa0 UI: Fix certain buttons turning up white in dark theme
Fixes the browse button in the remux file dialog not having the proper
style applied. This is a bit of a workaround because it is still unknown
why the button was white.
2020-09-14 16:40:46 -07:00
Clayton Groeneveld e60edf53d5 UI: Fix hotkeys auto repeating 2020-08-23 04:15:44 -05:00
Colin Edwards fddbbe259d UI: Source Toolbar
The source toolbar allows quick and easy access to properties and
filers, and shows common properties/features of a source type.  For
example, when you select a media source, VLC source, or the slideshow
source, you'll get media controls to control playback of the media.  If
you select a text source you can edit the font, color, or text if
applicable.  Or if you select a capture source, you can select the
display/window/etc to capture for that source.

If the source toolbar is not desired and is viewed as taking up valuable
space in the window, it can be disabled via the view menu.

Co-authored-by: Clayton Groeneveld <claytong1214@gmail.com>
Co-authored-by: Jim <obs.jim@gmail.com>
2020-08-17 07:18:18 -07:00
Kurt Kartaltepe a52b53e98e UI: Check and fail when launched under ChromeOS
This adds a check when compiling for linux to check for a ChromeOS
container specific directory. If this directory exists OBS will fail to
start with an error that ChromeOS is unsupported.
2020-08-02 14:15:21 -07:00
Clayton Groeneveld 040e445617 UI: Add log viewer window 2020-07-31 19:57:12 -07:00
Clayton Groeneveld cc565653d3 UI: Simplify path generation code 2020-07-30 17:41:43 -07:00
Richard Stanway 06321f89e1 UI: Remove OBSContext class and shutdown in run_program
The OBSContext never called obs_startup but would always call
obs_shutdown in its destructor, resulting in shutdown calls even if
libobs wasn't initialized (eg due to a startup error). Instead, we now
track if libobs was initialized in OBSApp and call shutdown in the
destructor.
2020-07-23 23:17:52 +02:00
derrod 30862d75ae UI: Add flag/file to disable built-in updater
When distributing OBS via third party platforms that have their own
update systems we want to be able to disable the OBS updater without
having to resort to having a separate build entirely.
2020-07-18 21:33:47 +02:00
jp9000 959dbb64ed Revert "Merge pull request #3110 from WizardCM/taskbar-color-setting"
This reverts commit 04e01458e5, reversing
changes made to b83a9dd0d6.
2020-07-11 06:05:35 -07:00
Matt Gajownik 081fc548c5 UI: Add setting for taskbar color 2020-07-10 20:12:59 -07:00
Matt Gajownik bc472eab95 UI: Show help text for launch parameters on Windows 2020-07-07 20:04:42 -07:00
jp9000 a72a52fa38 UI: Add virtual camera to UI
Adds a virtual camera button to the main user interface.  If virtual
camera is not installed, it will not add the button.  On Windows, it
detects whether the virtual camera filters are properly registered, and
will only add the button if the virtual camera filter is confirmed
registered.

Also adds a virtual camera option to the auto-configuration wizard,
which will just simply set the user's resolution/scale to 1920x1080 at
30 FPS.
2020-07-07 06:09:59 -07:00
Bennik2000 5feabfacc8 UI: Fix wrong path in the crash message dialog
Closes obsproject/obs-studio#2290
2020-05-19 22:31:06 -07:00
jp9000 8de20ab3be libobs: Add task scheduling features
(This commit also modifies the UI)

Adds the ability to schedule tasks for certain threads
2020-03-14 10:54:37 -07:00
Clayton Groeneveld 61aeaa5ca3 obs-browser: Enable Linux support
This requires CEF >= 3683
2020-02-25 22:38:12 -06:00
Clayton Groeneveld d6e8fbf0d1 UI: Return 0 when launch cancelled or failed 2020-02-22 19:22:43 -06:00
Clayton Groeneveld e0135823ce UI: Restart program when audio/locale changed 2020-02-16 16:12:00 -06:00
Matt Gajownik a77c6aafde UI: Allow resizing docks when hotkeys are disabled
Fixes #2194
2020-02-13 12:28:48 +11:00
Theodore Dubois bd3cbf23ad UI: Add Chromium-compatible NSApplication subclass
This fixes some crashes in browser panels on Mac, but it's also harmless
if browser panels aren't enabled.
2020-02-09 00:02:09 -08:00
jp9000 f077004523 UI: Fix incorrect parameter
This param is the buffer size, including null terminator
2020-02-01 22:10:57 -08:00
jp9000 3f9ca9644a UI: Fix incorrect parameter value
The last parameter is the buffer size (which would include null
terminator), not the desired string length.
2020-02-01 21:51:21 -08:00
jp9000 9f1c442d35 UI: Add option to toggle source icons to View menu 2020-01-20 23:19:32 -08:00
VodBox 798556c068 UI: Ensure OBS launches when theme is missing
This change makes it so OBS will still launch even if a theme is
missing. This change also deprecates the "CurrentTheme" config key, and
is replaced by "CurrentTheme2".

This is because a previous change to make sure OBS fell back to the
System theme in case of a missing theme had been accidentally removed.
Changing the key prevents a new version of OBS setting a theme that
doesn't exist in an older version, which would prevent that version from
launching.
2019-12-16 08:12:57 +13:00