-
-
Notifications
You must be signed in to change notification settings - Fork 555
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash on Windows when opened from system tray #720
Comments
Specification
I have same problem import webview
webview.create_window('Hello world', 'https://pywebview.flowrl.com/')
webview.start()
|
@simonrob both libraries need to be run on a main thread. threading cannot do that, but using multiprocessing combined with a queue to pass data between processes might do the trick. |
@r0x0r thanks, but as the example shows, both are running on the main thread, and work on Linux and macOS which has the same requirements. (I don't think the other reply in this issue is actually the same problem.) |
I looked at this again and found that it may actually not be anything to do with the thread, but actually some underlying pywebview incompatibility with pystray on Windows. On Windows, simply adding Pystray itself works fine when both are imported together (in either order). What could be going on here? |
Just to follow up, as discussed in a pystray issue, this is caused by Should this call be conditional on |
I have no idea about this either, but if this solves the problem then it is fine by me. Thanks for the PR! |
Specification
Description
I use pywebview along with pystray (0.17.3) as part of a script that occasionally needs to pop up a login window. Because both pywebview and pystray need to run on the main thread, I open the webview from a click on the system tray icon, as shown in the basic example below. This action runs on the main thread, and on macOS and Ubuntu it works with no issues. On Windows it gives the following error:
A minimum example to demonstrate the issue is given below. Run this code on Windows and you will see a black square appear in the system tray. Right-click the icon and click the Webview option to trigger the crash. I've also added the thread names to show that both pystray and pywebview are running on the main thread:
Practicalities
YES/NO I am willing to work on this issue myself.
Possibly, if you can point to where to begin
YES/NO I am prepared to support this issue financially.
If needed
The text was updated successfully, but these errors were encountered: