Closed hungle9320 closed 2 years ago
@hungle9320 could this be because the popup is shown as a dialog? It will be difficult to understand without some code. Do you have like a skeletal code to attach?
@mattkol I'm seeing the same issue. It can be easily replicated by modifying the CrossPlatDemo. Just register a custom handler in the DemoApp class. It doesn't have to do anything. Afterwards if you resize the chromely app the content inside does not resize correctly anymore.
public class DemoApp : ChromelyBasicApp { public override void ConfigureServices(IServiceCollection services) { base.ConfigureServices(services); services.AddLogging(configure => configure.AddConsole()); services.AddLogging(configure => configure.AddFile("Logs/serilog-{Date}.txt"));
services.AddSingleton<CefLifeSpanHandler, CustomHandler>();
RegisterControllerAssembly(services, typeof(DemoApp).Assembly);
}
public class CustomHandler : CefLifeSpanHandler
{
protected override bool OnBeforePopup(CefBrowser browser, CefFrame frame, string targetUrl, string targetFrameName,
CefWindowOpenDisposition targetDisposition, bool userGesture, CefPopupFeatures popupFeatures,
CefWindowInfo windowInfo, ref CefClient client, CefBrowserSettings settings, ref CefDictionaryValue extraInfo,
ref bool noJavascriptAccess)
{
return base.OnBeforePopup(browser, frame, targetUrl, targetFrameName, targetDisposition, userGesture, popupFeatures, windowInfo, ref client, settings, ref extraInfo, ref noJavascriptAccess);
}
}
}
I need to display popup then I have create a custom
public class CustomCefLifeSpanHandler : CefLifeSpanHandler { }
services.AddSingleton<CefLifeSpanHandler, CustomCefLifeSpanHandler>();
After this, the pop up can populate at expected size and responsive but the main window content is now fixed at default 1200x900, It cannot responsive when I resize the browser. And the popup cannot request to the cef-controller.
Are there any fix for this?
Thanks