obsproject / obs-browser

CEF-based OBS Studio browser plugin
GNU General Public License v2.0
776 stars 220 forks source link

Fix sources not rendering after hide/show #344

Closed WizardCM closed 2 years ago

WizardCM commented 2 years ago

Description

Back in 2019 when we updated to CEF 3770, the WasHidden() API was broken.

Because of this, @zavitax had to write a custom visibility handler. This worked well until the update to 4638, where it introduced terrible performance when sources weren't visible, so @VodBox submitted a PR to revert back to using the WasHidden() API, as it looked to be fixed.

Unfortunately, it seems the current CEF version has the same bug as before. Marshall has apparently merged a fix, but the fix doesn't seem to work in this case.

However, the hack that previously didn't work - HasResized() - does seem to work now. This PR enables that hack.

In summary:


Additionally, the PR that introduced 4638 support to obs-browser incorrectly renamed some variables. I need @VodBox and @PatTheMav to confirm whether this should be scoped to _WIN32 or not.

Motivation and Context

We like browser sources that function correctly & have good performance.

Fixes #342

How Has This Been Tested?

Types of changes

Checklist:

VodBox commented 2 years ago

The flag should not be _WIN32. The reason the flag exists is to conditionally turn it on in CMake with a manual override. The reason it's not a convenient toggle is due to the fact that SendExternalBeginFrame at this time does not work.

WizardCM commented 2 years ago

Alrighty, I'll ignore that part for now.