2020-10-06 07:03:37 +00:00
|
|
|
From dbe3c133a386f7c4aae505d298d6d90d6f1407bf Mon Sep 17 00:00:00 2001
|
2020-08-23 10:56:49 +00:00
|
|
|
From: Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
|
|
|
|
Date: Wed, 19 Aug 2020 15:09:26 -0300
|
2020-10-06 07:03:37 +00:00
|
|
|
Subject: [PATCH 18/25] UI: Disable and ignore Always On Top on Wayland
|
2020-08-23 10:56:49 +00:00
|
|
|
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
|
2020-10-06 07:03:37 +00:00
|
|
|
index a93b2136..de3d8856 100644
|
2020-08-23 10:56:49 +00:00
|
|
|
--- a/UI/window-basic-main.cpp
|
|
|
|
+++ b/UI/window-basic-main.cpp
|
2020-10-06 07:03:37 +00:00
|
|
|
@@ -78,6 +78,10 @@
|
2020-08-23 10:56:49 +00:00
|
|
|
|
|
|
|
#include <json11.hpp>
|
|
|
|
|
|
|
|
+#ifdef ENABLE_WAYLAND
|
|
|
|
+#include <obs-nix-platform.h>
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
using namespace json11;
|
|
|
|
using namespace std;
|
|
|
|
|
2020-10-06 07:03:37 +00:00
|
|
|
@@ -1799,9 +1803,22 @@ void OBSBasic::OBSInit()
|
2020-08-23 10:56:49 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
|