Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CefSharp.Core/ManagedCefBrowserAdapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,16 @@ namespace CefSharp
}
}

void WasHidden(bool hidden)
{
auto cefHost = _renderClientAdapter->TryGetCefHost();

if (cefHost != nullptr)
{
cefHost->WasHidden(hidden);
}
}

void SendFocusEvent(bool isFocused)
{
auto cefHost = _renderClientAdapter->TryGetCefHost();
Expand Down
3 changes: 3 additions & 0 deletions CefSharp.Wpf/ChromiumWebBrowser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,9 @@ private void OnIsVisibleChanged(object sender, DependencyPropertyChangedEventArg
// If the control was not rendered yet when we tried to set up the source hook, it may have failed (since it couldn't
// lookup the HwndSource), so we need to retry it whenever visibility changes.
AddSourceHookIfNotAlreadyPresent();

var isVisible = (bool)args.NewValue;
managedCefBrowserAdapter.WasHidden(!isVisible);
}

private static void OnApplicationExit(object sender, ExitEventArgs e)
Expand Down