Winform Browser Control - Popup Issue

91 views
Skip to first unread message

pjcast

unread,
Sep 8, 2017, 6:26:22 PM9/8/17
to CefGlue
Hi,

When using either one of the CefWebBrowser control from CefGlue.WindowsForms or CefWebBrowser from CefGlue.Demo.WinForms the following problems happen when the web site (either via click or JS opens a popup window): The newly created Popup Window resizes when you resize the first window that had actually triggered the popup. Resizing the popup has no effect on the first window.

I think this may be causing me some other issues. But, seeing if anyone has noticed this? I'm using a recent tag, 3029. But saw this a couple years ago as well.

Note, if I start directly from a popup window (such as CefWebView) opening additional popups does not exhibit this behavior. Also, not seen in CefClient examples, works fine there.

Thanks!

pjcast

unread,
Sep 8, 2017, 6:56:54 PM9/8/17
to CefGlue
Well, looked at this more, and the resizing issue (and another issue I had) seemed to be caused by the CefWebBrowser.OnBrowserAfterCreated method.

When it is called the first time (main form loaded), the Browser is null. Calling the base class  base.OnBrowserAfterCreated(browser); implementatiobn sets Browser correctly. NOw, when a popup appears, this method is called again with a new browser, and calling the base class will overwrite the Browser with the popup's browser (seems incorrect). Worked around on my inheirited class by:

protected override void OnBrowserAfterCreated(CefBrowser browser)
{
   if (Browser == null)
   {
       base.OnBrowserAfterCreated(browser);
   }

Which fixes the resize issue and other problems I saw. Can you confirm that the base class is broken or is this somehow intended?

Thanks

pjcast

unread,
Sep 11, 2017, 11:35:43 AM9/11/17
to CefGlue
Though, with fix, when the popup window closes, the same problem reoccurs... The original window's browser stops resizing correctly - looking into this, I think it is the same issue of the local window's browser getting switched for the popup windows browser - or is somehow disposed incorrrectly.
Reply all
Reply to author
Forward
0 new messages