Page 2 of 2

Re: Win10 system screen zoom layout setting 150%, the operat

PostPosted: Mon Jul 08, 2019 10:44 am
by Czarek
What is the value of --device-scale-factor switch passed to browser and renderer processes in OnBeforeCommandLineProcessing callback?

Re: Win10 system screen zoom layout setting 150%, the operat

PostPosted: Tue Jul 09, 2019 12:39 am
by dtanzer
There is no value for "device-scale-factor", but "force-device-scale-factor" has the value I provided when I use the following code:

String[] args = {"--disable-gpu", "--disable-gpu-compositing", "--force-device-scale-factor=1"};
cefApp = CefApp.getInstance(args, settings);
cefApp.addAppHandler(new ApplicationHandler(args));

Now it also has an effect, but not the desired one...
No scale factor argument:
no_scale_factor.png
no_scale_factor.png (21.79 KiB) Viewed 24288 times


Scale factor 1:
scale_factor_1.png
scale_factor_1.png (16.88 KiB) Viewed 24288 times


Scale factor 4:
scale_factor_4.png
scale_factor_4.png (27 KiB) Viewed 24288 times

Re: Win10 system screen zoom layout setting 150%, the operat

PostPosted: Tue Jul 09, 2019 8:42 am
by magreenblatt
What Java version are you using? Part of the problem is that DPI support wasn't added until Java 9, and JCEF has not been updated to take advantage of the new Java APIs. You can try searching the internet for "java DPI scaling hack" and see if any of those work for you.

Re: Win10 system screen zoom layout setting 150%, the operat

PostPosted: Tue Jul 09, 2019 11:06 am
by dtanzer
NOW we're on to something:
scaled_correctly.png
scaled_correctly.png (17.9 KiB) Viewed 24279 times


Yes, I am using Java 12. And I think I have found a solution that's backwards compatible. You'll get a pull request once my bitbucket account is working again...

Re: Win10 system screen zoom layout setting 150%, the operat

PostPosted: Sun Jul 14, 2019 12:26 am
by dtanzer

Re: Win10 system screen zoom layout setting 150%, the operat

PostPosted: Tue Jul 30, 2019 3:11 pm
by guich
Hi,

I'm using jdk 8. Is there a way to make the window/browser scale-to-fit?

I tried all parameters described in this post but there's no change at all in the scale of the browser.

thanks

guich