update patches from pull request

Signed-off-by: Antoine Damhet <antoine.damhet@lse.epita.fr>
This commit is contained in:
Antoine Damhet 2020-08-23 12:56:49 +02:00
parent 8087c172b8
commit 7b430130e3
No known key found for this signature in database
GPG key ID: DC09A32F3CE58F3E
23 changed files with 421 additions and 104 deletions

View file

@ -1,7 +1,7 @@
pkgbase = obs-studio-wayland
pkgdesc = Free, open source software for live streaming and recording (with wayland patches)
pkgver = 25.0.8
pkgrel = 2
pkgrel = 3
url = https://obsproject.com
arch = x86_64
license = GPL2
@ -47,28 +47,36 @@ pkgbase = obs-studio-wayland
source = 0010-linux-capture-Fail-to-load-when-running-on-EGL.patch
source = 0011-libobs-Add-a-Wayland-platform.patch
source = 0012-libobs-opengl-Try-to-use-the-platform-display-if-ava.patch
source = 0013-libobs-Add-a-Wayland-platform.patch
source = 0014-libobs-opengl-Introduce-an-EGL-Wayland-renderer.patch
source = 0015-UI-Retrieve-Wayland-surface-from-QWindow.patch
source = 0016-UI-Destroy-obs_display-when-becoming-invisible.patch
source = 0013-libobs-opengl-Introduce-an-EGL-Wayland-renderer.patch
source = 0014-UI-Retrieve-Wayland-surface-from-QWindow.patch
source = 0015-UI-Destroy-display-when-becoming-invisible.patch
source = 0016-UI-Don-t-create-obs_display-when-QTToGSWindow-fails.patch
source = 0017-UI-Rename-callback-to-match-signal-name.patch
source = 0018-UI-Disable-and-ignore-Always-On-Top-on-Wayland-platf.patch
source = 0019-UI-Make-OBSQTDisplay-CreateDisplay-public-and-allow-.patch
source = 0020-UI-Check-for-Expose-and-PlatformSurface-events-to-cr.patch
sha512sums = a97c03dc218a4e03e48f6a7dc82b4a59ebeee2039f17be66bb847681ce9ff3d25e6e015be4af78fe44739f6fad5089b6e683d7657c2e4fde8e547df9a2594a08
sha512sums = 1ff0e088eed61554268009f3d8c5a23c0888bfbe860d6cb288ddf348108446c152fd87e2cb8f54613a88378d8474550632c90f924005d5e0343bf1a801339ccc
sha512sums = 6329e08da95e345509001ab6b9e8b73a227d0e63a8d39a3ef9b7d0197940ea9589d39b4aa92cdcc9f21cc4b9110a97f8e80891a12b4b24dff6d23395379abf5c
sha512sums = b05346b83587d2fe3fbc676a14aca961f05fa58c6912f82fed9e15a4b9fcacce297921003b41980c57ba09c4623d50c905a7c50961c2269a9709fcb67a088002
sha512sums = 6f38fd7f6f5a29d05b6dd824af1de6072ebd692c96940ba74e5d1799e21754230010fd70cd2f1ce830a0701d25b07cfbae8cbe49f89ba085cd2dec6796a7790d
sha512sums = 14979eef47ab1d6e88ab77c35ab00a5e8297d1ed332bb397b8d3906e68c6ffa0b4e0761ef0dfff0221c7e22f5fb709e5bb11b87e046116bb3996df270e3b7b43
sha512sums = db6a8d54e86f58f1adecb0f09ab5660ae0d06f4aa8bd0ea2e61da601ae82fd53a3b4c6db96d5827709e700843b70cc5a72851c0d429e3ec05bef250ed48445a0
sha512sums = f0374c85bd93928a32d60a9516c90c1b2e3537b84f949066110897f05224a568dd57f2cd9d141b0cfa8e89672b081dac3c64304523fcf37f0c018ca78ad71625
sha512sums = dcdca90cfd701aad02ba12dee9a6482ca9066ff817e6e24bb3d0d6dfbbc48e8e98eb02517983802c66cade34c0d347aec817fe98da8baa7f5fff9187201e9a00
sha512sums = 64e4adef34a1074410245120d828871c128ee8254d77378cd7b74fe0182abaffdbff6669990a75464335b33d83641893b73e618c7322e1fe3186a748eab07e79
sha512sums = 64ca66913ade6b28815aa06383089e1c9aaa7a2b50cd425be8876d0a95338615be844a362a55c02541681d51f1921cb0820554f49fe21786649076ca16f6f64b
sha512sums = a917037dc63bfdd8d2d04b2d3f625eb9c8ec26868ca2eeef23d78f3442c8233252d86285b771e1c1428408508aedff4407aec5bdc9ef233fda995483fdab4202
sha512sums = 013adb73a718f5df05a055de0e5fa17701dc645d8e7025ff1192d99a405dd6a0923fcfdbbad37777ff993545aadf9d4d29bae7191c6505f9f929273d5b374ee2
sha512sums = 34710dbf905e6af2d7af3feab9f55c867dcbac6afa0ab6a12f7c458b974ba71e14ef797e9db613d3248c046dee1c1dce8559ceeaf1d95d1215368032e642731d
sha512sums = e131c7a65ce0e848f0b91bfd4b3db750bc0bddce64a9ff49d97082ddafb9ddab92f43ea19a2c92b054e85df0f018f43ff5dc8cf81671520079e4e4681d5ac230
sha512sums = cefa4f5032a06e9341ccdabef022d755c8869b391a33ed5c4bd927672f967d5287d4c017cb7b2d37c163c9f387ca94d5846327461a9ba3b44478ed67a60d6a9f
sha512sums = e406d3f16f17b35ce463120eefd2bea3797fa83304ea27628b9a671704451c4a275d6844b0f007997e3a6edc39557442c6eb9eb8b6dc2a50e07341e3b0621e1f
sha512sums = 6c1cd77e63f760aabb9186edb906092bb9f6a7b2e7bd32deff4af33b5f35e95abe7ff874b6a17112d3da098f970f706c0a05f239fc75b65e60f4c68ae544eacf
sha512sums = df2a3b13a66603546bc39c070bbbe55d2ef0e6620fea98e773955713ef74c6817649713da76548d24a4160f4af327e132205cbeb2f90959690aa3321945284c4
sha512sums = d15612ba51364c9ba49096a3aa8d2002d739b81cae090586254fc1351723cabfd80a09d76834b71f6d49abcc50e33dda52f183dd3a5e87a0d740ce57dc2cb583
sha512sums = 43e67659200e077a6dc624f94ed9cde5a31ae7bcd403b9ea649fb0277b3a1964b4f11a4ad45d754fc571b71c3cca42ca0a843bd484229a64a41d3f96efa03aca
sha512sums = dfd8687f3aaae32161998075923905bc2c3111b299132d398efee5771fb0b681a96f1ee367b6955e66935df8b2f9cb59466b5c209768b04bf4c6af177c4b8621
sha512sums = b47ee46b3bdb6de606fb667d17536fbede200be86021c983259c131fe9f463b3101e419ea8ed30f0a99163877d2e939f44b9e7fd2d213cc4c203da64813117d1
sha512sums = 8b6e5f32ebfca1f163d69144e3752b409be8b3747ff46b9f9cecf0140247fffc8728f49cfcf0f71e2b514ff8e516bf441cdd421dff6952d30f65a8adfd4526e3
sha512sums = 62f37c7c60067100a8594306e5fa6e65003063fc3d35d8b7daa7ead2f50ae17677f54dc9f8ac206ef20ca1178ddfb68948893f6d8d56efd0dcc6f147c172c547
sha512sums = 5d6e46223f2d08e807040cc8e264d27219ad8b4a5ff580fa568ccbc88f26564f2e72e8400b8c447c226b5f27346206da19081a5ac03512c95a56ea5d6b3924ff
sha512sums = 1e77adb183e1bb42260965e1733b88d25ebd885ef4029b8c424dd100485fcd882f676a75d396cc7adbbb7c1c4ae9b4f047778d96c4d6d74b5302437059eb0db6
sha512sums = cc853dc74ea961a9253085188f851e3184a53b252f1a85cecd16745b4ab561ea7a47b32bb9475624a2eec51106090a153bdb6ec6680f2ee4bd8fd5a6509ba831
sha512sums = cc712c85b364179794af393634c87ffb3d7d42b360379405ea587485f07e525496ac2da4e97f52a7f2232164e5e70d9442c9b7cc139c85f0405f662ae092b795
sha512sums = 4c5733a51dc1070327eadea420ba5acea2ec74a3bac538264969bc5eea2dadee701dd6634737e09b2755eae388fa0969d32738b6ea81b99f66a56db9b6a90765
sha512sums = e61d437cb1b98f50bd5e4404a90f744d05d8a73965554b1ac981ffa534f1a134bdf6714a78a2eb257b8a53675a012e5786bdce3fd16201b9b64191a61cb11373
sha512sums = 19e0943462fe6e72a104ed45015b8e2b73a0ffa389f733752b6991e1f69e521682f3095d8c372aa800d13b89b28237aa6d2b1fcd24d4df9da6a6ba2000e07c77
sha512sums = abce43def134860a6953fb2e804541860f3a222fbf2e27956874e77974e70851893078cefdce086f56b5144c885dbe674d060e635f351ef4efc9a1bcd1fcfa1c
sha512sums = 55a80e92c70f709ffb42491d61cfc659ba0c682603a8431e915d238495e9ba966b976a195daec0aec79803473d9b251371c4469391f423456d325ab558a0379c
sha512sums = 6dea2f711a4871da8dd72faa29f3eb3274e18d24a6bc719461b20fa4b0a327ad16291b8867c9d68d5b911be4016f2d75fa0158df1e55b5fc96f2612574e7ceb0
sha512sums = cef5df381f13456326e844b1f45168f51af37df09227f07bdd800672efce28181c4fdf96798759d139f953b5809850caa3894d2f7a3c29c0a7220dd0b4f60c78
sha512sums = fd3a51462f745169522c5c6a857fe124eebb06331a9ccb1e4dc69e78c300c3b0737d5cb330c9d2b9e8f30aae9d206bbc985c2660aeb7ac1a66cbc9d84187cf06
sha512sums = 8a3c9db9d92b76a0388083744ead2eceb955c0c21c8b4242db51a500a6e1454a21725501e0ba1968f63b59b1ea6e83765d84d03b421ec482e8ca37166b03c2ac
pkgname = obs-studio-wayland

View file

@ -1,7 +1,7 @@
From af3a31e5dc24a37ecd34ac87ec662289a942a42e Mon Sep 17 00:00:00 2001
From 54422d4a37bfae4239e9aca54eb0ff0b8b419cdd Mon Sep 17 00:00:00 2001
From: Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
Date: Mon, 9 Mar 2020 13:10:16 -0300
Subject: [PATCH 01/16] deps-glad: Add EGL
Subject: [PATCH 01/20] deps-glad: Add EGL
The code is generated by https://glad.dav1d.de/
---

View file

@ -1,7 +1,7 @@
From 6a15695f885d372909c3eeadd091abd640fca937 Mon Sep 17 00:00:00 2001
From f4dc111b8acbdd2be0bb077f1ac8d703d92d497c Mon Sep 17 00:00:00 2001
From: Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
Date: Mon, 9 Mar 2020 13:19:31 -0300
Subject: [PATCH 02/16] libobs-opengl: Rename gl-x11.c to gl-x11-glx.c
Subject: [PATCH 02/20] libobs-opengl: Rename gl-x11.c to gl-x11-glx.c
This is in preparation for the future abstraction layer (gl-x11-*)
and also to match the actual name of the windowing system. When

View file

@ -1,7 +1,7 @@
From 4cc969bdb0abcfb5a4737b2f4159ee9c0be7d4cc Mon Sep 17 00:00:00 2001
From c6f9827b8c07adb4c95811f2545ba546fac0c132 Mon Sep 17 00:00:00 2001
From: Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
Date: Mon, 9 Mar 2020 16:46:37 -0300
Subject: [PATCH 03/16] libobs-opengl: Factor out GLX winsys
Subject: [PATCH 03/20] libobs-opengl: Factor out GLX winsys
Move the GLX-related code to gl-x11-glx, and introduce gl-nix as
a winsys-agnostic abstraction layer. gl-nix serves as the runtime

View file

@ -1,7 +1,7 @@
From ecff9e62ac3a52a198e6d5fd71c40abe3826799e Mon Sep 17 00:00:00 2001
From 47d63a561f82114ae31dca741ca2fdad27a7c519 Mon Sep 17 00:00:00 2001
From: Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
Date: Mon, 9 Mar 2020 17:35:49 -0300
Subject: [PATCH 04/16] libobs-opengl: Introduce the X11/EGL winsys
Subject: [PATCH 04/20] libobs-opengl: Introduce the X11/EGL winsys
Introduce the EGL/X11 winsys, and use it when the OBS_USE_EGL environment
variable is defined. This variable is only temporary, for future commits

View file

@ -1,7 +1,7 @@
From 8191cd88f8273430e2976d774ac9189d17661f73 Mon Sep 17 00:00:00 2001
From e7f7eecfc23bd9903b7522aefbc82cce0284b889 Mon Sep 17 00:00:00 2001
From: Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
Date: Sat, 11 Apr 2020 23:49:05 -0300
Subject: [PATCH 05/16] deps/glad: Make X11 required as well
Subject: [PATCH 05/20] deps/glad: Make X11 required as well
To keep consistency with the EGL line
---

View file

@ -1,7 +1,7 @@
From f31796d19f4a4fdedc99f360ccf5d9c5c0f92cf5 Mon Sep 17 00:00:00 2001
From 9a85c7fcaf67bf606e3f57507c532e1239e52d57 Mon Sep 17 00:00:00 2001
From: Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
Date: Fri, 6 Mar 2020 16:22:01 -0300
Subject: [PATCH 06/16] ci: Install qtbase5-private-dev on Linux
Subject: [PATCH 06/20] ci: Install qtbase5-private-dev on Linux
List this dependency both under CI/install-dependencies-linux.sh, and
.github/workflows/main.yml.

View file

@ -1,7 +1,7 @@
From c84f1b751554d6a1cd15f5db4a611a2cb8f95842 Mon Sep 17 00:00:00 2001
From 77e85e17d58c13d655d3d81bb197c5a5d1f1453f Mon Sep 17 00:00:00 2001
From: Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
Date: Fri, 6 Mar 2020 17:24:33 -0300
Subject: [PATCH 07/16] libobs/nix: Move X11-specific code to obs-nix-x11.c
Subject: [PATCH 07/20] libobs/nix: Move X11-specific code to obs-nix-x11.c
Currently, obs-nix.c is highly tied to the X11 display
server. It includes X11 headers directly, and make use

View file

@ -1,7 +1,7 @@
From 32f86b37c78454ad51ac427ccc772b7a62fa89c8 Mon Sep 17 00:00:00 2001
From 5dd4d22ec8c35ffd18499027573a42a57343eee6 Mon Sep 17 00:00:00 2001
From: Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
Date: Fri, 6 Mar 2020 17:50:41 -0300
Subject: [PATCH 08/16] libobs: Introduce the concept of a Unix platform
Subject: [PATCH 08/20] 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.

View file

@ -1,7 +1,7 @@
From 79ec8d09ce00ae6645604a3fd7562832c2400790 Mon Sep 17 00:00:00 2001
From 0c83de87856f6bffb5744353afc13f624836c792 Mon Sep 17 00:00:00 2001
From: Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
Date: Tue, 7 Apr 2020 23:17:02 -0300
Subject: [PATCH 09/16] UI: Set the Unix platform on startup
Subject: [PATCH 09/20] 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

View file

@ -1,7 +1,7 @@
From 7abd7a9ed53f36a0aa9ba45c32cb7824bc6558ac Mon Sep 17 00:00:00 2001
From 944cc7a1cbe8de3c21173ae4f32db034b5b9b6b2 Mon Sep 17 00:00:00 2001
From: Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
Date: Wed, 8 Apr 2020 23:58:43 -0300
Subject: [PATCH 10/16] linux-capture: Fail to load when running on EGL
Subject: [PATCH 10/20] linux-capture: Fail to load when running on EGL
Right now, linux-capture hard-depends on GLX. Disable it when
running under EGL.

View file

@ -1,7 +1,7 @@
From 5c5cf8e4dfd6b2930a25c5772a5679d39c75fc0d Mon Sep 17 00:00:00 2001
From 3223d221945109bf6c78085a04c66816749a3168 Mon Sep 17 00:00:00 2001
From: Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
Date: Fri, 6 Mar 2020 18:53:42 -0300
Subject: [PATCH 11/16] libobs: Add a Wayland platform
Subject: [PATCH 11/20] 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.

View file

@ -1,7 +1,7 @@
From e8a11258a45892d6aebb08de3302e771df25bc6f Mon Sep 17 00:00:00 2001
From 321d06f9a2754dacbdac119a971d137cb2ececf2 Mon Sep 17 00:00:00 2001
From: Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
Date: Sat, 11 Apr 2020 23:32:16 -0300
Subject: [PATCH 12/16] libobs-opengl: Try to use the platform display if
Subject: [PATCH 12/20] libobs-opengl: Try to use the platform display if
available
We need to ensure we're running all X11 code on the same display.

View file

@ -1,30 +0,0 @@
From a0535494becd877747261ff18b545a4d77c980ff Mon Sep 17 00:00:00 2001
From: Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
Date: Fri, 6 Mar 2020 18:53:42 -0300
Subject: [PATCH 13/16] 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.
---
UI/CMakeLists.txt | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/UI/CMakeLists.txt b/UI/CMakeLists.txt
index 171efa2b..70d6da79 100644
--- a/UI/CMakeLists.txt
+++ b/UI/CMakeLists.txt
@@ -408,6 +408,11 @@ if (ENABLE_WAYLAND)
include_directories(${Qt5Gui_PRIVATE_INCLUDE_DIRS})
endif()
+if (ENABLE_WAYLAND)
+ find_package(Qt5Gui)
+ include_directories(${Qt5Gui_PRIVATE_INCLUDE_DIRS})
+endif()
+
define_graphic_modules(obs)
install_obs_core(obs)
--
2.28.0

View file

@ -1,7 +1,7 @@
From 35be3fc4cc65ca86329cf1156e1256249096606b Mon Sep 17 00:00:00 2001
From e8ad273aa0698f045100fef74599008991dea8b0 Mon Sep 17 00:00:00 2001
From: Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
Date: Mon, 9 Mar 2020 21:09:11 -0300
Subject: [PATCH 14/16] libobs-opengl: Introduce an EGL/Wayland renderer
Subject: [PATCH 13/20] libobs-opengl: Introduce an EGL/Wayland renderer
Introduce a new Wayland/EGL renderer.
---

View file

@ -1,7 +1,7 @@
From 9a69ae56d2204501b45cf7b5471279e7d61e65ba Mon Sep 17 00:00:00 2001
From d61735d0dc74fc1a50564fe72cb26a07c4d49e56 Mon Sep 17 00:00:00 2001
From: Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
Date: Mon, 9 Mar 2020 21:23:37 -0300
Subject: [PATCH 15/16] UI: Retrieve Wayland surface from QWindow
Subject: [PATCH 14/20] UI: Retrieve Wayland surface from QWindow
On Wayland, we want to query the window's underlying
platform for the Wayland surface, instead of foolishly

View file

@ -1,7 +1,7 @@
From 7e2e627ebf4d9f52afebb7dcda95429f68362f32 Mon Sep 17 00:00:00 2001
From bab8f9d12fb7b534a6915cfef91b765603563238 Mon Sep 17 00:00:00 2001
From: Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
Date: Tue, 18 Aug 2020 19:38:29 -0300
Subject: [PATCH 16/16] UI: Destroy obs_display when becoming invisible
Subject: [PATCH 15/20] 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
@ -10,10 +10,13 @@ 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.
running as a Wayland client. Also nullify the display
variable on destruction, to avoid subclasses double-freeing
the obs display.
---
UI/qt-display.cpp | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
UI/qt-display.hpp | 1 +
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/UI/qt-display.cpp b/UI/qt-display.cpp
index 685ee6f9..fc83e0e0 100644
@ -47,6 +50,18 @@ index 685ee6f9..fc83e0e0 100644
if (!display) {
CreateDisplay();
diff --git a/UI/qt-display.hpp b/UI/qt-display.hpp
index a2e5a3ef..50f891f8 100644
--- a/UI/qt-display.hpp
+++ b/UI/qt-display.hpp
@@ -25,6 +25,7 @@ signals:
public:
OBSQTDisplay(QWidget *parent = nullptr,
Qt::WindowFlags flags = nullptr);
+ ~OBSQTDisplay() { display = nullptr; }
virtual QPaintEngine *paintEngine() const override;
--
2.28.0

View file

@ -0,0 +1,76 @@
From 2e5a62066f4c54880c1879f44a703f5e302e79c0 Mon Sep 17 00:00:00 2001
From: Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
Date: Wed, 19 Aug 2020 10:11:08 -0300
Subject: [PATCH 16/20] 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.
---
UI/qt-display.cpp | 3 ++-
UI/qt-wrappers.cpp | 6 +++++-
UI/qt-wrappers.hpp | 2 +-
3 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/UI/qt-display.cpp b/UI/qt-display.cpp
index fc83e0e0..c00719ce 100644
--- a/UI/qt-display.cpp
+++ b/UI/qt-display.cpp
@@ -100,7 +100,8 @@ void OBSQTDisplay::CreateDisplay()
info.format = GS_BGRA;
info.zsformat = GS_ZS_NONE;
- QTToGSWindow(windowHandle(), info.window);
+ if (!QTToGSWindow(windowHandle(), info.window))
+ return;
display = obs_display_create(&info, backgroundColor);
diff --git a/UI/qt-wrappers.cpp b/UI/qt-wrappers.cpp
index 1485a181..da5a8ef5 100644
--- a/UI/qt-wrappers.cpp
+++ b/UI/qt-wrappers.cpp
@@ -110,8 +110,10 @@ void OBSMessageBox::critical(QWidget *parent, const QString &title,
mb.exec();
}
-void QTToGSWindow(QWindow *window, gs_window &gswindow)
+bool QTToGSWindow(QWindow *window, gs_window &gswindow)
{
+ bool success = true;
+
#ifdef _WIN32
gswindow.hwnd = (HWND)window->winId();
#elif __APPLE__
@@ -129,10 +131,12 @@ void QTToGSWindow(QWindow *window, gs_window &gswindow)
QGuiApplication::platformNativeInterface();
gswindow.display =
native->nativeResourceForWindow("surface", window);
+ success = gswindow.display != nullptr;
break;
#endif
}
#endif
+ return success;
}
uint32_t TranslateQtKeyboardEventModifiers(Qt::KeyboardModifiers mods)
diff --git a/UI/qt-wrappers.hpp b/UI/qt-wrappers.hpp
index f191f8f9..cb244a74 100644
--- a/UI/qt-wrappers.hpp
+++ b/UI/qt-wrappers.hpp
@@ -56,7 +56,7 @@ public:
void OBSErrorBox(QWidget *parent, const char *msg, ...);
-void QTToGSWindow(QWindow *window, gs_window &gswindow);
+bool QTToGSWindow(QWindow *window, gs_window &gswindow);
uint32_t TranslateQtKeyboardEventModifiers(Qt::KeyboardModifiers mods);
--
2.28.0

View file

@ -0,0 +1,37 @@
From fb03e532004fec99d7d63ce765133665504aae70 Mon Sep 17 00:00:00 2001
From: Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
Date: Wed, 19 Aug 2020 13:08:01 -0300
Subject: [PATCH 17/20] 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.
---
UI/qt-display.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/UI/qt-display.cpp b/UI/qt-display.cpp
index c00719ce..feed5b6c 100644
--- a/UI/qt-display.cpp
+++ b/UI/qt-display.cpp
@@ -56,7 +56,7 @@ OBSQTDisplay::OBSQTDisplay(QWidget *parent, Qt::WindowFlags flags)
}
};
- auto sizeChanged = [this](QScreen *) {
+ auto screenChanged = [this](QScreen *) {
CreateDisplay();
QSize size = GetPixelSize(this);
@@ -64,7 +64,7 @@ OBSQTDisplay::OBSQTDisplay(QWidget *parent, Qt::WindowFlags flags)
};
connect(windowHandle(), &QWindow::visibleChanged, windowVisible);
- connect(windowHandle(), &QWindow::screenChanged, sizeChanged);
+ connect(windowHandle(), &QWindow::screenChanged, screenChanged);
}
QColor OBSQTDisplay::GetDisplayBackgroundColor() const
--
2.28.0

View file

@ -0,0 +1,58 @@
From b31f3e26477368af8213da7883391e475ff82ac2 Mon Sep 17 00:00:00 2001
From: Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
Date: Wed, 19 Aug 2020 15:09:26 -0300
Subject: [PATCH 18/20] 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.
---
UI/window-basic-main.cpp | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/UI/window-basic-main.cpp b/UI/window-basic-main.cpp
index 09304eb1..653ad93a 100644
--- a/UI/window-basic-main.cpp
+++ b/UI/window-basic-main.cpp
@@ -75,6 +75,10 @@
#include <json11.hpp>
+#ifdef ENABLE_WAYLAND
+#include <obs-nix-platform.h>
+#endif
+
using namespace json11;
using namespace std;
@@ -1713,9 +1717,22 @@ void OBSBasic::OBSInit()
bool alwaysOnTop = config_get_bool(App()->GlobalConfig(), "BasicWindow",
"AlwaysOnTop");
- if (alwaysOnTop || opt_always_on_top) {
+
+#ifdef ENABLE_WAYLAND
+ bool isWayland = obs_get_nix_platform() == OBS_NIX_PLATFORM_WAYLAND;
+#else
+ bool isWayland = false;
+#endif
+
+ if (!isWayland && (alwaysOnTop || opt_always_on_top)) {
SetAlwaysOnTop(this, true);
ui->actionAlwaysOnTop->setChecked(true);
+ } else if (isWayland) {
+ if (opt_always_on_top)
+ blog(LOG_INFO,
+ "Always On Top not available on Wayland, ignoring…");
+ ui->actionAlwaysOnTop->setEnabled(false);
+ ui->actionAlwaysOnTop->setVisible(false);
}
#ifndef _WIN32
--
2.28.0

View file

@ -0,0 +1,54 @@
From 2debb5ceb1bcc44f74c2b72f2af7ef02e3755e69 Mon Sep 17 00:00:00 2001
From: Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
Date: Thu, 20 Aug 2020 11:57:19 -0300
Subject: [PATCH 19/20] 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.
---
UI/qt-display.cpp | 7 +++++--
UI/qt-display.hpp | 3 +--
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/UI/qt-display.cpp b/UI/qt-display.cpp
index feed5b6c..b230ab4e 100644
--- a/UI/qt-display.cpp
+++ b/UI/qt-display.cpp
@@ -87,9 +87,12 @@ void OBSQTDisplay::UpdateDisplayBackgroundColor()
obs_display_set_background_color(display, backgroundColor);
}
-void OBSQTDisplay::CreateDisplay()
+void OBSQTDisplay::CreateDisplay(bool force)
{
- if (display || !windowHandle()->isExposed())
+ if (display)
+ return;
+
+ if (!windowHandle()->isExposed() && !force)
return;
QSize size = GetPixelSize(this);
diff --git a/UI/qt-display.hpp b/UI/qt-display.hpp
index 50f891f8..ac717b82 100644
--- a/UI/qt-display.hpp
+++ b/UI/qt-display.hpp
@@ -13,8 +13,6 @@ class OBSQTDisplay : public QWidget {
OBSDisplay display;
- void CreateDisplay();
-
void resizeEvent(QResizeEvent *event) override;
void paintEvent(QPaintEvent *event) override;
@@ -36,4 +34,5 @@ public:
QColor GetDisplayBackgroundColor() const;
void SetDisplayBackgroundColor(const QColor &color);
void UpdateDisplayBackgroundColor();
+ void CreateDisplay(bool force = false);
};
--
2.28.0

View file

@ -0,0 +1,91 @@
From 0e49f864012ef995870d9debac5fa08d73615b30 Mon Sep 17 00:00:00 2001
From: Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
Date: Thu, 20 Aug 2020 11:58:45 -0300
Subject: [PATCH 20/20] 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
---
UI/qt-display.cpp | 56 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 56 insertions(+)
diff --git a/UI/qt-display.cpp b/UI/qt-display.cpp
index b230ab4e..5d81c463 100644
--- a/UI/qt-display.cpp
+++ b/UI/qt-display.cpp
@@ -10,6 +10,56 @@
#ifdef ENABLE_WAYLAND
#include <obs-nix-platform.h>
+
+class SurfaceEventFilter : public QObject {
+ OBSQTDisplay *display;
+ int mTimerId;
+
+public:
+ SurfaceEventFilter(OBSQTDisplay *src) : display(src), mTimerId(0) {}
+
+protected:
+ bool eventFilter(QObject *obj, QEvent *event) override
+ {
+ bool result = QObject::eventFilter(obj, event);
+ QPlatformSurfaceEvent *surfaceEvent;
+
+ switch (event->type()) {
+ case QEvent::PlatformSurface:
+ surfaceEvent =
+ static_cast<QPlatformSurfaceEvent *>(event);
+ if (surfaceEvent->surfaceEventType() !=
+ QPlatformSurfaceEvent::SurfaceCreated)
+ return result;
+
+ if (display->windowHandle()->isExposed())
+ createOBSDisplay();
+ else
+ mTimerId = startTimer(67); // Arbitrary
+ break;
+ case QEvent::Expose:
+ createOBSDisplay();
+ break;
+ default:
+ break;
+ }
+
+ return result;
+ }
+
+ void timerEvent(QTimerEvent *) { createOBSDisplay(true); }
+
+private:
+ void createOBSDisplay(bool force = false)
+ {
+ display->CreateDisplay(force);
+ if (mTimerId > 0) {
+ killTimer(mTimerId);
+ mTimerId = 0;
+ }
+ }
+};
+
#endif
static inline long long color_to_int(const QColor &color)
@@ -65,6 +115,12 @@ OBSQTDisplay::OBSQTDisplay(QWidget *parent, Qt::WindowFlags flags)
connect(windowHandle(), &QWindow::visibleChanged, windowVisible);
connect(windowHandle(), &QWindow::screenChanged, screenChanged);
+
+#ifdef ENABLE_WAYLAND
+ if (obs_get_nix_platform() == OBS_NIX_PLATFORM_WAYLAND)
+ windowHandle()->installEventFilter(
+ new SurfaceEventFilter(this));
+#endif
}
QColor OBSQTDisplay::GetDisplayBackgroundColor() const
--
2.28.0

View file

@ -7,7 +7,7 @@ pkgname=$_pkgname-wayland
provides=("$_pkgname")
conflicts=("$_pkgname")
pkgver=25.0.8
pkgrel=2
pkgrel=3
pkgdesc="Free, open source software for live streaming and recording (with wayland patches)"
arch=('x86_64')
url="https://obsproject.com"
@ -38,29 +38,37 @@ source=(
0010-linux-capture-Fail-to-load-when-running-on-EGL.patch
0011-libobs-Add-a-Wayland-platform.patch
0012-libobs-opengl-Try-to-use-the-platform-display-if-ava.patch
0013-libobs-Add-a-Wayland-platform.patch
0014-libobs-opengl-Introduce-an-EGL-Wayland-renderer.patch
0015-UI-Retrieve-Wayland-surface-from-QWindow.patch
0016-UI-Destroy-obs_display-when-becoming-invisible.patch
0013-libobs-opengl-Introduce-an-EGL-Wayland-renderer.patch
0014-UI-Retrieve-Wayland-surface-from-QWindow.patch
0015-UI-Destroy-display-when-becoming-invisible.patch
0016-UI-Don-t-create-obs_display-when-QTToGSWindow-fails.patch
0017-UI-Rename-callback-to-match-signal-name.patch
0018-UI-Disable-and-ignore-Always-On-Top-on-Wayland-platf.patch
0019-UI-Make-OBSQTDisplay-CreateDisplay-public-and-allow-.patch
0020-UI-Check-for-Expose-and-PlatformSurface-events-to-cr.patch
)
sha512sums=('a97c03dc218a4e03e48f6a7dc82b4a59ebeee2039f17be66bb847681ce9ff3d25e6e015be4af78fe44739f6fad5089b6e683d7657c2e4fde8e547df9a2594a08'
'1ff0e088eed61554268009f3d8c5a23c0888bfbe860d6cb288ddf348108446c152fd87e2cb8f54613a88378d8474550632c90f924005d5e0343bf1a801339ccc'
'6329e08da95e345509001ab6b9e8b73a227d0e63a8d39a3ef9b7d0197940ea9589d39b4aa92cdcc9f21cc4b9110a97f8e80891a12b4b24dff6d23395379abf5c'
'b05346b83587d2fe3fbc676a14aca961f05fa58c6912f82fed9e15a4b9fcacce297921003b41980c57ba09c4623d50c905a7c50961c2269a9709fcb67a088002'
'6f38fd7f6f5a29d05b6dd824af1de6072ebd692c96940ba74e5d1799e21754230010fd70cd2f1ce830a0701d25b07cfbae8cbe49f89ba085cd2dec6796a7790d'
'14979eef47ab1d6e88ab77c35ab00a5e8297d1ed332bb397b8d3906e68c6ffa0b4e0761ef0dfff0221c7e22f5fb709e5bb11b87e046116bb3996df270e3b7b43'
'db6a8d54e86f58f1adecb0f09ab5660ae0d06f4aa8bd0ea2e61da601ae82fd53a3b4c6db96d5827709e700843b70cc5a72851c0d429e3ec05bef250ed48445a0'
'f0374c85bd93928a32d60a9516c90c1b2e3537b84f949066110897f05224a568dd57f2cd9d141b0cfa8e89672b081dac3c64304523fcf37f0c018ca78ad71625'
'dcdca90cfd701aad02ba12dee9a6482ca9066ff817e6e24bb3d0d6dfbbc48e8e98eb02517983802c66cade34c0d347aec817fe98da8baa7f5fff9187201e9a00'
'64e4adef34a1074410245120d828871c128ee8254d77378cd7b74fe0182abaffdbff6669990a75464335b33d83641893b73e618c7322e1fe3186a748eab07e79'
'64ca66913ade6b28815aa06383089e1c9aaa7a2b50cd425be8876d0a95338615be844a362a55c02541681d51f1921cb0820554f49fe21786649076ca16f6f64b'
'a917037dc63bfdd8d2d04b2d3f625eb9c8ec26868ca2eeef23d78f3442c8233252d86285b771e1c1428408508aedff4407aec5bdc9ef233fda995483fdab4202'
'013adb73a718f5df05a055de0e5fa17701dc645d8e7025ff1192d99a405dd6a0923fcfdbbad37777ff993545aadf9d4d29bae7191c6505f9f929273d5b374ee2'
'34710dbf905e6af2d7af3feab9f55c867dcbac6afa0ab6a12f7c458b974ba71e14ef797e9db613d3248c046dee1c1dce8559ceeaf1d95d1215368032e642731d'
'e131c7a65ce0e848f0b91bfd4b3db750bc0bddce64a9ff49d97082ddafb9ddab92f43ea19a2c92b054e85df0f018f43ff5dc8cf81671520079e4e4681d5ac230'
'cefa4f5032a06e9341ccdabef022d755c8869b391a33ed5c4bd927672f967d5287d4c017cb7b2d37c163c9f387ca94d5846327461a9ba3b44478ed67a60d6a9f'
'e406d3f16f17b35ce463120eefd2bea3797fa83304ea27628b9a671704451c4a275d6844b0f007997e3a6edc39557442c6eb9eb8b6dc2a50e07341e3b0621e1f'
'6c1cd77e63f760aabb9186edb906092bb9f6a7b2e7bd32deff4af33b5f35e95abe7ff874b6a17112d3da098f970f706c0a05f239fc75b65e60f4c68ae544eacf')
'df2a3b13a66603546bc39c070bbbe55d2ef0e6620fea98e773955713ef74c6817649713da76548d24a4160f4af327e132205cbeb2f90959690aa3321945284c4'
'd15612ba51364c9ba49096a3aa8d2002d739b81cae090586254fc1351723cabfd80a09d76834b71f6d49abcc50e33dda52f183dd3a5e87a0d740ce57dc2cb583'
'43e67659200e077a6dc624f94ed9cde5a31ae7bcd403b9ea649fb0277b3a1964b4f11a4ad45d754fc571b71c3cca42ca0a843bd484229a64a41d3f96efa03aca'
'dfd8687f3aaae32161998075923905bc2c3111b299132d398efee5771fb0b681a96f1ee367b6955e66935df8b2f9cb59466b5c209768b04bf4c6af177c4b8621'
'b47ee46b3bdb6de606fb667d17536fbede200be86021c983259c131fe9f463b3101e419ea8ed30f0a99163877d2e939f44b9e7fd2d213cc4c203da64813117d1'
'8b6e5f32ebfca1f163d69144e3752b409be8b3747ff46b9f9cecf0140247fffc8728f49cfcf0f71e2b514ff8e516bf441cdd421dff6952d30f65a8adfd4526e3'
'62f37c7c60067100a8594306e5fa6e65003063fc3d35d8b7daa7ead2f50ae17677f54dc9f8ac206ef20ca1178ddfb68948893f6d8d56efd0dcc6f147c172c547'
'5d6e46223f2d08e807040cc8e264d27219ad8b4a5ff580fa568ccbc88f26564f2e72e8400b8c447c226b5f27346206da19081a5ac03512c95a56ea5d6b3924ff'
'1e77adb183e1bb42260965e1733b88d25ebd885ef4029b8c424dd100485fcd882f676a75d396cc7adbbb7c1c4ae9b4f047778d96c4d6d74b5302437059eb0db6'
'cc853dc74ea961a9253085188f851e3184a53b252f1a85cecd16745b4ab561ea7a47b32bb9475624a2eec51106090a153bdb6ec6680f2ee4bd8fd5a6509ba831'
'cc712c85b364179794af393634c87ffb3d7d42b360379405ea587485f07e525496ac2da4e97f52a7f2232164e5e70d9442c9b7cc139c85f0405f662ae092b795'
'4c5733a51dc1070327eadea420ba5acea2ec74a3bac538264969bc5eea2dadee701dd6634737e09b2755eae388fa0969d32738b6ea81b99f66a56db9b6a90765'
'e61d437cb1b98f50bd5e4404a90f744d05d8a73965554b1ac981ffa534f1a134bdf6714a78a2eb257b8a53675a012e5786bdce3fd16201b9b64191a61cb11373'
'19e0943462fe6e72a104ed45015b8e2b73a0ffa389f733752b6991e1f69e521682f3095d8c372aa800d13b89b28237aa6d2b1fcd24d4df9da6a6ba2000e07c77'
'abce43def134860a6953fb2e804541860f3a222fbf2e27956874e77974e70851893078cefdce086f56b5144c885dbe674d060e635f351ef4efc9a1bcd1fcfa1c'
'55a80e92c70f709ffb42491d61cfc659ba0c682603a8431e915d238495e9ba966b976a195daec0aec79803473d9b251371c4469391f423456d325ab558a0379c'
'6dea2f711a4871da8dd72faa29f3eb3274e18d24a6bc719461b20fa4b0a327ad16291b8867c9d68d5b911be4016f2d75fa0158df1e55b5fc96f2612574e7ceb0'
'cef5df381f13456326e844b1f45168f51af37df09227f07bdd800672efce28181c4fdf96798759d139f953b5809850caa3894d2f7a3c29c0a7220dd0b4f60c78'
'fd3a51462f745169522c5c6a857fe124eebb06331a9ccb1e4dc69e78c300c3b0737d5cb330c9d2b9e8f30aae9d206bbc985c2660aeb7ac1a66cbc9d84187cf06'
'8a3c9db9d92b76a0388083744ead2eceb955c0c21c8b4242db51a500a6e1454a21725501e0ba1968f63b59b1ea6e83765d84d03b421ec482e8ca37166b03c2ac')
prepare() {
cd $_pkgname-$pkgver