Commit Graph

1784 Commits (622d2f7658fd9ab882edc05bd5eed5be395d00fe)

Author SHA1 Message Date
Nirusu 2787e63d8e UI: Fix screen resolution for canvas size
In #3988, @RytoEx mentioned that the recent Qt upgrade to 5.15.2
introduced a regression in which Qt begins returning DPI/scaling
aware resolutions for each screen. While this was fixed for
new profiles, this was not reflected in the choice for the
Canvas (Base) Resolution in the Settings screen yet.

This commits fixes this issue, and calculates the correct
physical screen size again, respecting per-screen DPI scaling.
2021-02-12 15:28:26 -08:00
Jim 190ab876cc
Merge pull request #2484 from GeorgesStavracas/feaneron/egl-wayland
EGL/Wayland (Wayland, pt 3)
2021-02-12 01:30:05 -08:00
jp9000 e8a1c082da Revert "UI: Add ability for stingers to use filters"
This reverts commit 36ab7b97cf.

The fact that a transition is a composition of two scenes was not
factored into the merging of this PR. Thus, it would apply to the
underlying scenes when transitioning, making the effectiveness of this
feature cause inconsistent rendering of the underlying scenes when
transitions are activated versus when they're not.
2021-02-11 22:34:55 -08:00
Georges Basile Stavracas Neto e67fdbca79 UI: Check for Expose and PlatformSurface events to create display
This is a workaround for QWaylandWindow never becoming exposed, or
receiving the QEvent::Expose [1].

[1] https://bugreports.qt.io/browse/QTBUG-86176
2021-02-09 09:39:17 -03:00
Georges Basile Stavracas Neto 226cc22669 UI: Make OBSQTDisplay::CreateDisplay() public and allow forcing creation
This will be used by a new event filter, added only when running as a Wayland
client, to force creating the obs_display instance even when not exposed.
2021-02-09 09:39:17 -03:00
Georges Basile Stavracas Neto b629265e7f UI: Disable and ignore Always On Top on Wayland platforms
This is a dangerous operation on Wayland, and is crashing not only
OBS Studio but also the whole compositor. Let's disable it for now
when running as a native Wayland client.

Some compositors (GNOME Shell, Plasma) still allow setting this
option on the window menu.
2021-02-09 09:39:17 -03:00
Georges Basile Stavracas Neto f817300cfa UI: Rename callback to match signal name
The sizeChanged callback is connected to the screenChanged signal,
and evidently the naming doesn't match. Rename the callback to
match the signal name.
2021-02-09 09:39:17 -03:00
Georges Basile Stavracas Neto b71498e8ab UI: Don't create obs_display when QTToGSWindow fails
Right after showing the OBSQTDisplay widget, it may happen that a
wl_surface is not yet created and attached to the window. When this
happens, creating the OBS display results in a crash.

Make QTToGSWindow return a boolean, indicating success or failure, and
don't create the OBS display on failure.
2021-02-09 09:39:17 -03:00
Georges Basile Stavracas Neto 60dab2cf1c UI: Destroy display when becoming invisible
When a window is made invisible, then visible again, the
obs_display is reused. Turns out, QT destroys the wl_surface
associated with the previewer on Wayland. However, the EGL
surface created on top of this wl_surface is not, and any
attempt to attach a new buffer to it will crash OBS.

Destroy the obs_display when becoming invisible, and when
running as a Wayland client. Also nullify the display
variable on destruction, to avoid subclasses double-freeing
the obs display.
2021-02-09 09:39:17 -03:00
Georges Basile Stavracas Neto a56582d92d UI: Retrieve Wayland surface from QWindow
On Wayland, we want to query the window's underlying
platform for the Wayland surface, instead of foolishly
retrieving the X11 display.

Pass QWindow instead of WId directly, and set the surface
as the platform data on Wayland systems.
2021-02-09 09:39:17 -03: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
Clayton Groeneveld 36ab7b97cf UI: Add ability for stingers to use filters
This adds a menu item in the transitions config menu to access
filters for stinger transitions.
2021-02-09 02:46:27 -08:00
poccariswet 77e4a09f62 rtmp-services: Add OPENREC.tv service 2021-02-08 22:36:36 -08:00
Jim 06c5d059c1
Merge pull request #4210 from fredemmott/decklink-settings-double-free
decklink-ui: fix double free of settings
2021-02-08 22:35:50 -08:00
Fred Emmott e5f05473e7
decklink-ui: fix double free of settings
This leads to a crash when the output is stopped, either by clicking the
stop button or when exiting OBS studio.

This crash is:
- intermittent in release builds
- reliable for me in debug builds

It is held by an `OBSData`, which, if not null, will automatically
call `obs_data_release()` on scope exit.
2021-02-08 14:46:38 -06:00
tt2468 fa3ae6db93 Frontend-API: Add obs_frontend_reset_video() 2021-02-03 08:53:42 -08:00
jp9000 219a0913ca UI: Improve missing files text 2021-02-02 06:13:51 -08: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
Jim 2eca4d80b6
Merge pull request #2233 from VodBox/missing-files-dialog
libobs + UI: Add Missing Files API & Dialog
2021-01-31 08:02:16 -08:00
jpark37 3d4e8c377c UI: Fix unused parameter 2021-01-30 00:25:25 -08:00
jpark37 48ba511bda UI: Avoid asprintf warning 2021-01-30 00:25:25 -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
Georges Basile Stavracas Neto 58497e59d9 UI: Reinstate native dialogs on Linux with browser enabled
After the recent CEF update, the GMainLoop-in-a-thread conflict seems to be
gone, which allows us to being back native dialogs.
2021-01-28 23:58:13 -08:00
Georges Basile Stavracas Neto 913821ee8e UI: Make BrowserDock native
After cleaning up the native flags in various places, and disabling
making sibling of native widgets native, BrowserDock was left in an
inconsistent state, since it requires being native for CEF to work
properly.

Make BrowserDock native.
2021-01-26 09:43:16 -08:00
Georges Basile Stavracas Neto 9ee7547e19 UI: Cleanup native widgets
Some widgets are marked as native unnecessarily. Native widgets are
a bit more involving than regular ones, so remove this flag.

Original patch by David Edmundson <kde@davidedmundson.co.uk>
2021-01-26 09:43:16 -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
Exeldro bacf83dbc9 UI: Close context menu on destroy of VolControl 2021-01-25 04:17:14 -08:00
Kurt Kartaltepe 77e4416c9f UI: Fix crash when systray is not enabled 2021-01-25 04:14:29 -08:00
Jim 8333f13587
Merge pull request #2067 from jpark37/srgb-toggle
Linear color math
2021-01-22 16:03:29 -08:00
jpark37 e08ad9faf3 UI: Render previews in linear sRGB space
Necessary for correct alpha blending.
2021-01-21 07:42:57 -08:00
Ivan Efremov c7ca8abdd3 UI: fix the maximum search length of Hotkeys Filter
The "fullName" property was filled only in case of exceeding
TRUNCATE_TEXT_LENGTH. Also search function had worked only with
item->text() what was the reason of maximum search length in
Hotkeys Filter(Setting->Hotkeys).

The following changes allow to search in filter without
the length limit of string along with the current functionality.
2021-01-20 12:18:05 -08:00
Ryan Foster 54207a0d60 UI: Replace deprecated QLayout->setMargin with setContentsMargin
QLayout->setMargin has been deprecated since Qt 5.13 (though marked
obsolete since at least Qt 4.8) and removed in Qt6. It was replaced by
QLayout->setContentsMargins, which is available in all versions of Qt5.
Building against Qt 5.13+ can produce compiler warnings when using
QLayout->setMargin, and warnings are bad.

https://doc.qt.io/archives/qt-4.8/qlayout-obsolete.html
https://doc.qt.io/qt-5/qlayout-obsolete.html
d6d33f0b80
https://github.com/qt/qtbase/blame/5.15.2/src/widgets/kernel/qlayout.h
2021-01-18 19:10:31 -08:00
Mike So f79393a727 UI: fix unable to upload and view crash report in mac 2021-01-18 01:43:09 -08:00
Clayton Groeneveld 968a1a6ff0 UI: Add interact button to source toolbar
This adds a interact button to the source toolbar. It is only
shown when source is interactable.
2021-01-17 20:03:08 -08:00
Clayton Groeneveld 520f1158e1 UI: Fix color of filters icon
The filters icon color was #ffffff. This changes it to #d2d2d2, the
same as the other icons.
2021-01-17 19:55:21 -08:00
VodBox 3273472019 UI: Add missing files dialog 2021-01-17 10:31:59 +13:00
Andrew Tropin fb347c3c62 UI: Add support for OBS_PLUGINS*_PATH env variables
Allow to load obs plugins from arbitary directory, specified by
OBS_PLUGINS_PATH and OBS_PLUGINS_DATA_PATH environment variables.
2021-01-16 00:26:10 -08:00
Clayton Groeneveld e38d8f10a6 UI: Add virtual camera to system tray
Adds ability to start and stop the virtual camera from the
system tray.
2021-01-15 18:16:41 -08:00
Andrew 7f5013cf37 UI: Use FileNameWithoutSpace for screenshot output 2021-01-15 18:16:03 -08:00
Clayton Groeneveld 3bc4e8ecba obs-frontend-api: Add frontend api functions for the virtual camera
This adds functions to the frontend api to start/stop the virtual
camera, to check if it is active and adds function to get the output
reference. It also adds api events for when the virtual camera is
started or stopped.
2021-01-13 09:46:04 -08:00
Hayden McAfee 96ef45cef5 UI: Support FTL URLs for custom streaming service
Custom streaming service URLs beginning with `ftl` are handled by the
`ftl_output` plugin.
2021-01-13 09:44:52 -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
clone1018 64164a1523 rtmp-services: Add Glimesh service 2021-01-12 16:43:41 -08:00
Jimi Huotari 41367bb2b4 UI: Fix crash when no audio backends are available
This commit prevents a crash in, for example, Linux configurations
where PulseAudio is disabled, which leads into 'mod' being 'null',
which in turn leads into a segmentation fault when an ALSA source
is selected.

Closes https://github.com/obsproject/obs-studio/issues/3485
2021-01-12 09:33:48 -08:00
Ryan Foster 461a0c5484 UI: Refactor importer to use GetUnusedSceneCollectionFile 2021-01-11 14:49:59 -08:00
Ryan Foster 9b1d1c1b3d UI: Make GetUnusedSceneCollectionFile usable elsewhere 2021-01-11 14:49:59 -08:00
jpark37 0d1ffd8b30 UI: Support color picker with alpha 2021-01-11 11:52:50 -08:00
Colin Edwards 60e3c66d08
Merge pull request #3934 from pkviet/macbrowseraccel
UI: Enable HW acceleration switch for browser sources on Mac
2021-01-07 23:03:19 -06:00