Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 537273

Summary: [HiDPI][Win32] SWT on startup to pick OS zoom updated without logoff
Product: [Eclipse Project] Platform Reporter: Niraj Modi <niraj.modi>
Component: SWTAssignee: Niraj Modi <niraj.modi>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: eclipse
Version: 4.8   
Target Milestone: 4.9 M2   
Hardware: PC   
OS: Windows 10   
See Also: https://git.eclipse.org/r/126461
https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=0aa92e62e6bfa1b054314f9a94b90c49428a789e
Whiteboard:
Bug Depends on:    
Bug Blocks: 534820, 534932, 537614    
Attachments:
Description Flags
Screenshot of SmartGit using this bug's commit
none
Sample code to reproduce
none
Screenshot of sample code
none
Screenshot of sample code without setting swt.autoScale to false none

Description Niraj Modi CLA 2018-07-23 04:00:41 EDT
On Windows 8.1 and Windows 10:
1. Windows allow to change primary monitor OS zoom without logging off.
2. But SWT Display doesn't pick the updated zoom level.

Expected behavior:
When an SWT application starts it should pick primary monitor zoom.
Comment 1 Niraj Modi CLA 2018-07-23 04:03:29 EDT
Solution to this problem exists in Display class on branch "nmodi/DynamicDPI_4909", will share a gerrit patch shortly.
Comment 2 Eclipse Genie CLA 2018-07-23 04:12:28 EDT
New Gerrit change created: https://git.eclipse.org/r/126461
Comment 4 Niraj Modi CLA 2018-07-23 07:34:07 EDT
Resolving now.
Comment 5 Thomas Singer CLA 2018-07-23 09:59:52 EDT
Niraj, your last commit screwed up HiDPI support on SmartGit - please see attached screenshot.
Comment 6 Thomas Singer CLA 2018-07-23 10:00:37 EDT
Created attachment 275090 [details]
Screenshot of SmartGit using this bug's commit
Comment 7 Niraj Modi CLA 2018-07-24 02:37:17 EDT
(In reply to Thomas Singer from comment #6)
> Created attachment 275090 [details]
> Screenshot of SmartGit using this bug's commit

Is this problem seen in Eclipse too, also which Windows version you faced this problem ?
Please share exact steps/code snippet to reproduce this issue ?
Comment 8 Niraj Modi CLA 2018-07-24 08:40:55 EDT
(In reply to Thomas Singer from comment #6)
> Created attachment 275090 [details]
> Screenshot of SmartGit using this bug's commit

With my quick test with latest Eclipse build: I20180723-2000, I don't see any such issues at my end on Win10 @ 100% and 150%.
Comment 9 Thomas Singer CLA 2018-07-25 02:58:53 EDT
Created attachment 275114 [details]
Sample code to reproduce
Comment 10 Thomas Singer CLA 2018-07-25 02:59:23 EDT
Created attachment 275115 [details]
Screenshot of sample code
Comment 11 Thomas Singer CLA 2018-07-25 03:01:09 EDT
I'm using Windows 10 with 200% zoom on a 4k monitor. We need to set swt.autoScale to false to workaround the well-known painting problems.
Comment 12 Thomas Singer CLA 2018-07-25 03:02:36 EDT
Created attachment 275116 [details]
Screenshot of sample code without setting swt.autoScale to false
Comment 13 Niraj Modi CLA 2018-08-02 10:03:48 EDT
(In reply to Thomas Singer from comment #11)
> I'm using Windows 10 with 200% zoom on a 4k monitor. We need to set
> swt.autoScale to false to workaround the well-known painting problems.

Raised separate bug 537614 to investigate the checkbox problem, seen with custom HiDPI scenario.

Also, for reference please point us to bug regarding the painting problems you mentioned above.
Comment 14 Niraj Modi CLA 2018-08-02 10:04:50 EDT
Marking this bug as verified as tested on Win10 using Build id: I20180731-2000
Comment 15 Thomas Singer CLA 2018-08-02 12:26:22 EDT
(In reply to Niraj Modi from comment #13)
> Also, for reference please point us to bug regarding the painting problems
> you mentioned above.

Just compare the rectangles outside the checkbox in this snippet. To get the painting right, you would need a double-sized rectangle line width, too.
Comment 16 Niraj Modi CLA 2018-08-06 09:36:28 EDT
(In reply to Thomas Singer from comment #15)
> (In reply to Niraj Modi from comment #13)
> > Also, for reference please point us to bug regarding the painting problems
> > you mentioned above.
> 
> Just compare the rectangles outside the checkbox in this snippet. To get the
> painting right, you would need a double-sized rectangle line width, too.

Ok got it, raised bug 537725 for this.