cztomczak / cefpython

Python bindings for the Chromium Embedded Framework (CEF)
Other
3.03k stars 469 forks source link

Background disappearing when mouse hoover #639

Open RicardoALFCG opened 2 years ago

RicardoALFCG commented 2 years ago

Hello, I have a weird bug on my python3.7 application and I don't have a clue on how to solve it. I suspect that it is some incompability with some of my packages with CEFPython. Hope you can help me!

Application description: Executable bundled with Pyinstaller which consists in a Flask server and a CEFPython browser that renders a react build.

Bug description: Everything works fine until black squares starts to appearing and disappearing with mouse hoovering, replacing the background of the CEFPython window. Image attached

image

Notes: I believe this might be some incompatibility between python packages as I've made some updates of the packages before this bug starts to happen. However, I don't know where to start and cannot reproduce this bug consistently on my laptop which is very annoying. 100% times this happen was on production environment (.exe) and never happened on development.

Specs of the laptop where the bug is more evident: Intel Core i5 CPU M520@2.40Ghz, 4GB RAM, Windows 10 x64

Used Packages: altgraph==0.16.1 atomicwrites==1.4.0 attrs==21.4.0 cefpython3==66.1 certifi==2018.8.24 cffi==1.15.0 chardet==3.0.4 click==6.7 colorama==0.4.4 Cython==0.29.13 dis3==0.1.2 Flask==0.12.2 Flask-API==1.0 Flask-Cors==3.0.2 Flask-SocketIO==2.9.3 fpdf==1.7.2 future==0.16.0 gevent==1.4.0 greenlet==0.4.15 idna==2.7 importlib-metadata==4.8.2 iniconfig==1.1.1 itsdangerous==0.24 Jinja2==2.10 macholib==1.11 MarkupSafe==1.0 numpy==1.15.2 packaging==21.3 pandas==0.25.1 pefile==2018.8.8 Pillow==8.4.0 pluggy==1.0.0 py==1.11.0 pycparser==2.21 pyelftools==0.27 PyInstaller==3.4 pyinstaller-hooks-contrib==2021.4 pyparsing==3.0.7 PyPDF2==1.26.0 pypiwin32==223 pytest==7.0.0 python-dateutil==2.7.3 python-engineio==2.3.1 python-socketio==2.0.0 pytz==2018.5 pywin32==225 pywin32-ctypes==0.2.0 PyYAML==5.1.2 requests==2.19.1 six==1.11.0 tomli==2.0.1 typing-extensions==4.0.0 urllib3==1.23 Werkzeug==0.13 wxPython==4.1.1 zipp==3.6.0

cztomczak commented 2 years ago

What GUI framework do you use for window creation?

You can try if disabling GPU acceleration helps. You can do that by setting command line switches, see here: https://github.com/cztomczak/cefpython/blob/master/docs/Knowledge-Base.md#black-or-white-browser-screen

You could check if it's any related to High DPI issue: https://github.com/cztomczak/cefpython/issues/530

RicardoALFCG commented 2 years ago

Hello, thank you for the inputs.

I am using wxpython along with cef python. The frontend is React which is rendered inside of the window created by CEFpython and Wxpython.

I did not had problem until I've decided to update from to python 3.7. With this update I had to made the following update: wxPython==4.0.1 to wxPython==4.1.1

And I am not able to downgrade because it is not compatible with python 3.7.

Regarding the 'disable-gpu': in the past I had another type of issues and I had to insert that flag. And the funny part is that it was you who pointed to me that solution that worked for me: https://stackoverflow.com/questions/57498396/how-can-i-set-up-high-dpi-on-cefpython-running-on-python3-without-display-bugs

Anyway I will try to search the solution in the links you have provided to me and I'll post here the solution