frontend: Hide Twitch docks on minimized start#13368
frontend: Hide Twitch docks on minimized start#13368BeekeeperAlex wants to merge 1 commit intoobsproject:masterfrom
Conversation
|
What is different between the non-Twitch integration docks that necessitates this kind of workaround? Why are we hacking in setting the docks to hidden instead of fixing the root of the problem? |
|
Fair. I focused on Twitch because that is where I could reproduce it, and Twitch’s delayed secondary dock loading made the behavior obvious, but I agree there is a deeper issue. This is my first PR so I was a little timid to go deeper and make a wider change. The root issue appears to be that service/browser docks can be created/restored while OBS intentionally never calls I’ll push my original fix that handles hidden startup at the OBSBasic/extra-dock level. |
|
Okay I pushed my original fix from before I decided to keep my changes more local to the symptom I can actually reproduce. Obviously this hits a wider surface, but I do believe it's the real fix. Just hard to test without a build artifiact that has those features enabled. |
BeekeeperAlex
left a comment
There was a problem hiding this comment.
Adding a few notes on the choices here.
| bool sysTrayWhenStarted = config_get_bool(App()->GetUserConfig(), "BasicWindow", "SysTrayWhenStarted"); | ||
| bool hideWindowOnStart = QSystemTrayIcon::isSystemTrayAvailable() && sysTrayEnabled && | ||
| (opt_minimize_tray || sysTrayWhenStarted); | ||
| deferExtraDockVisibility = hideWindowOnStart; |
There was a problem hiding this comment.
Reuse the same startup-hidden condition so docks know OBS is intentionally hidden, not just mid-startup.
| return; | ||
| } | ||
|
|
||
| deferredExtraDockVisibility.append({dock, dock->isVisible()}); |
There was a problem hiding this comment.
Record the restored visibility before hiding, so floating docks come back exactly as saved once OBS is shown.
| QByteArray dockState = QByteArray::fromBase64(QByteArray(dockStateStr)); | ||
|
|
||
| if (main->isVisible() || !main->isMaximized()) | ||
| if (main->IsDeferringExtraDockVisibility() || main->isVisible() || !main->isMaximized()) |
There was a problem hiding this comment.
Twitch loads these panes late, so we still need to restore their saved layout before the generic dock hiding kicks in.
2f44fcf to
76d0cce
Compare
76d0cce to
ebe4dbe
Compare
|
If I'm not mistaken this other PR would consider the wrong behaviour identified by this PR as "desired" behaviour and would like to extend it to docks generally: #13325. |
|
Having the docks show even though I've set the app to start minimized is desired behavior? Also when this bug happens it destroys the user's saved dock layout. Since they were forced to show floating even if you had docked them, they then remember they are floating and stay that way. You can see several years of frustration by users in the thread I linked. They're even installing plugins to save dock layouts just so they can click a button to restore their actual layout after this bug destroys it. And it's definitely a pain point for me as I'm using OBS as a replay buffer that I want to start with windows and stay out of the way, but instead I have to close all the floating dock windows on every startup. Then later I have to re-enable the docks and re-dock them the way I want them when I actually need them. |
|
Just making an official note that this PR will be considered despite not being able to check the "has been tested" list item due to the valid reason stated in the OP. |
Fixes the bug discussed here: https://obsproject.com/forum/threads/docks-reset-each-time-when-i-launch-obs-after-new-update-29.164196/
Description
When OBS is set to "Minimize to system tray when started" the Twitch integration dockable windows are all forced into view, floating and unhidden. Manually minimizing OBS does not have this problem as even undocked floating windows completely outside of the main OBS window will still correctly hide themselves. Only when OBS is set to start minimized do these Twitch dockable windows force themselves into a visible floating state while the rest of OBS is minimized as it should be.
This change records the intended visibility of the Twitch docks during minimized startup, hides them while OBS remains hidden, and restores their saved visibility when OBS is actually shown.
Motivation and Context
Twitch dock windows should follow the same hidden state as the main OBS window during startup minimized to tray, matching the behavior users already get when minimizing OBS manually after startup.
Other stream platform integration docks did not show the same minimized-start behavior in stable OBS. This patch stays limited to Twitch because Twitch creates its integration docks through a separate delayed dock-loading path.
How Has This Been Tested?
Reproduced the issue on stable OBS for Windows with Twitch connected and "Minimize to system tray when started" enabled.
Verified on stable OBS that manually minimizing OBS hides floating Twitch docks and restores them as floating when OBS is restored, so the issue is specific to minimized startup rather than normal floating dock behavior.
I have not been able to runtime-test this exact PR artifact. Fork PR Windows artifacts are built without Twitch integration support because
TWITCH_CLIENTIDandTWITCH_HASHare unavailable to untrusted fork PR builds. The resulting artifact only exposes stream-key setup and does not include Twitch OAuth or Twitch docks. Runtime validation needs a maintainer/CI build with the OBS Twitch credentials enabled.Types of changes
Checklist: