webview / webview_go

Go language bindings for the webview library.
MIT License
176 stars 27 forks source link

examples/basic: Blank screen #19

Closed powellnorma closed 6 months ago

powellnorma commented 6 months ago
git clone https://github.com/webview/webview_go
cd webview_go/examples/basic/
go run main.go

System: go version go1.21.4 linux/amd64

The cursor changes when I hover over where the text is supposed to be, but otherwise its just a blank white screen. In a VM (go version go1.21.4 linux/amd64) it works fine. Has anyone an idea what the issue could be?

I tried to use webview.New(true) in hopes of some helpful logs, but only get this:

# github.com/webview/webview_go
In file included from webview.cc:1:
../../libs/webview/include/webview.h: In member function ‘void webview::detail::gtk_webkit_engine::eval(const std::string&)’:
../../libs/webview/include/webview.h:617:35: warning: ‘void webkit_web_view_run_javascript(WebKitWebView*, const gchar*, GCancellable*, GAsyncReadyCallback, gpointer)’ is deprecated: Use 'webkit_web_view_evaluate_javascript' instead [-Wdeprecated-declarations]
  617 |     webkit_web_view_run_javascript(WEBKIT_WEB_VIEW(m_webview), js.c_str(),
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  618 |                                    nullptr, nullptr, nullptr);
      |                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/webkitgtk-4.0/webkit/WebKitPrintOperation.h:29,
                 from /usr/include/webkitgtk-4.0/webkit2/webkit2.h:74,
                 from ../../libs/webview/include/webview.h:510:
/usr/include/webkitgtk-4.0/webkit/WebKitWebView.h:526:1: note: declared here
  526 | webkit_web_view_run_javascript                       (WebKitWebView             *web_view,
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Overriding existing handler for signal 10. Set JSC_SIGNAL_FOR_GC if you want WebKit to use a different signal

The helloworld wails app worked fine though: https://wails.io/docs/tutorials/helloworld/

powellnorma commented 6 months ago

I have updated all system packages, and now it works. But why did the helloworld wails application work fine, while examples/screen didn't?

Btw, I now get these two additional lines:

libEGL warning: DRI2: failed to authenticate
libEGL warning: egl: failed to create dri2 screen

They were missing before. Not sure if that could be relevant

powellnorma commented 6 months ago

Now it happens again. Since it also happens with the C version, I reported it here: https://github.com/webview/webview/issues/1055