I get the following output when I run "python3 gtk3.py" and no window shows up:
[gkt3.py] CEF Python 57.0
[gkt3.py] Python 3.5.2 64bit
[gkt3.py] GTK 3.18
[0522/221555.374795:ERROR:child_thread_impl.cc(762)] Request for unknown Channel-associated interface: ui::mojom::GpuMain
The same happens for Python 2:
$ python gtk3.py
[gkt3.py] CEF Python 57.0
[gkt3.py] Python 2.7.12 64bit
[gkt3.py] GTK 3.18
[0522/225629.533477:ERROR:child_thread_impl.cc(762)] Request for unknown Channel-associated interface: ui::mojom::GpuMain
OS: Ubuntu 16.04
CEF Python revision: 25166136aaa4d5404092e4c24cee8c5ac041dd72
Any ideas about what could be going wrong?
Cheers,
Jendrik
I tried to debug this by figuring out which lines of code are executed. It seems the line "self.browser = cef.CreateBrowserSync(window_info, url="https://www.google.com/")" is where the problem occurs. The next line in the containing function "embed_browser" is never executed. The line depends on window_info, which in turn depends on self.get_handle(). The returned handle is 20971527.
Cheers,
Jendrik
threading.Timer(1.0, self.embed_browser).start()cef.PostDelayedTask(cef.TID_UI, 1000, self.embed_browser)self.window.realize()
self.window.show_all()
self.embed_browser()
=> no window
self.window.realize()
self.window.show_all()
import threading
threading.Timer(1.0, self.embed_browser).start()
=> window appears, no embedded browser, then AssertionError: cefpython.CreateBrowserSync() may only be called on the UI thread
self.window.realize()
self.window.show_all()
GObject.timeout_add_seconds(1, self.embed_browser)
=> window appears, no embedded browser, window doesn't respond
The handle is always 69206023, so retrieving it is not the problem and hardcoding it has the same effect.
I'm afraid I'm running into the same issue. I'm running Arch Linux, here is the output of the example:
[Info] CEF Python 57.0
[Info] Python 3.6.2 64bit
[Info] GTK 3.22
[0815/212757.343553:ERROR:child_thread_impl.cc(762)] Request for unknown Channel-associated interface: ui::mojom::GpuMain
Here is an output running the script with --debug : https://pastebin.com/trPa1YXw
As a workaround I will downgrade my gtk3 version
I'm trying to implement it using
import threading
args = [cef.TID_UI, cef.CreateBrowserSync]
threading.Timer(0.2, cef.PostTask, args).start()
The issue is how do I get the returned value of cef.CreateBrowserSync since cef.PostTask returns void ?
Here is my implementation with timer / posttask so far:
```
def on_activate(self, *_):
108 self.window.realize()
109 args = [cef.TID_UI, self.embed_browser]
110 threading.Timer(2, cef.PostTask, args).start()
111 self.window.show_all()
112 # Must set size of the window again after it was shown,
113 # otherwise browser occupies only part of the window area.
114 self.window.resize(*self.window.get_default_size())
115
116 def embed_browser(self):
117 window_info = cef.WindowInfo()
118 # TODO: on Mac pass rect[x, y, width, height] to SetAsChild
119 window_info.SetAsChild(self.get_handle())
120 self.browser = cef.CreateBrowserSync(window_info,
121 url="https://www.google.com/")
```
The debug log shows the same output, the window appears, but the browser is not showing.
Kind regards,
Florian
# Must set size of the window again after it was shown,
# otherwise browser occupies only part of the window area.
self.window.resize(*self.window.get_default_size())