Open ttytm opened 10 months ago
I can't see that any of the destructors in the core library make an attempt at closing the window so this may affect more platforms and possibly all of them.
I've confirmed that the documentation in the core library also states that the window will be closed, so if that doesn't happen then this is a bug in the core library.
The issue was moved here because the Go binding moved.
I would like to clarify something now that I am looking a bit more into this.
In the example code you provided, the library manages the main loop, but by calling Destroy()
then you're signaling that you want to tear down the webview instance and everything it owns while the main loop managed by the same webview instance is still running.
Please explain in more detail what you're trying to do, how it isn't working according to your expectations and the solution you're seeking.
Yes it's an issue with the core lib. I thought to include the reproduction in Go as it felt the simplest.
The Idea was to close the window but to be able to keep the background process running and to re-create a window on demand. To save time of initializing the application, loading configurations, caches, setting up a localhost / websocket server etc.
Would being able to control the visibility of the window be a satisfactory solution? That way you could hide/show the window instead of closing and recreating it.
Yes Hide/Show would help. A useful functionality to have in general 👍.
Additionally, a function to set the window as utility window would then help to fully achieve what is desired in my use-case. As the program doesn't need an app icon in the launcher.
E.g. set_type_hint(Gdk.WindowTypeHint.UTILITY)
for gtk windows and NSApp.setActivationPolicy(.accessory)
for NSWindows.
I am also experiencing this... https://github.com/webview/webview_go/issues/13
Doc:
// Destroys a webview and closes the native window.