-
-
Notifications
You must be signed in to change notification settings - Fork 473
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
[gtk3.py] Blank window, browser embedding fails due to invalid X11 handle #393
Comments
I can reproduce the error. Anyone know how to fix it?
|
@gzfrancisco Two things to try:
To debug this further please create a topic on the Forum for your case. The original reporter had still issues in his script that weren't fixed (window was not resized properly). |
I just did that. The script runs but the window doesn't appear. What can it be? |
It might be that the specific GTK 3 version that is used is broken. There is this issue in cefcapi project that states that GTK 3.15 and later are broken with CEF. But 3.10 works fine. If you want to use latest then there is a comment with a solution which is to use the default X visual instead of GTK's blessed one. You can try that. I don't have python code for that. See: cztomczak/cefcapi#9 |
Might be related to: #347 |
Issue #446 ("Support linking to GTK 3 when building CEF from sources and when building cefpython module") might resolve this issue. But still some GTK 3 versions will just fail. |
It seems like GTK 3.15 just flat out refuses to provide a real root window visual. No matter how I tried to get it, it always substituted a RGBA visual, which caused this bug. However, doing something like this works: E.g. if you find out the true ID of the root window visual (not using GTK), CEF window can be embedded into GTK window. I also tried compiling CEF + CEF Python from sources with the same GTK version that I use, it didn't help at all. |
I ran into this problem for wxPython, fresh Ubuntu 18.04, cefpython3 from pip. I can't really submit a patch, but in general, I coded the above solution referenced by @haimgel . It's more difficult to do from Wx, or there is a better way and I haven't found it. Ultimately, I created a fresh ScrolledWindow for the browser to parent. I also had to modify the OnSize routine accordingly to resize my new parent scroll window. Finally, after this, I was able to replace the call to "wx.CallLater" to the embed_browser routine, with a simple call to "wx.CallAfter". The wx.CallAfter will happen ASAP as soon as rendering occurs, so the handles needed will be available, and I think its more reliable. Note, I'm using python3 (3.6.5 comes on Ubuntu 18.04), so I don't know if this is compatible at all with python2.7. But I suspect the same technique would work. In the "if LINUX" section at top of code:
For "embed_browser":
For OnSize:
|
@cztomczak @rocker71 this was quite helpful! |
@rocker71 That's a very interesting approach. I have managed to replicate it also in Ubuntu 18.04. |
This issue occurs on some of machines. There is no error in console logs. When ran with
--debug
flag you can see many X11 errors after the call toCreateBrowserSync
. Thus it looks like the X11 window handle is invalid. See example log:Issue #446 ("Support linking to GTK 3 when building CEF from sources and when building cefpython module") might resolve this issue. But still some GTK 3 versions will just fail.
The original reporter didn't provide OS information, but I guess this is only Linux issue.
There was a similar issue in gtk2.py (GTK 2) example reported on the Forum here and the solution was to show the window before embedding browser, so that window is realized and X11 window handle is available.
I cannot reproduce this issue on my Ubuntu 14.04 with CEF Python v57.0, thus I cannot debug this.
Issue originally reported on the Forum:
https://groups.google.com/d/topic/cefpython/Oa1kybcNdh4/discussion
The text was updated successfully, but these errors were encountered: