Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 79a8ebc

Browse files
committed
Update to Chromium v57 on Win (cztomczak#341) and fix PyQt5 example on Win (cztomczak#325).
Fix PyQt5 support on Windows in qt.py example (cztomczak#325). Update automate.py to use --ninja-jobs also when building CEF projects. Default jobs ninja uses is very CPU intensive and can cause much lag in OS.
1 parent cd9613f commit 79a8ebc

File tree

4 files changed

+38
-20
lines changed

4 files changed

+38
-20
lines changed

examples/qt.py

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# bar and a browser.
44
#
55
# Tested configurations:
6-
# - PyQt 5.8.2 on Linux
6+
# - PyQt 5.8.2 on Windows/Linux/Mac
77
# - PyQt 4.11 (qt 4.8) on Windows/Linux
88
# - PySide 1.2 (qt 4.8) on Windows/Linux/Mac
99
# - CEF Python v55.4+
@@ -124,9 +124,22 @@ def setupLayout(self):
124124
frame = QFrame()
125125
frame.setLayout(layout)
126126
self.setCentralWidget(frame)
127+
128+
if PYQT5 and WINDOWS:
129+
# On Windows with PyQt5 main window must be shown first
130+
# before CEF browser is embedded, otherwise window is
131+
# not resized and application hangs during resize.
132+
self.show()
133+
127134
# Browser can be embedded only after layout was set up
128135
self.cef_widget.embedBrowser()
129-
if LINUX and PYQT5:
136+
137+
if PYQT5 and LINUX:
138+
# On Linux with PyQt5 the QX11EmbedContainer widget is
139+
# no more available. An equivalent in Qt5 is to create
140+
# a hidden window, embed CEF browser in it and then
141+
# create a container for that hidden window and replace
142+
# cef widget in the layout with the container.
130143
self.container = QWidget.createWindowContainer(
131144
self.cef_widget.hidden_window, parent=self)
132145
layout.addWidget(self.container, 1, 0)
@@ -166,7 +179,7 @@ def focusOutEvent(self, event):
166179
self.browser.SetFocus(False)
167180

168181
def embedBrowser(self):
169-
if LINUX and PYQT5:
182+
if PYQT5 and LINUX:
170183
self.hidden_window = QWindow()
171184
window_info = cef.WindowInfo()
172185
rect = [0, 0, self.width(), self.height()]
@@ -177,8 +190,8 @@ def embedBrowser(self):
177190
self.browser.SetClientHandler(FocusHandler(self))
178191

179192
def getHandle(self):
180-
# PyQt5 on Linux
181193
if self.hidden_window:
194+
# PyQt5 on Linux
182195
return int(self.hidden_window.winId())
183196
try:
184197
# PyQt4 and PyQt5

src/compile_time_constants.pxi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# This file was generated by setup.py
2-
DEF UNAME_SYSNAME = "Darwin"
3-
DEF PY_MAJOR_VERSION = 3
2+
DEF UNAME_SYSNAME = "Windows"
3+
DEF PY_MAJOR_VERSION = 2

src/version/cef_version_win.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,16 @@
3535
#ifndef CEF_INCLUDE_CEF_VERSION_H_
3636
#define CEF_INCLUDE_CEF_VERSION_H_
3737

38-
#define CEF_VERSION "3.2924.1575.g97389a9"
38+
#define CEF_VERSION "3.2987.1601.gf035232"
3939
#define CEF_VERSION_MAJOR 3
40-
#define CEF_COMMIT_NUMBER 1575
41-
#define CEF_COMMIT_HASH "97389a92ee2309ded830338d6afd61ba109d31d8"
40+
#define CEF_COMMIT_NUMBER 1601
41+
#define CEF_COMMIT_HASH "f035232c082f837d2b85bd7821a93a54fc742775"
4242
#define COPYRIGHT_YEAR 2017
4343

44-
#define CHROME_VERSION_MAJOR 56
44+
#define CHROME_VERSION_MAJOR 57
4545
#define CHROME_VERSION_MINOR 0
46-
#define CHROME_VERSION_BUILD 2924
47-
#define CHROME_VERSION_PATCH 76
46+
#define CHROME_VERSION_BUILD 2987
47+
#define CHROME_VERSION_PATCH 133
4848

4949
#define DO_MAKE_STRING(p) #p
5050
#define MAKE_STRING(p) DO_MAKE_STRING(p)
@@ -63,13 +63,13 @@ extern "C" {
6363
// universal hash value will change if any platform is affected whereas the
6464
// platform hash values will change only if that particular platform is
6565
// affected.
66-
#define CEF_API_HASH_UNIVERSAL "66de193ba22e1d92a99bb29d60f3107709aeefda"
66+
#define CEF_API_HASH_UNIVERSAL "b0a24e3e202f3d8b72f2fbc1ebc5864f96ec16ae"
6767
#if defined(OS_WIN)
68-
#define CEF_API_HASH_PLATFORM "8055740cd08db66cefe838a826dc90806fadfb33"
68+
#define CEF_API_HASH_PLATFORM "1c6a27f840ac87c8c971350c907edbe2c5fa0387"
6969
#elif defined(OS_MACOSX)
70-
#define CEF_API_HASH_PLATFORM "12d8ab423df369b68d37c3667123a1812bc0d345"
70+
#define CEF_API_HASH_PLATFORM "1567db600ee83cc2a59bb8c17ca416d11a7c9b8a"
7171
#elif defined(OS_LINUX)
72-
#define CEF_API_HASH_PLATFORM "86ab23c0d7dafbdff7f66764cf8dac5ec1712af4"
72+
#define CEF_API_HASH_PLATFORM "1f9f9e15bf7cf13de2557ddd411dfc9f694503b0"
7373
#endif
7474

7575
// Returns CEF version information for the libcef library. The |entry|

tools/automate.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ def setup_options(docopt_args):
201201
Options.ninja_jobs = int(multiprocessing.cpu_count() / 2)
202202
if Options.ninja_jobs < 1:
203203
Options.ninja_jobs = 1
204+
Options.ninja_jobs = str(Options.ninja_jobs)
204205

205206

206207
def build_cef():
@@ -410,9 +411,11 @@ def build_cef_projects():
410411
# > cefclient_mac.mm:22:29: error: property 'mainMenu' not found
411412
if MAC:
412413
# Build only cefsimple
413-
command.extend(["ninja", "cefsimple"])
414+
command.extend(["ninja", "-j", Options.ninja_jobs,
415+
"cefsimple"])
414416
else:
415-
command.extend(["ninja", "cefclient", "cefsimple", "ceftests"])
417+
command.extend(["ninja", "-j", Options.ninja_jobs,
418+
"cefclient", "cefsimple", "ceftests"])
416419
run_command(command, build_cefclient_dir)
417420
print("[automate.py] OK")
418421
assert os.path.exists(cefclient_exe)
@@ -507,7 +510,8 @@ def build_wrapper_library_windows(runtime_library, msvs, vcvars):
507510

508511
# Run ninja
509512
ninja_wrapper = prepare_build_command(build_lib=True, vcvars=vcvars)
510-
ninja_wrapper.extend(["ninja", "libcef_dll_wrapper"])
513+
ninja_wrapper.extend(["ninja", "-j", Options.ninja_jobs,
514+
"libcef_dll_wrapper"])
511515
run_command(ninja_wrapper, working_dir=build_wrapper_dir)
512516
print("[automate.py] ninja OK")
513517
assert os.path.exists(wrapper_lib)
@@ -630,7 +634,8 @@ def build_wrapper_library_mac():
630634
print("[automate.py] cmake OK")
631635
# Ninja
632636
ninja_wrapper = prepare_build_command(build_lib=True)
633-
ninja_wrapper.extend(["ninja", "libcef_dll_wrapper"])
637+
ninja_wrapper.extend(["ninja", "-j", Options.ninja_jobs,
638+
"libcef_dll_wrapper"])
634639
run_command(ninja_wrapper, build_wrapper_dir)
635640
print("[automate.py] ninja OK")
636641
assert os.path.exists(wrapper_lib)

0 commit comments

Comments
 (0)