Skip to content

frontend: avoid hiding floating docks when the OBS app is not active on macOS.#13325

Open
TizianoCoroneo wants to merge 1 commit intoobsproject:masterfrom
TizianoCoroneo:tiziano/macos-nonhiding-floating-windows
Open

frontend: avoid hiding floating docks when the OBS app is not active on macOS.#13325
TizianoCoroneo wants to merge 1 commit intoobsproject:masterfrom
TizianoCoroneo:tiziano/macos-nonhiding-floating-windows

Conversation

@TizianoCoroneo
Copy link
Copy Markdown

Description

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.

Motivation and Context

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:

How Has This Been Tested?

I tested this change on my MacBook Pro M4 Pro, running macOS Tahoe 26.4.1.
Test by:

  • open obs, float a dock.
  • click on a different app to make it active.
  • the floating dock should still be visible.

Other platforms are not affected as we use the #ifdef __APPLE__ directive to gate the logic.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • Tweak (non-breaking change to improve existing functionality)

Checklist:

  • I have read the contributing document.
  • My code has been run through clang-format.
  • My code follows the project's style guidelines
  • My code is not on the master branch.
    I'm not sure what I'm supposed to do here. My PR targets the master branch, but I found no other indications of what to target otherwise.
  • My code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

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/
[dock](bool) { SetMacOSDockFloatingBehavior(dock, dock->isFloating()); });

if (dock->isFloating()) {
QTimer::singleShot(0, dock, [dock]() { SetMacOSDockFloatingBehavior(dock, dock->isFloating()); });
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copied this idea from frontend/widgets/OBSBasic_SceneCollections.cpp:1633


if (floating) {
nsWindow.level = NSFloatingWindowLevel;
nsWindow.hidesOnDeactivate = NO;
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the critical line :)

@TizianoCoroneo TizianoCoroneo changed the title fix: avoid hiding floating docks when the OBS app is not active. fix: avoid hiding floating docks when the OBS app is not active on macOS. Apr 15, 2026
@TizianoCoroneo TizianoCoroneo changed the title fix: avoid hiding floating docks when the OBS app is not active on macOS. frontend: avoid hiding floating docks when the OBS app is not active on macOS. Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant