First attempt at a fix for #522 - this is a hack.

Keeping track for future reference
This commit is contained in:
amaitland
2014-10-30 14:46:26 +10:00
parent 3a0d9cfc0a
commit bb27ea3c48
2 changed files with 11 additions and 2 deletions
@@ -19,8 +19,6 @@ namespace CefSharp.WinForms.Example.Minimal
Text = "CefSharp";
WindowState = FormWindowState.Maximized;
CreateBrowser();
var bitness = Environment.Is64BitProcess ? "x64" : "x86";
var version = String.Format("Chromium: {0}, CEF: {1}, CefSharp: {2}, Environment: {3}", Cef.ChromiumVersion, Cef.CefVersion, Cef.CefSharpVersion, bitness);
DisplayOutput(version);
@@ -28,6 +26,13 @@ namespace CefSharp.WinForms.Example.Minimal
//Only perform layout when control has completly finished resizing
ResizeBegin += (s, e) => SuspendLayout();
ResizeEnd += (s, e) => ResumeLayout(true);
Load += OnLoad;
}
private void OnLoad(object sender, EventArgs e)
{
CreateBrowser();
}
private void CreateBrowser()
+4
View File
@@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
@@ -353,6 +354,9 @@ namespace CefSharp.WinForms
private void OnPaint(object sender, PaintEventArgs e)
{
//HACK: Temp fix for #522
Thread.Sleep(50);
// Size is 0x0 when we are on a modeless Form which is minimized.
if (!Size.IsEmpty && managedCefBrowserAdapter != null)
{