Nuitka
Nuitka copied to clipboard
Webpage displayed incorrectly when running pywebview[cef]
Nuitka version
1.4rc5
Commercial: None
Python: 3.8.8 (tags/v3.8.8:024d805, Feb 19 2021, 13:18:16) [MSC v.1928 64 bit (AMD64)]
Flavor: CPython Official
Executable: C:\Soultion-Applications\test\.venv\Scripts\python.exe
OS: Windows
Arch: x86_64
WindowsRelease: 10
Version C compiler: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\bin\HostX64\x64\cl.exe (cl 14.2).
Packages
cefpython3==66.1
cffi==1.15.1
click==8.1.3
clr-loader==0.2.4
colorama==0.4.6
Flask==2.2.2
importlib-metadata==5.2.0
itsdangerous==2.1.2
Jinja2==3.1.2
MarkupSafe==2.1.1
Nuitka==1.4rc5
orderedset==2.0.3
proxy-tools==0.1.0
pycparser==2.21
pythonnet==3.0.1
pywebview==3.7.2
Werkzeug==2.2.2
zipp==3.11.0
pip install pywebview[cef]
pip install flask
Webview Code
import webview
webview.create_window(
"test webview", "http://127.0.0.1:5000/", text_select=True, min_size=(1200, 800)
)
webview.start(gui="cef")
Flask App Code
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello():
return 'Hello, World!'*1000
if __name__ == '__main__':
app.run()
Error
Works fine when using python webview_test.py. Opens a small empty webview window with the webpage displayed as expected. The following is how it is displayed when using the exe generated.
Looks like a window inside a window or something. Clicks and other interactions work on the location it should but the display is in wrong size.
The window is like this only when scrolled to extreme top, bottom or right side. If there is nothing to scroll, it remains weird. But when there is some scrollable area, as long as it is not scrolled to top, bottom or right end, it looks normal.
Does this involve some Qt bindings at all, or what is providing the Window?
Platform: Windows Renderer: CEF I don't think this has Qt involved in it.
This feels similar to a popular issue for Qt, namely that some plugins fail to work, due to dependencies not being included, which caused cosmetic errors. I will have to revisit the original case of yours, and see if my fix actually includes everything they say one should include.
Talking of cefpython3
here.