From db517cc2dabfba5e32a6711746fc6add2b72ccd7 Mon Sep 17 00:00:00 2001 From: dimas Date: Thu, 4 Dec 2014 23:33:38 +0700 Subject: [PATCH] Removing Invalidate call from inside OnIsVisibleChanged, instead making it a method so it can be called from other place if necessary --- CefSharp.Wpf/ChromiumWebBrowser.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/CefSharp.Wpf/ChromiumWebBrowser.cs b/CefSharp.Wpf/ChromiumWebBrowser.cs index fd5e7cc1c..e1533b42f 100644 --- a/CefSharp.Wpf/ChromiumWebBrowser.cs +++ b/CefSharp.Wpf/ChromiumWebBrowser.cs @@ -509,9 +509,6 @@ namespace CefSharp.Wpf var isVisible = (bool)args.NewValue; managedCefBrowserAdapter.WasHidden(!isVisible); - - if (isVisible) - managedCefBrowserAdapter.Invalidate(PaintElementType.View); } private static void OnApplicationExit(object sender, ExitEventArgs e) @@ -1291,5 +1288,13 @@ namespace CefSharp.Wpf managedCefBrowserAdapter.AddWordToDictionary(word); } + // Invalidate the view. The browser will call CefRenderHandler::OnPaint + // asynchronously. This method is only used when window rendering is + // disabled. + public void Invalidate(PaintElementType type) + { + managedCefBrowserAdapter.Invalidate(type); + } + } }