Closed bekatd closed 3 years ago
This issue was fixed here https://github.com/r0x0r/pywebview/issues/331 Has it resurfaced?
Unfortunately yes. In order to reproduce issue you can change scaling in windows while application is already running
And also. I don't understand how manifest files work. I created files but they have no effect at all.
I tested and its completely cefpython
related issue, since mshtml
is rednering everything correctly when changing scale
I don’t understand manifest files either.
One thing that I can think of is the path to subprocess.exe set by pywebview is not correct. As result it fails to apply correct DPI settings.
I looked at your changes and seems it expects subprocess file to be in the cefpython package right?
Either cefpython package or bundled along with pyinstaller
On 12. Oct 2020, at 22.58, bekatd notifications@github.com wrote:
I looked at you changes and seems it expects subprocess file to be in the cefpython package right? https://user-images.githubusercontent.com/6948919/95785437-cb6f1c00-0ce6-11eb-86a9-43c3058f3be7.png — You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/r0x0r/pywebview/issues/613#issuecomment-707317084, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAL2KWPXHDXJKP2U4WI2FXDSKNNWRANCNFSM4SNCWCRA.
I use cx-freeze, since with pyinstaller I get trojan virus alerts on windows machines. Issue exists for both installers, as its completely cefpython related issue not freezers
I have no experience with cxfreeze. Feel free to contribute a patch.
Results of my little investigations that might be helpful.
I tried to set different scale options
and eventually I got it working if BOTH app.exe
(executable of application) and subprocess.exe
have the same scale settings, BUT with small bug - window content remains unchanged, until forcefully cause repaint (for example, slightly changing size of window) and whoala everything in its place again.
The problem now is that main executable can't set own scale settings after running :(
any thoughts?
PS: Pywebview expects subprocess.exe
to be inside cefpython package, and this might be something that needs to be changed too.
@r0x0r
I found solution, it so simple.
Just set DPI scale mode programmatically before invoking window with ctypes
:
ctypes.windll.user32.SetProcessDpiAwarenessContext(-4)
list of options:
@r0x0r Would be great if you inject this ctypes.windll.user32.SetProcessDpiAwarenessContext(-4)
before window initialization and also ensure that subprocess.exe
file is discovered in case it's not inside cefpython
package folder.
For some reason cx_Freeze
needs to place subprocess.exe
(and all other cefpython
files, except cefpython_XX.pyd
and __init__.py
files) alongside main executable (outside of cefpython
directory) and I manually fixed the correct reference to it
Does this setting replace the registry hack in place?
Does this setting replace the registry hack in place?
Unfortunately no. Only combination of those two (main.exe and subprocess.exe) dpi settings does the job
To support cx_freeze there should be a way to detect that program is run under cx_freeze (like with pyinstaller’s sys._MEIPASS) and set the subprocess.exe path accordingly.
To support cx_freeze there should be a way to detect that program is run under cx_freeze (like with pyinstaller’s sys._MEIPASS) and set the subprocess.exe path accordingly.
I think its sys.frozen for cxfreeze
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
The message to post on the issue when closing it. If none provided, will not comment when closing an issue.
Specification
Description
I am facing window inside window issue on some machines. After some research I found that it should be High DPI related issue, and tried to create manifest files for main executable app.exe and subprocess.exe files with dpiaware settings true, but it caused blank screen upon launch.
Practicalities
NO I am willing to work on this issue myself.
NO I am prepared to support this issue financially.