MicroSugarDeveloperOrg / Avalonia.WebView

MIT License
201 stars 32 forks source link

Failed to load when wrap in a TabControl in Avalonia on Linux #11

Open charleypeng opened 1 year ago

charleypeng commented 1 year ago

os: ubuntu22.04 avalonia:11.0.0.1 BlazorWebview.Avalonia:11.0.0.1

I just added an basic razor page and when using single <BlazorWebView HostPage="wwwroot/index.html"></BlazorWebView>

works just fine,

but when wrap it into a tabcontrol it failed

`

`

however, on windows it works fine, but on linux it shows error below:

 Gtk-CRITICAL **: 20:51:07.608: gtk_widget_realize: assertion 'widget->priv->anchored || GTK_IS_INVISIBLE (widget)' failed

Process finished with exit code 139.
charleypeng commented 1 year ago

p.s, on windows, when click other tabitem and click back , the blazorwebview control seems to be disposed, and disappeared.

ChisterWu commented 1 year ago

This is a bug in linux, I found that webview can not be used together with Avalonia's controls, but I do‘t know the specific reason

charleypeng commented 1 year ago

This is a bug in linux, I found that webview can not be used together with Avalonia's controls, but I do‘t know the specific reason

I am reading the code and going to ask the avalonia community later

crankywilson commented 1 year ago

I couldn't get the sample to work on Linux without any change. I also get the "(WebViewSample.Desktop:13953): Gtk-CRITICAL **: 22:57:54.225: gtk_widget_realize: assertion 'widget->priv->anchored || GTK_IS_INVISIBLE (widget)' failed"

alexanderSP11 commented 1 year ago

Have the same issue. Is a solution planned?

charleypeng commented 1 year ago

I couldn't get the sample to work on Linux without any change. I also get the "(WebViewSample.Desktop:13953): Gtk-CRITICAL **: 22:57:54.225: gtk_widget_realize: assertion 'widget->priv->anchored || GTK_IS_INVISIBLE (widget)' failed"

this seems to be a scaling issue which may be fix in the next release of avalonia, let's just try the pre release

ChisterWu commented 1 year ago

I couldn't get the sample to work on Linux without any change. I also get the "(WebViewSample.Desktop:13953): Gtk-CRITICAL **: 22:57:54.225: gtk_widget_realize: assertion 'widget->priv->anchored || GTK_IS_INVISIBLE (widget)' failed"

maybe this is the error for webview api(realize)