Added support for resizing. Doesn't work fully, throws exceptions sometimes, but it's at least a start.

This commit is contained in:
Per Lundberg
2013-07-23 22:58:59 +03:00
parent c6fbd4e7e7
commit 192d72e5f0
3 changed files with 20 additions and 0 deletions
+1
View File
@@ -22,6 +22,7 @@ namespace CefSharp
void SetCursor(IntPtr cursor);
void ClearBitmap();
void SetBitmap();
void SetPopupBitmap();
@@ -85,6 +85,18 @@ namespace CefSharp
_renderWebBrowser->SetCursor((IntPtr) cursor);
}
void WasResized()
{
if (this->GetCefBrowser() == nullptr ||
this->GetCefBrowser()->GetHost() == nullptr)
{
return;
}
this->GetCefBrowser()->GetHost()->WasResized();
}
private:
void SetBuffer(int width, int height, const void* buffer)
@@ -119,6 +131,8 @@ namespace CefSharp
currentWidth != width ||
currentHeight != height)
{
_renderWebBrowser->ClearBitmap();
if (backBufferHandle)
{
UnmapViewOfFile(backBufferHandle);
+5
View File
@@ -39,5 +39,10 @@ namespace CefSharp
CefBrowserHost::CreateBrowser(window, _renderClientAdapterInternal, url,
*(CefBrowserSettings*) browserSettings->_internalBrowserSettings);
}
void WasResized()
{
_renderClientAdapterInternal->WasResized();
}
};
}