Skip to content

Commit 37512bb

Browse files
committed
Rename OnSizeChanged to OnPaint
Minor code tidy up - move OnPaint to bottom of ChromiumWebBrowser
1 parent b590881 commit 37512bb

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

CefSharp.Core/ManagedCefBrowserAdapter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ namespace CefSharp
469469
*(CefBrowserSettings*) browserSettings->_internalBrowserSettings, NULL);
470470
}
471471

472-
void OnSizeChanged(IntPtr^ sourceHandle)
472+
void OnPaint(IntPtr^ sourceHandle)
473473
{
474474
HWND hWnd = static_cast<HWND>(sourceHandle->ToPointer());
475475
RECT rect;

CefSharp.WinForms/ChromiumWebBrowser.cs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,6 @@ public ChromiumWebBrowser(string address)
5959
Paint += OnPaint;
6060
}
6161

62-
private void OnPaint(object sender, PaintEventArgs e)
63-
{
64-
// Size is 0x0 when we are on a modeless Form which is minimized.
65-
if (!Size.IsEmpty && managedCefBrowserAdapter != null)
66-
managedCefBrowserAdapter.OnSizeChanged(Handle);
67-
}
68-
6962
protected override void Dispose(bool disposing)
7063
{
7164
Paint -= OnPaint;
@@ -352,5 +345,14 @@ public Task<string> GetTextAsync()
352345
managedCefBrowserAdapter.GetText(taskStringVisitor);
353346
return taskStringVisitor.Task;
354347
}
348+
349+
private void OnPaint(object sender, PaintEventArgs e)
350+
{
351+
// Size is 0x0 when we are on a modeless Form which is minimized.
352+
if (!Size.IsEmpty && managedCefBrowserAdapter != null)
353+
{
354+
managedCefBrowserAdapter.OnPaint(Handle);
355+
}
356+
}
355357
}
356358
}

0 commit comments

Comments
 (0)