Skip to content

Commit 4301258

Browse files
committed
Complete Migration Guide document (cztomczak#293)
1 parent de9b0b2 commit 4301258

File tree

3 files changed

+211
-8
lines changed

3 files changed

+211
-8
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ See the [Examples-README.md](examples/Examples-README.md) file.
5858
- Additional documentation is in issues labelled [Knowledge Base](../../issues?q=is%3Aissue+is%3Aopen+label%3A%22Knowledge+Base%22)
5959
- To search documentation use GitHub "This repository" search
6060
at the top. To narrow results to documentation only select
61-
"Markdown" in the left pane.
61+
"Markdown" in the right pane.
6262
- Wiki pages are deprecated and for v31 only
6363

6464

docs/Examples.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Examples
22

33
Examples are available in the examples/ root directory. See
4-
[Examples-README.md](../examples/Examples-README.md).
4+
the [Examples-README.md](../examples/Examples-README.md) file.

docs/Migration-guide.md

Lines changed: 209 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,44 @@
1-
# Migration guide from v31 to latest v55+ (STILL UNDER WORKS.. #293)
1+
# Migration guide
2+
3+
This migration guide will get you through to make your code work
4+
with latest CEF Python. This document includes notable changes
5+
that were introduced to cefpython and each topic is prefixed
6+
with version number in which a change was introduced.
7+
This migration guide doesn't cover all changes required for your
8+
software to run smoothly. Some changes depend on the GUI framework
9+
you are using and this guide doesn't cover these. You will have
10+
to go to the examples/ root directory and see the example for your
11+
GUI framework. The new examples are very straightforward and include
12+
many useful comments explaining whys. You will have to get through
13+
its code and see if anything changed that also requires changes
14+
in your application.
215

316

417
Table of contents:
5-
* [Distribution packages](#distribution-packages)
6-
* [Handlers' callbacks and other interfaces](#handlers-callbacks-and-other-interfaces)
18+
* [v50+ Distribution packages](#v50-distribution-packages)
19+
* [v50+ Importing the cefpython3 package on Linux](#v50-importing-the-cefpython3-package-on-linux)
20+
* [v50+ Install X11 error handlers on Linux](#v50-install-x11-error-handlers-on-linux)
21+
* [v50+ Set window bounds on Linux](#v50-set-window-bounds-on-linux)
22+
* [v50+ Notify CEF on move or resize events](#v50-notify-cef-on-move-or-resize-events)
23+
* [v50+ Keyboard focus issues on Linux](#v50-keyboard-focus-issues-on-linux)
24+
* [v50+ Windows XP and Vista are no more supported](#v50-windows-xp-and-vista-are-no-more-supported)
25+
* [v50+ Mac 32-bit is no more supported](#v50-mac-32-bit-is-no-more-supported)
26+
* [v50+ cefbuilds.com is deprected, use Spotify Automated CEF Builds](#v50-cefbuildscom-is-deprected-use-spotify-automated-cef-builds)
27+
* [v50+ Build instructions and build tools](#v50-build-instructions-and-build-tools)
28+
* [v51+ Off-screen-rendering: new option "windowless_rendering_enabled"](#v51-off-screen-rendering-new-option-windowless_rendering_enabled)
29+
* [v51+ Remove LifespanHandler.RunModal](#v51-remove-lifespanhandlerrunmodal)
30+
* [v51+: BrowserSettings options removed](#v51-browsersettings-options-removed)
31+
* [v51+ cef.Request.Flags changed](#v51-cefrequestflags-changed)
32+
* [v51+ Request.GetHeaderMap and SetHeaderMap change](#v51-requestgetheadermap-and-setheadermap-change)
33+
* [v54+ GTK 3 example doesn't work anymore on Linux](#v54-gtk-3-example-doesnt-work-anymore-on-linux)
34+
* [v54+ libcef.so library is stripped from symbols on Linux](#v54-libcefso-library-is-stripped-from-symbols-on-linux)
35+
* [v55+ HTTPS cache problems on pages with certificate errors](#v55-https-cache-problems-on-pages-with-certificate-errors)
36+
* [v55.3+ Handlers' callbacks and other interfaces](#v553-handlers-callbacks-and-other-interfaces)
37+
* [v56+ MacOS 10.9+ required to run](#v56-macos-109-required-to-run)
38+
739

840

9-
## Distribution packages
41+
## v50+ Distribution packages
1042

1143
In latest CEF Python there are only two distribution packages
1244
available. The first one is a wheel package distributed through
@@ -15,10 +47,14 @@ on Linux). The second one is a setup package available for
1547
download on the GitHub Releases pages, instructions on how to
1648
install it are provided in README.txt.
1749

50+
**Windows**
51+
1852
On Windows many of the distribution packages such as MSI, EXE,
1953
ZIP and InnoSetup files, are no more available. It is too much
2054
hassle to support these.
2155

56+
**Linux debian package**
57+
2258
On Linux the debian package is not supported anymore. Since
2359
pip 8.1+ added support for manylinux1 wheel packages, you can
2460
now easily install cefpython on Linux using the pip tool.
@@ -31,7 +67,173 @@ in an automated manner, it might be reconsidered in the future
3167
to provide debian packages again.
3268

3369

34-
## Handlers' callbacks and other interfaces
70+
## v50+ Importing the cefpython3 package on Linux
71+
72+
In the past on Linux it was required for the cefpython3 package
73+
to be imported before any other packages due to tcmalloc global
74+
hook being loaded. This is not required anymore, tcmalloc is
75+
disabled by default.
76+
77+
78+
## v50+ Install X11 error handlers on Linux
79+
80+
It is required to install X11 error handlers on Linux, otherwise
81+
you will see 'BadWindow' errors happening - sometimes randomly -
82+
which will cause application to terminate. Since v56+ x11 error
83+
handlers are installed automatically by default during the call
84+
to cef.Initialize(). However sometimes that is not enough like
85+
for example in the wxpython.py example which requires the x11
86+
error handlers to be installed manually after wx was initialized,
87+
and that is because wx initialization had reset x11 error handlers
88+
that were installed earlier during cef initialization (Issue [#334](../../../issues/334)).
89+
90+
You can install X11 error handlers by calling:
91+
```
92+
WindowUtils = cef.WindowUtils()
93+
WindowUtils.InstallX11ErrorHandlers()
94+
```
95+
96+
API ref: WindowUtils.[InstallX11ErrorHandlers()](../api/WindowUtils.md#installx11errorhandlers-linux)
97+
98+
99+
## v50+ Set window bounds on Linux
100+
101+
It is now required to set window bounds during window "resize",
102+
"move" and "configure" events on Linux. You can do so by calling:
103+
104+
```
105+
browser.SetBounds(x, y, width, height)
106+
```
107+
108+
API ref: Browser.[SetBounds()](../api/Browser.md#setbounds)
109+
110+
111+
## v50+ Notify CEF on move or resize events
112+
113+
It is required to notify the browser on move or resize events
114+
so that popup widgets (e.g. \<select\>) are displayed in the correct
115+
location and dismissed when the window moves. Also so that
116+
drag & drop areas are updated accordingly.
117+
118+
```
119+
browser.NotifyMoveOrResizeStarted()
120+
```
121+
122+
API ref: Browser.[NotifyMoveOrResizeStarted()](../api/Browser.md#notifymoveorresizestarted)
123+
124+
125+
## v50+ Keyboard focus issues on Linux
126+
127+
There several keyboard focus issues on Linux since CEF library
128+
replaced GTK library with X11 library. Most of these issues are
129+
fixed in examples by calling SetFocus in LoadHandler.OnLoadStart
130+
during initial app loading and/or by calling SetFocus in
131+
FocusHandler.OnGotFocus. This keyboard focus issues need to be
132+
fixed in usptream CEF. For more details see Issue [#284](../../../issues/284).
133+
134+
135+
## v50+ Windows XP and Vista are no more supported
136+
137+
CEF Python v31.2 was the last version to support Windows XP.
138+
This is due to Chromium/CEF dropping XP support, last version
139+
that supported XP was CEF v49.
140+
141+
142+
## v50+ Mac 32-bit is no more supported
143+
144+
CEF Python v31.2 was the last version to support Mac 32-bit.
145+
This is due to CEF/Chromium dropping 32-bit support, last version
146+
that supported 32-bit was CEF v38.
147+
148+
149+
## v50+ cefbuilds.com is deprected, use Spotify Automated CEF Builds
150+
151+
The cefbuilds.com site with CEF prebuilt binaries is now deprecated.
152+
From now on download prebuilt CEF binaries from the Spotify Automated
153+
CEF Builds:
154+
155+
http://opensource.spotify.com/cefbuilds/index.html
156+
157+
158+
## v50+ Build instructions and build tools
159+
160+
Many changes in regards to building CEF and CEF Python has changed.
161+
There are now new tools in the tools/ root directory that fully
162+
automate building CEF and CEF Python. CEF Python now provides
163+
upstream CEF prebuilt binaries and libraries on GitHub Releases
164+
tagged eg. "v56-upstream". With these binaries you can build
165+
CEF Python from sources in less than 10 minutes. See the new
166+
[Build instructions](Build-instructions.md) document.
167+
168+
169+
## v51+ Off-screen-rendering: new option "windowless_rendering_enabled"
170+
171+
When using off-screen-rendering you must set the ApplicationSettings
172+
"windowless_rendering_enabled" option to True. This applies to
173+
examples such as: Kivy, Panda3D and screenshot example.
174+
175+
API ref: ApplicationSettings.[windowless_rendering_enabled](../api/ApplicationSettings.md#windowless_rendering_enabled)
176+
177+
178+
## v51+ Remove LifespanHandler.RunModal
179+
180+
LifespanHandler.RunModal callback is no more available.
181+
182+
183+
## v51+: BrowserSettings options removed
184+
185+
The following options were removed from BrowserSettings:
186+
- user_style_sheet_location
187+
- java_disabled
188+
- accelerated_compositing
189+
- author_and_user_styles_disabled
190+
191+
192+
## v51+ cef.Request.Flags changed
193+
194+
The following flags were removed from cef.Request.Flags:
195+
- AllowCookies
196+
- ReportLoadTiming
197+
- ReportRawHeaders
198+
199+
API ref: Request.[GetFlags](../api/Request.md#getflags)
200+
201+
202+
## v51+ Request.GetHeaderMap and SetHeaderMap change
203+
204+
GetHeaderMap() will not include the Referer value if any
205+
and SetHeaderMap() will ignore the Referer value.
206+
207+
API ref: Request.[GetHeaderMap](../api/Request.md#getheadermap)
208+
209+
210+
## v54+ GTK 3 example doesn't work anymore on Linux
211+
212+
Currently GTK 3 example is broken on Linux. You can either
213+
downgrade to an old cefpython v53 (available on GitHub release
214+
page) or use GTK 2 example. For more details on the problem see
215+
Issue [#261](../../../issues/261).
216+
217+
218+
## v54+ libcef.so library is stripped from symbols on Linux
219+
220+
Symbols useful for debugging are no more available in libcef.so
221+
shipped with distribution packages on Linux. This is explained
222+
in details in Issue [#262](../../../issues/262).
223+
224+
225+
## v55+ HTTPS cache problems on pages with certificate errors
226+
227+
The fix for HTTPS cache problems on pages with certificate errors
228+
is no more applied on Windows.
229+
230+
Soon this will fix also won't be applied on Linux anymore when
231+
cefpython starts using CEF prebuilt binaries from Spotify.
232+
233+
See Issue [#125](../../../issues/125) for more details.
234+
235+
236+
## v55.3+ Handlers' callbacks and other interfaces
35237

36238
Since v55.3 all handlers' callbacks and other interfaces such as
37239
CookieVisitor, StringVisitor and WebRequestClient, are now called
@@ -77,5 +279,6 @@ your code will definitely break, unless you've also used
77279
"http_code" for argument name.
78280

79281

282+
## v56+ MacOS 10.9+ required to run
80283

81-
284+
CEF v55 was the last version to support MacOS 10.7.

0 commit comments

Comments
 (0)