Bug 506224 - [XULRunner][HiDPI] Wrong XULRunner browser size on HiDPI 4K monitor
Summary: [XULRunner][HiDPI] Wrong XULRunner browser size on HiDPI 4K monitor
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.6   Edit
Hardware: PC Windows All
: P3 major (vote)
Target Milestone: 4.6.2   Edit
Assignee: Niraj Modi CLA
QA Contact:
URL:
Whiteboard:
Keywords: ui
Depends on:
Blocks: 495269
  Show dependency tree
 
Reported: 2016-10-19 11:45 EDT by Daniel Stainhauser CLA
Modified: 2017-05-22 05:49 EDT (History)
2 users (show)

See Also:
arunkumar.thondapu: review+


Attachments
half width Browser (193.54 KB, image/png)
2016-10-19 11:45 EDT, Daniel Stainhauser CLA
no flags Details
Test Snippet (2.06 KB, application/octet-stream)
2016-11-10 04:58 EST, Niraj Modi CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Stainhauser CLA 2016-10-19 11:45:12 EDT
Created attachment 264938 [details]
half width Browser

Our RCP App is using a browser widget. Running this on a Windows system with high dpi (4k monitor) will produce just half width and height. It seems that the browser widget does not take into account the double density. The same code works fine on Mac with high density and was running correctly with Mars before.

Tested with XULRunner 31.0.1

I've tried to set the minimumWidth and minimumHeight on the GridData. This fixes somehow the problem, but gives more problems with resizing and coordinate detection.

Any help is appreciated.

Browser browser = new Browser(composite, SWT.NONE)
GridData gd_browser = new GridData(SWT.LEFT, SWT.TOP, true, true, 1, 1);
gd_browser.horizontalAlignment = GridData.FILL;
gd_browser.verticalAlignment = GridData.FILL;
		
// Fix a windows 4k problem
//gd_browser.minimumWidth = composite.getBounds().width * 2;
//gd_browser.minimumHeight = composite.getBounds().height * 2;
		
browser.setLayoutData(gd_browser);
Comment 1 Niraj Modi CLA 2016-11-10 04:23:32 EST
It seems to be specific to XULRunner not seen with other browser like IE.
This problem is reproducible on Win7 as well.
Comment 2 Niraj Modi CLA 2016-11-10 04:58:46 EST
Created attachment 265293 [details]
Test Snippet

Modified Snippet148, to reproduce this problem.
Comment 3 Eclipse Genie CLA 2016-11-11 07:06:32 EST
New Gerrit change created: https://git.eclipse.org/r/84873
Comment 5 Niraj Modi CLA 2016-11-11 08:12:26 EST
(In reply to Eclipse Genie from comment #3)
> New Gerrit change created: https://git.eclipse.org/r/84873

Problem was in Mozilla#onResize() method where in the Point information was not converted to Pixels before passing to the native layer.
Fixed the problem with above patch, resolving now.
Comment 6 Niraj Modi CLA 2016-11-14 01:12:16 EST
Verified the fix in IBuild: I20161113-2000
Comment 7 Niraj Modi CLA 2016-11-14 01:12:46 EST
To be back-ported to 4.6.2
Comment 8 Niraj Modi CLA 2016-11-14 01:33:53 EST
(In reply to Niraj Modi from comment #7)
> To be back-ported to 4.6.2

Fix back-ported to 4.6.2 to via below Gerrit/Git commits(which missed bugzilla auto-logging):
https://git.eclipse.org/r/#/c/84961/
http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?h=R4_6_maintenance&id=fb77215d07a8535413f6739b244a3692300b0921

Resolving now.
Comment 9 Eclipse Genie CLA 2016-11-14 09:56:37 EST
New Gerrit change created: https://git.eclipse.org/r/84961
Comment 11 Niraj Modi CLA 2016-11-17 03:35:03 EST
Verified the fix in 4.6.2 MBuild: M20161116-1100 on Win7.