blob: c66b07bb57ad34f6af6ecfc7b78acbda9c2c16dd (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
From c31e0f682431508ccd2d3c0f74e6e16fc71445d8 Mon Sep 17 00:00:00 2001
From: Cray Elliott <MP2E@archlinux.us>
Date: Fri, 10 Mar 2017 03:48:36 -0800
Subject: [PATCH] Fix segfault in Linux when no system tray exists
previously, switching workspaces while obs-studio is running resulted in a
segfault if no system tray was available
---
UI/window-basic-main.cpp | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/UI/window-basic-main.cpp b/UI/window-basic-main.cpp
index 8590dd75..024854d6 100644
--- a/UI/window-basic-main.cpp
+++ b/UI/window-basic-main.cpp
@@ -2916,13 +2916,15 @@ void OBSBasic::closeEvent(QCloseEvent *event)
void OBSBasic::changeEvent(QEvent *event)
{
- if (event->type() == QEvent::WindowStateChange &&
- isMinimized() &&
- trayIcon->isVisible() &&
- sysTrayMinimizeToTray()) {
-
- ToggleShowHide();
- }
+ if (trayIcon) {
+ if (event->type() == QEvent::WindowStateChange &&
+ isMinimized() &&
+ trayIcon->isVisible() &&
+ sysTrayMinimizeToTray()) {
+
+ ToggleShowHide();
+ }
+ }
}
void OBSBasic::on_actionShow_Recordings_triggered()
--
2.12.0
|