You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sync cefpython147-qt with cefpython147 (2026-05-09)
Squash-merge of 10 commits from cefpython147 to refresh PR cztomczak#691 with
the latest fixes and enhancements developed since the last sync.
Features:
* Add native Wayland support — explicit opt-in via WindowInfo;
X11/XWayland remains the default (9c2ae77)
* Implement RenderHandler.GetScreenInfo with HiDPI support so
high-DPI displays report accurate device scale factors (9969797)
* examples/pysdl2: support multiple popup windows with clean
shutdown (bb24151)
Fixes:
* Sync render_handler with current CEF API (c6f2a56)
* Guard X11 error-handler install at compile time in
cefpython.pyx (7a65e6b)
* examples/pysdl2: window resize, HiDPI rendering, mouse drag,
Wayland DPI handling (2aff2c9)
* examples/pysdl2: scale mouse wheel by deviceScaleFactor for
HiDPI (3e45abd)
Refactor / docs:
* Audit cef.Initialize defaults on Linux; drop dead switches and
stale workarounds (db13d7d)
* Correct version-tagged comments to match actual upstream
history (bd924c4)
* Drop defensive parenthetical from sandbox History comment in
window_utils_linux.pyx (7ae0553)
Copy file name to clipboardExpand all lines: api/RenderHandler.md
+41-12Lines changed: 41 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,8 +15,8 @@ Table of contents:
15
15
*[Callbacks](#callbacks)
16
16
*[GetRootScreenRect](#getrootscreenrect)
17
17
*[GetViewRect](#getviewrect)
18
-
*[GetScreenRect](#getscreenrect)
19
18
*[GetScreenPoint](#getscreenpoint)
19
+
*[GetScreenInfo](#getscreeninfo)
20
20
*[OnPopupShow](#onpopupshow)
21
21
*[OnPopupSize](#onpopupsize)
22
22
*[OnPaint](#onpaint)
@@ -43,7 +43,6 @@ Off-screen rendering examples:
43
43
44
44
Callbacks available in upstream CEF, but not yet exposed in CEF Python
45
45
(see src/include/cef_render_handler.h):
46
-
* GetScreenInfo
47
46
* OnImeCompositionRangeChanged
48
47
49
48
@@ -74,30 +73,58 @@ Called to retrieve the view rectangle which is relative to screen
74
73
coordinates. Return true if the rectangle was provided.
75
74
76
75
77
-
### GetScreenRect
76
+
### GetScreenPoint
78
77
79
78
| Parameter | Type |
80
79
| --- | --- |
81
80
| browser |[Browser](Browser.md)|
82
-
| rect_out | list[x,y,width,height]|
81
+
| view_x | int |
82
+
| view_y | int |
83
+
| screen_coordinates_out | list[x,y]|
83
84
|__Return__| bool |
84
85
85
-
Called to retrieve the simulated screen rectangle. Return true
86
-
if the rectangle was provided.
86
+
Called to retrieve the translation from view coordinates to actual
87
+
screen coordinates. Return true if the screen coordinates were provided.
87
88
88
89
89
-
### GetScreenPoint
90
+
### GetScreenInfo
90
91
91
92
| Parameter | Type |
92
93
| --- | --- |
93
94
| browser |[Browser](Browser.md)|
94
-
| view_x | int |
95
-
| view_y | int |
96
-
| screen_coordinates_out | list[x,y]|
95
+
| screen_info_out | dict |
97
96
|__Return__| bool |
98
97
99
-
Called to retrieve the translation from view coordinates to actual
100
-
screen coordinates. Return true if the screen coordinates were provided.
98
+
Called to allow the client to fill in the screen info with appropriate
99
+
values. Return true if `screen_info_out` was modified, false to let CEF
100
+
use defaults.
101
+
102
+
Fill `screen_info_out` with any of the following keys (all optional):
103
+
104
+
| Key | Type | Default | Notes |
105
+
| --- | --- | --- | --- |
106
+
|`device_scale_factor`| float |`1.0`| Ratio between physical and logical pixels. **Must be > 0.**|
107
+
|`depth`| int |`24`| Screen depth in bits per pixel. |
108
+
|`depth_per_component`| int |`8`| Bits per color component. |
109
+
|`is_monochrome`| bool |`False`| True for black-and-white printers. |
110
+
|`rect`| list[x,y,width,height]| unset | Display monitor rectangle in DIP. |
111
+
|`available_rect`| list[x,y,width,height]| unset | Work-area rectangle in DIP (excludes taskbars). If only `rect` is supplied it is mirrored into `available_rect`. |
112
+
113
+
If neither `rect` nor `available_rect` is supplied, CEF falls back to
114
+
the rectangle returned by `GetViewRect` (popups may be misplaced if
115
+
the rectangle ends up empty).
116
+
117
+
**HiDPI handling:** set `device_scale_factor` to match the host
118
+
display (e.g. `2.0` on a Retina/4K screen, `1.5` for 150% fractional
119
+
scaling). The factor is applied to the OnPaint buffer: with a view
120
+
rect of 800x600 and `device_scale_factor=2.0`, OnPaint receives a
121
+
1600x1200 BGRA buffer while `width`/`height` arguments equal the
122
+
buffer's pixel dimensions. Always upload the buffer at its actual
123
+
pixel size and lay it out at the view's logical size to avoid
Copy file name to clipboardExpand all lines: docs/Knowledge-Base.md
+85Lines changed: 85 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,10 +13,12 @@ Table of contents:
13
13
*[How to capture Audio and Video in HTML5?](#how-to-capture-audio-and-video-in-html5)
14
14
*[Touch and multi-touch support](#touch-and-multi-touch-support)
15
15
*[Black or white browser screen](#black-or-white-browser-screen)
16
+
*["kTransientFailure: Failed to send GpuControl.CreateCommandBuffer" on Linux](#ktransientfailure-failed-to-send-gpucontrolcreatecommandbuffer-on-linux)
16
17
*[Python crashes with "Segmentation fault" - how to debug?](#python-crashes-with-segmentation-fault---how-to-debug)
17
18
*[Windows XP support](#windows-xp-support)
18
19
*[Mac 32-bit support](#mac-32-bit-support)
19
20
*[Security](#security)
21
+
*[Linux: enabling the Chromium sandbox (advanced)](#linux-enabling-the-chromium-sandbox-advanced)
20
22
21
23
22
24
## Notifications about new releases / commits
@@ -264,6 +266,33 @@ appear even after disabling GPU hardware acceleration. This is normal
264
266
because GPU was disabled so WebGL cannot work.
265
267
266
268
269
+
## "kTransientFailure: Failed to send GpuControl.CreateCommandBuffer" on Linux
270
+
271
+
You may see a log line like this during startup, especially on Linux
272
+
VMs and other systems without a working GPU. On VMs the line appears in
273
+
nearly every run; on bare metal with a real GPU it is rarer:
274
+
275
+
```
276
+
ERROR:gpu/ipc/client/command_buffer_proxy_impl.cc:285] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer.
277
+
```
278
+
279
+
**This is a Chromium-recoverable transient and can be ignored.** It is
280
+
emitted by the renderer process when it tries to create a GPU command
281
+
buffer before the GPU process has finished binding its IPC endpoint —
282
+
typically a millisecond-scale race during startup, more likely on slow
283
+
disks or when Chromium falls back from real-GL to SwiftShader. The
284
+
compositor retries automatically; pages still render and
285
+
`OnContextInitialized` still fires. The `kTransientFailure` label is
286
+
Chromium's own classification — Chromium expects callers to retry, and
287
+
they do.
288
+
289
+
If a clean log is more important than hardware acceleration in your
290
+
deployment, you can opt in to disabling the GPU process by passing
291
+
`switches={"disable-gpu": ""}` to `cef.Initialize()`. Do not enable
292
+
`in-process-gpu` to silence this line — it is not stable across
293
+
multiple browser windows.
294
+
295
+
267
296
## Python crashes with "Segmentation fault" - how to debug?
268
297
269
298
Install gdb:
@@ -347,3 +376,59 @@ A quote by Marshall Greenblatt:
347
376
Reference: [Question on browser security](http://magpcss.org/ceforum/viewtopic.php?f=10&t=10222)
348
377
on the CEF Forum.
349
378
379
+
380
+
### Linux: enabling the Chromium sandbox (advanced)
381
+
382
+
cefpython on Linux passes `--no-sandbox` by default
383
+
(`_linux_apply_initialize_defaults` in `src/window_utils_linux.pyx`).
384
+
385
+
Reasons for the default:
386
+
1. cefpython does not bundle the SUID-root `chrome-sandbox` helper that
387
+
Chromium's namespace sandbox needs to bypass AppArmor's
388
+
`apparmor_restrict_unprivileged_userns=1` (the default on Ubuntu
389
+
23.10+, Debian 12+, and other modern distros).
390
+
2. Without the helper, Chromium aborts at startup with
391
+
`FATAL: No usable sandbox!` — every cefpython app would fail to
392
+
launch out of the box.
393
+
3. The most common cefpython use case is rendering the application's
394
+
own trusted HTML/JS as a UI surface, where the sandbox provides
395
+
defense-in-depth rather than primary security.
396
+
397
+
If your app loads untrusted web content and you want the Chromium
398
+
sandbox enabled, three steps are required:
399
+
400
+
**1. Install the SUID-root `chrome-sandbox` helper.**
401
+
The binary ships in the CEF binary distribution under
402
+
`Release/chrome-sandbox`. Copy it to a stable path and set it up:
0 commit comments