0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 13:08:50 +02:00
Commit Graph

12 Commits

Author SHA1 Message Date
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
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
jpark37
a1f1e1080e UI: Switch from RGBA to BGRA swap chain format
DirectX team member claims BGRA might have flip optimization benefits.
2019-09-06 19:39:50 -07:00
Michael Fabian 'Xaymar' Dirks
dc150ce0eb UI: Pass QColor as reference 2019-07-24 18:49:03 +02:00
jp9000
f53df7da64 clang-format: Apply formatting
Code submissions have continually suffered from formatting
inconsistencies that constantly have to be addressed.  Using
clang-format simplifies this by making code formatting more consistent,
and allows automation of the code formatting so that maintainers can
focus more on the code itself instead of code formatting.
2019-06-23 23:49:10 -07:00
SuslikV
e2be33956b UI: Correct custom property implementation
- Fixes Q_PROPERTY macro syntax
- Removes excessive notification declaration and slot
- Removes unneeded dynamic property
- Improves Themes versatility
2019-04-17 07:10:12 -07:00
cg2121
0ae8a7c0ac UI: Add ability to style preview background color 2018-09-10 04:55:15 -05:00
jp9000
01b274f1da UI: Rename 'obs' dir to 'UI'
This is to prevent confusion both when prefixing commits and when
reading the directory structure for the first time.
2016-08-27 20:19:45 -07:00