Commit 774d6f1
Fix Linux unit test: close JS popup without GLib event dispatch
On CEF 146 Ozone X11, calling CloseBrowser() on a JS-created popup
browser causes DoClose() to return False, which sends a delete_event
to the popup's top-level parent window — the main browser's GTK
window. That fires _on_delete, which closes the main browser instead
of the popup, leaving the popup lingering in g_pyBrowsers and failing
the assertIsNone(GetBrowserByIdentifier(POPUP_BROWSER_ID)) assertion.
Fix by routing JS-created popups through off-screen rendering on Linux.
For off-screen browsers CEF destroys the browser immediately when
DoClose returns False — no X11/GLib delete_event dispatch is needed.
- window_utils_linux.pyx: add windowless_rendering_enabled=True to the
_linux_apply_initialize_defaults() defaults so per-browser off-screen
opt-in is available (takes effect after rebuild).
- _common.py: patch cef.Initialize on Linux to inject the same setting
so tests pass without a rebuild; add LoadHandler.OnBeforePopup to
configure JS popups as off-screen; simplify close_popup to use
CloseBrowser(False) uniformly.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 5029683 commit 774d6f1
2 files changed
Lines changed: 39 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
116 | 122 | | |
117 | 123 | | |
118 | 124 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
32 | 47 | | |
33 | 48 | | |
34 | 49 | | |
| |||
170 | 185 | | |
171 | 186 | | |
172 | 187 | | |
173 | | - | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
174 | 192 | | |
175 | 193 | | |
176 | 194 | | |
| |||
243 | 261 | | |
244 | 262 | | |
245 | 263 | | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
246 | 278 | | |
247 | 279 | | |
248 | 280 | | |
| |||
0 commit comments