-
Notifications
You must be signed in to change notification settings - Fork 22
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
Neon (Ubuntu) blanks screens with pywebviewqt (but works with gtk) #35
Comments
Hi @wd5gnr, I really appreciate your feedback 👍🏻 and I will try to apply this solution for Linux. However, I would like to point out that other users have been able to run the software successfully under Linux and QT, so perhaps this solution only applies in certain particular cases such as KDE Neon. I will definitely take a closer look at this. @happenpappen, if you have time, as someone who also uses the software on Linux, do you have any insights on this matter? Thanks a lot :) (I found this : r0x0r/pywebview#890) |
Also, have you installed this dependancy? |
Yes both of those show satisfied. There is evidence that it isn't just me and the test.py shows it isn't you, it is some setup of pywebview[qt]: I had not noticed the 890 one you mentioned ... will look at that. But no, all of that is already installed. |
@wd5gnr and @happenpappen, what do you recommend to solve this issue for sure, given that I don't have a Linux to test it myself? (It is very simple indeed to force GTK but the installation changes a little if I understood correctly and moreover, depending on the use of the venv). |
Without knowing the cause, I would hesitate to make too many big changes. Here's what I would propose: In conf.py add a variable for webviewGUI:
That's my suggestion. I don't think passing '' to gui= is the same as leaving it off, but there might be a better way to do that. I was thinking you could set it to None, but a quick test shows you'd still have to do the above but just test for none instead of '' and I don't think that really makes any difference. |
Oh and then, of course, in the Linux readme, you might point out that change conf.py to set conf.WEBVIEW_GUI to 'gtk' is known to help instances where qt is broken and that other values are qt, and the others that can go there (I don't remember the one for Windows). |
@jczic : I tried reproducing this on my laptop (which runs on Ubuntu 22.04 as well) by installing the Neon desktop, but ended in a mess regarding the installed packages. If i had sufficent ressources available on my laptop, i could try this in a virtual machine, but that's currently not possible. I like @wd5gnr idea of making this a configuration option which has a safe default setting. Maybe it is possible to check the available engines on the first startup of the program and set the config option automatically? |
Actually, if you want to have it where the config is None to take the default, here's how to do it (had to do some reading):
So using a scheme like that you could pass None to start (probably need to add a self to wrapper) and get the default, but if you pass, say, 'gtk', you'd get that. I'd make the change and send a PR but it would be next week before I could do that so if you want to just grab it from here that's perfectly fine. You should probably make the call of exactly how far down this rabbit hole you want to go anyway ;) |
👍 Thank you both so much, I will see what I can do quickly, but tonight, for this option! |
Just @wd5gnr, if it does not work, you see 2 white screens but what exactly is going on? ( I would like to be able to detect the problem automatically because changing a configuration in the sources implies a desynchronization with the repository. Or maybe run app.py with an argument... ) |
You get two blank white screens and then they're hung up so they're not
processing events. The only way I can stop it is to externally, kill it or
press control z to put it to sleep and then I can kill it while it's asleep
but clicking on the x or even pressing control. C does not cause it to exit
when it gets into that mode.
I ran it through the debugger and essentially webview start. Just never
enters the event loop. It's getting hung somewhere in there.
…On Sat, Apr 1, 2023, 13:15 Jean-Christophe Bos ***@***.***> wrote:
Just @wd5gnr <https://github.com/wd5gnr>, if it does not work, you see 2
white screens but what exactly is going on?
Does it crash the software and it close or do the 2 screens stay open
indefinitely?
Maybe a *try...except* on *start(...)* is raised?
( I would like to be able to detect the problem automatically because
changing a configuration in the sources implies a desynchronization with
the repository. Or maybe run app.py with an argument... )
—
Reply to this email directly, view it on GitHub
<#35 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AARTDE7KTIPZ5NFDO57TFR3W7BWC3ANCNFSM6AAAAAAWO7JL44>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Ok I see, it does not receive the WebSocket (there is my little HTTP/WebSockets server inside). hidden = not (conf.IS_WIN32 | conf.IS_LINUX), If you look at the side of this line, you will see the creation of the 2 UI windows. So the program does not crash and there would be a way to automatically detect it because the WebSocket does not connect after a certain time between the browser and the internal server. Also, you can pass Everything of pywebview arguments is here: Do you launch the app through the Linux shell or directly through the GUI? Maybe I could write some during the startup procedure in the terminal so we can see the steps :) |
I thought that as well, but I was able to open a browser on the server socket mentioned in the config file. So I don't think it is that simple. The fact that it works with gtk tells me it is something with the qt rendering. The fact that I can make it work without the venv and my test case doesn't work with the venv tells me it is some sort of setup/version mismatch.... |
Hi @wd5gnr, is-it fixed for you? |
I'm not sure what you are expecting to happen. The result for me is the same. I launch the code and I get what appears now to be a single window in the same state as before: blank and hung up. From the command line, the only thing I can do to get control back is Control+Z. Then I can kill the process. Running it again does nothing. There are no --help options. So... no, unless I don't understand what to do, it is not working. I did not look at your commit, but I will do so now. |
Ok -g gtk does work. But the code to detect it is hung isn't working. I'm not surprised because, well, it is hung ;-) Everything is blocked. Just to be clear, clicking the X on the window or using Control+C from the launching console does NOTHING. From the debugger, the webview start() is never returning ever. |
Hmm :( |
I agree it is nothing you are doing that is causing this because even my simple test program doesn't work without forcing gtk.Like I say, when you single step, the call to start on the webview is what hangs. I haven't traced further than that because it is upstream. But there are enough people using KDE that I think along with the switch just a note in the "how to run for Linux" would be sufficient and maybe one day the upstream will get it fixed. |
In reality, the pyWebView library, which uses the best web browser available, decides to use QT or GTK depending on what it finds on your system. How do you see what can be explained in the Linux section of the readme? |
From my point of view: nothing. It's only the try to confirm, that I can reproduce this (equal reason ?) situation! |
I added the info to force the GUI in the readme, commit: 937230d |
That's fine with me.
Thanks for working this.
…On Sat, Apr 8, 2023, 10:45 Jean-Christophe Bos ***@***.***> wrote:
I added the info to force the GUI in the readme, commit: 937230d
<937230d>
It's ok for you? Can I close this issue?
—
Reply to this email directly, view it on GitHub
<#35 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AARTDEYRMWL2SJBORHTBZRTXAGB2VANCNFSM6AAAAAAWO7JL44>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I consistently get two blank screens and a hang when trying to run under KDE Neon (basically Ubuntu). I tried a few things. To isolate the problem I did this:
If I am not in the venv and I have python3-webview installed it works. Without that package, of course, it doesn't.
If I go into the Jama venv, then it does not work (same as the app) with or without python3-webview (but with the pip-managed webview[qt].
However, if I do: pip3 install pywebview[gtk] and then modify the code to include gui='gtk' on the start line it works. Making the same change in app.py allows MPY-Jama to run also.
The text was updated successfully, but these errors were encountered: