Skip to content

frontend: a floating dock stays shown while OBS is inactive (Fixes #5409) - #5412

Merged
vpacher merged 4 commits into
masterfrom
fix/5409-floating-docks-stay-visible
Nov 21, 2026
Merged

vpacher merged 4 commits into
masterfrom
fix/5409-floating-docks-stay-visible

Conversation

@vpacher

@vpacher vpacher commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

Fixes #5409.

Problem

On macOS a floating dock (for example Scenes or Stats on a second display) disappeared whenever another app became active, and came back when OBS was active again. The main window stayed visible. A floating QDockWidget is a Qt::Tool window, and Qt on macOS makes a tool window an NSPanel that hides while the application is inactive, unless the widget has Qt::WA_MacAlwaysShowToolWindow. OBS set it nowhere.

Change

  • KeepFloatingDockShown() (frontend/utility/dock-window.hpp, header-only, Qt Widgets only) sets Qt::WA_MacAlwaysShowToolWindow. On other platforms the attribute does nothing.
  • OBSDock calls it in both constructors: the main docks, Controls, Stats, docks added through the frontend API and browser docks.
  • OBSBasic::AddDockWidget() and OBSBasic::AddCustomDockWidget() call it too, for a plugin's own QDockWidget.
  • docs/features.md: one line under Fixed upstream bugs, Scenes and UI.

Not in this PR: KWin (KDE Plasma) has its own option, "Hide utility windows for inactive applications", which can hide floating docks in the same way. This attribute does not change that, and it is not tested here.

Tests

floating_dock_stays_shown_while_inactive in test_close_top_level (no new target): a main window with a dock, KeepFloatingDockShown(), then the dock floats; the case checks that the dock is a floating tool window with Qt::WA_MacAlwaysShowToolWindow. The test shows that the attribute is set; that macOS then keeps the window shown is checked by hand (below).

RED 62b5bd551 (stub that does nothing): Linux (Qt 6.11.1, offscreen) fails with floating 1, tool window 1, WA_MacAlwaysShowToolWindow 0 (expected 1 1 1). GREEN: 9/9 cases in 10 of 10 runs, and the Qt Frontend Linux lane passes (ci/linux_qt_frontend.py). Test cost: under 0.1 s for the new case, no own threads.

Registration: test_close_top_level now watches frontend/utility/dock-window.hpp, and canonical_close_top_level_is_registered pins it (64d75b427, after the first CI run failed on the old pin).

Tier 2 and Tier 3: not applicable (frontend, no C original).

Real app

macOS 27.2.1 build on Apple silicon: float Scenes and Stats, click another app (Finder). Before: both docks disappear until OBS is active again. With the fix: both stay visible.

🤖 Generated with Claude Code

vpacher and others added 3 commits November 21, 2026 14:02
)

floating_dock_stays_shown_while_inactive in test_close_top_level floats a
dock after KeepFloatingDockShown() (frontend/utility/dock-window.hpp, a stub
that does nothing) and checks that the dock's tool window has
Qt::WA_MacAlwaysShowToolWindow. Without it, Qt on macOS hides the window
while another app is active.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…5409)

KeepFloatingDockShown() sets Qt::WA_MacAlwaysShowToolWindow. OBSDock calls
it in its constructors (the main docks, Controls, Stats, docks added through
the frontend API, browser docks), and AddDockWidget() and
AddCustomDockWidget() call it for a plugin's own QDockWidget. On macOS Qt
then no longer hides a floating dock while another app is active; on other
platforms the attribute does nothing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@vpacher
vpacher force-pushed the fix/5409-floating-docks-stay-visible branch from 8f28909 to fb23f85 Compare November 21, 2026 13:11
@vpacher vpacher changed the title docs: features ledger line for floating docks that stay visible (Refs #5409) frontend: a floating dock stays shown while OBS is inactive (Fixes #5409) Nov 21, 2026
@vpacher
vpacher marked this pull request as ready for review November 21, 2026 13:20
@vpacher
vpacher requested a review from zackees as a code owner November 21, 2026 13:20
@vpacher
vpacher enabled auto-merge November 21, 2026 13:20
…5409)

canonical_close_top_level_is_registered pins the watch inputs of
test_close_top_level; the floating dock case added dock-window.hpp to them
(Fast Gate and the macOS and Windows Rust Tests, run 44907599907).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@vpacher
vpacher added this pull request to the merge queue Nov 21, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 21, 2026
@vpacher
vpacher added this pull request to the merge queue Nov 21, 2026
@vpacher
vpacher removed this pull request from the merge queue due to a manual request Nov 21, 2026
@vpacher
vpacher added this pull request to the merge queue Nov 21, 2026
Merged via the queue into master with commit 224faff Nov 21, 2026
45 checks passed
@vpacher
vpacher deleted the fix/5409-floating-docks-stay-visible branch November 21, 2026 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

macOS: floating docks disappear while OBS is not the active app

1 participant