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

Bug 527937

Summary: [HiDPI][Win32] Themed Checkbox/Radiobutton: focus-rect cut off from bottom
Product: [Eclipse Project] Platform Reporter: Thomas Singer <eclipse>
Component: SWTAssignee: Conrad Groth <info>
Status: VERIFIED FIXED QA Contact: Niraj Modi <niraj.modi>
Severity: normal    
Priority: P3 CC: info, lshanmug, niraj.modi, peter, sravankumarl
Version: 4.8   
Target Milestone: 4.8 M6   
Hardware: PC   
OS: Windows 10   
See Also: https://git.eclipse.org/r/116656
https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=37235cadc610ee19c2d6588cb15047d0aa3d89b5
Whiteboard:
Bug Depends on:    
Bug Blocks: 517055    
Attachments:
Description Flags
Test snippet
none
Screenshot of the focused checkbox
none
Screenshot of the focused radiobutton
none
Checkbox_RadioButton_100DPI_WithPatch(Image is zoomed in mspaint to highlight the problem) none

Description Thomas Singer CLA 2017-11-30 04:33:43 EST
Please launch the attached snippet. It will set the foreground and background color of a checkbox and two radiobuttons. When focused, the focus-rect will be cut-off at the bottom part. When not setting the foreground color, the focus-rect will be drawn correctly.
Comment 1 Thomas Singer CLA 2017-11-30 04:34:12 EST
Created attachment 271703 [details]
Test snippet
Comment 2 Thomas Singer CLA 2017-11-30 04:36:24 EST
Created attachment 271704 [details]
Screenshot of the focused checkbox
Comment 3 Thomas Singer CLA 2017-11-30 04:36:42 EST
Created attachment 271705 [details]
Screenshot of the focused radiobutton
Comment 4 Niraj Modi CLA 2017-11-30 05:56:02 EST
Problem reproducible on my Win10 at 150% DPI, will investigate for 4.8
Comment 5 Thomas Singer CLA 2018-01-29 06:15:48 EST
I'm using 200% zoom on my Windows 10 system and this bugs looks bad. Anyone who looks at the Eclipse preferences should see this regression immediately.
Comment 6 Conrad Groth CLA 2018-02-03 06:05:39 EST
I tested with native DPI of 125% and 150%, combined with swt.autoScale of 150, 200 and 400.
See attached Gerrit patch.
Comment 7 Thomas Singer CLA 2018-02-03 12:37:19 EST
Where can I find the Gerrit commit(s)? Shouldn't they show up here in bugzilla?
Comment 8 Conrad Groth CLA 2018-02-03 14:48:50 EST
(In reply to Thomas Singer from comment #7)
> Where can I find the Gerrit commit(s)? Shouldn't they show up here in
> bugzilla?

I forgot the bug number in the commit message. Fixed this now. You can find the patch under https://git.eclipse.org/r/#/c/116656/
Comment 9 Niraj Modi CLA 2018-02-08 03:50:34 EST
Created attachment 272583 [details]
Checkbox_RadioButton_100DPI_WithPatch(Image is zoomed in mspaint to highlight the problem)

(In reply to Conrad Groth from comment #8)
> I forgot the bug number in the commit message. Fixed this now. You can find
> the patch under https://git.eclipse.org/r/#/c/116656/

Hi Conrad,
Thanks for the patch it works fine for the problem at HiDPI.
But I see one issue at 100% DPI, wherein with the patch I find the focus rectangle is unnecessarily short by 1px from the bottom as compared to the checkbox/radioButton background.
See attached image of checkbox/radioButton with the patch at 100% DPI.

IMO we should make this 1px adjustment for HiDPI scenario only and not for standard DPI.
Comment 10 Niraj Modi CLA 2018-02-21 11:35:15 EST
Ping!
Comment 12 Niraj Modi CLA 2018-03-05 04:46:41 EST
(In reply to Eclipse Genie from comment #11)
> Gerrit change https://git.eclipse.org/r/116656 was merged to [master].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/
> ?id=37235cadc610ee19c2d6588cb15047d0aa3d89b5

Resolving now.
Comment 13 Niraj Modi CLA 2018-03-07 03:18:53 EST
Verified fix in Build id: I20180305-2000 @Win10.