Win10 system screen zoom layout setting 150%, the operation

Having problems with building or using the JCEF Java binding? Ask your questions here.

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

Postby Czarek » Mon Jul 08, 2019 10:44 am

What is the value of --device-scale-factor switch passed to browser and renderer processes in OnBeforeCommandLineProcessing callback?
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

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

Postby dtanzer » Tue Jul 09, 2019 12:39 am

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 24349 times


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


Scale factor 4:
scale_factor_4.png
scale_factor_4.png (27 KiB) Viewed 24349 times
dtanzer
Newbie
 
Posts: 9
Joined: Thu Jun 06, 2019 2:33 pm

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

Postby magreenblatt » Tue Jul 09, 2019 8:42 am

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.
magreenblatt
Site Admin
 
Posts: 12406
Joined: Fri May 29, 2009 6:57 pm

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

Postby dtanzer » Tue Jul 09, 2019 11:06 am

NOW we're on to something:
scaled_correctly.png
scaled_correctly.png (17.9 KiB) Viewed 24340 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...
dtanzer
Newbie
 
Posts: 9
Joined: Thu Jun 06, 2019 2:33 pm

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

Postby dtanzer » Sun Jul 14, 2019 12:26 am

dtanzer
Newbie
 
Posts: 9
Joined: Thu Jun 06, 2019 2:33 pm

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

Postby guich » Tue Jul 30, 2019 3:11 pm

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
Attachments
browserscale.png
browser (not) scaled
browserscale.png (11.87 KiB) Viewed 24181 times
guich
Techie
 
Posts: 19
Joined: Tue Jul 30, 2019 10:11 am

Previous

Return to JCEF Forum

Who is online

Users browsing this forum: No registered users and 11 guests