Skip to content

Commit 93151bb

Browse files
fix: avoid hiding floating docks when the OBS app is not active.
This PR changes the behavior of floating docks on macOS to have them stay visible while the OBS app is not active. The main change is to set the `NSWindow.hidesOnDeactivate` setting to false. This is enough to keep the docks visible. The remaining changes are just making sure that this setting is consistent across all the different ways OBS creates docks. In macOS, only one app can be "active" (aka "focused") at the time, and "floating panels" (OBS' docks in this case) disappear by default when their parent app is not active. The issue is that disappearing floating panels defy many of the use cases that OBS is great for. For example: - I'm doing game streaming on Twitch. I want to keep track of my chat. - I have a floating panel displaying the "Twitch chat" dock on a side monitor. - I click on my game, which becomes the active app. OBS is not the active app anymore, therefore the chat dock panel disappears. This is a common issue between macOS users: - https://obsproject.com/forum/threads/popped-out-docks-disappear-when-obs-is-not-in-focus.165011/ - https://obsproject.com/forum/threads/keep-dock-windows-visible-even-when-obs-is-not-in-focus.167324/
1 parent 154088b commit 93151bb

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

frontend/docks/OBSDock.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@
77

88
#include "moc_OBSDock.cpp"
99

10+
OBSDock::OBSDock(QWidget *parent) : QDockWidget(parent)
11+
{
12+
this->setAttribute(Qt::WA_MacAlwaysShowToolWindow, true);
13+
}
14+
15+
OBSDock::OBSDock(const QString &title, QWidget *parent) : QDockWidget(title, parent)
16+
{
17+
this->setAttribute(Qt::WA_MacAlwaysShowToolWindow, true);
18+
}
19+
1020
void OBSDock::closeEvent(QCloseEvent *event)
1121
{
1222
auto msgBox = []() {

frontend/docks/OBSDock.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ class OBSDock : public QDockWidget {
1010
Q_OBJECT
1111

1212
public:
13-
inline OBSDock(QWidget *parent = nullptr) : QDockWidget(parent) {}
14-
inline OBSDock(const QString &title, QWidget *parent = nullptr) : QDockWidget(title, parent) {}
13+
OBSDock(QWidget *parent = nullptr);
14+
OBSDock(const QString &title, QWidget *parent = nullptr);
1515

1616
virtual void closeEvent(QCloseEvent *event);
1717
virtual void showEvent(QShowEvent *event);

0 commit comments

Comments
 (0)