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

Bug 565899

Summary: [HIDPI][MAC][RETINA] Gutter with linenumbers on scrambled in (Java) editor
Product: [Eclipse Project] Platform Reporter: Martijn Dashorst <martijn.dashorst>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: VERIFIED FIXED QA Contact: Sravan Kumar Lakkimsetti <sravankumarl>
Severity: normal    
Priority: P3 CC: cdivilly, Lars.Vogel, sameer2u, slavago, sravankumarl
Version: 4.16   
Target Milestone: 4.18 M3   
Hardware: PC   
OS: Mac OS X   
See Also: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/172006
https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=6c16f919b0cf84a833b695340fe4b57744c1dbb2
https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/172084
https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/172200
https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=da64c04309c040b9e2f58c7843f308e426fa91eb
https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=488b26715b7815d584df655a75d431533ecc70a6
Whiteboard:
Bug Depends on:    
Bug Blocks: 566539    
Attachments:
Description Flags
Garbled/scrambled gutter in text editor
none
Screenshot showing corrupted right gutter
none
Screenshot showing corrupted left gutter none

Description Martijn Dashorst CLA 2020-08-07 12:09:55 EDT
Created attachment 283814 [details]
Garbled/scrambled gutter in text editor

The gutter with linenumbers and annotations for warnings/errors becomes unusable after some time in (in any case) the java editor.

See attached image.
Comment 1 Martijn Dashorst CLA 2020-08-07 12:11:16 EDT
The gutter also doesn't update while scrolling up/down.
Comment 2 Martijn Dashorst CLA 2020-08-07 12:12:18 EDT
There seem to be 2 line numbers: a very small one and a normal sized one. The normal sized one has stopped updating, the very small one does update.
Comment 3 Sravan Kumar Lakkimsetti CLA 2020-08-07 12:22:28 EDT
Can you please update the following

Mac version:
Eclipse version:
Monitor setup: single monitor or dual monitor
Type of the monitor: retina or non-retina

We also did some improvements related to line numbers in 4.16, if you are not using the latest eclipse can you please check whether this is reproducible on the latest eclipse
Comment 4 Martijn Dashorst CLA 2020-08-07 12:52:24 EDT
Mac version: 10.14.6 (18G6020)
Eclipse Version: 2020-06 (4.16.0)
Eclipse Build id: 20200615-1200

Monitor setup: triple monitor
Type of the monitor: 4k@60hz via displayport, 2560x1440@165hz via HDMI, internal laptop retina display.

The editor currently resides on the 2560x1440 monitor.

Enlarging/decreasing fontsize using cmd-+ and cmd-- does repaint the line numbers.

Might be relevant: I have installed and use the editor font "JetBrains Mono".
Comment 5 Sravan Kumar Lakkimsetti CLA 2020-08-10 02:01:15 EDT
Thank you for the information. I will investigate furthur.
Comment 6 Colm Divilly CLA 2020-08-28 08:15:13 EDT
I am also seeing this issue, see attached screenshots

Mac Version: 10.15.6
Eclipse Version: Version: 2020-06 (4.16.0) 
Eclipse Build id: 20200615-1200

Monitor Setup: Dual Monitor

Primary Monitor: Macbook Pro 13" 2017 Retina Default Resolution (2560x1600 native, 1280x800 scaled)

Secondary Monitor: (Where the issue is appearing) Samsung C34H89x [1] - 34" Default Resolution (3440x1440, no scaling).

As noted by the OP, the issue can be resolved by forcing a repaint of the gutters, e.g. by switching perspectives, but will reoccur over time, it happens in every session for me.

[1]: https://displaysolutions.samsung.com/monitor/detail/1131/C34H890
Comment 7 Colm Divilly CLA 2020-08-28 08:16:31 EDT
Created attachment 283984 [details]
Screenshot showing corrupted right gutter
Comment 8 Colm Divilly CLA 2020-08-28 08:17:07 EDT
Created attachment 283985 [details]
Screenshot showing corrupted left gutter
Comment 9 Sravan Kumar Lakkimsetti CLA 2020-09-11 00:23:32 EDT
I am able reproduce this once. quite difficult to reproduce. I am investigating
Comment 10 Sravan Kumar Lakkimsetti CLA 2020-09-20 09:41:19 EDT
*** Bug 567155 has been marked as a duplicate of this bug. ***
Comment 11 Colm Divilly CLA 2020-10-23 09:46:31 EDT
(In reply to Sravan Kumar Lakkimsetti from comment #9)
> I am able reproduce this once. quite difficult to reproduce. I am
> investigating

Let me know if there is anything I do to help with diagnosing the issue further. Turn on tracing/diagnostics in Eclipse etc. It happens in every session for me.
Comment 12 Sravan Kumar Lakkimsetti CLA 2020-10-27 02:00:33 EDT
I see the problem but not able to reproduce this in a consistent fashion. I will investigate further and let you know if I need any tracing.
Comment 13 Sravan Kumar Lakkimsetti CLA 2020-10-30 06:45:35 EDT
I found a reproducible scenario. The problem doesn't reproduce in debug mode. 

My current theory is the line numbers ruler getting drawn with 200 % image and 100% image. Because of this we see both sets of line numbers.

I will investigate further. my next approach is to see which image representation is being used when we use GC.drawText.
Comment 14 Eclipse Genie CLA 2020-11-09 12:24:23 EST
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/172006
Comment 16 Sravan Kumar Lakkimsetti CLA 2020-11-09 23:23:05 EST
(In reply to Eclipse Genie from comment #15)
> Gerrit change
> https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/172006 was
> merged to [master].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/
> ?id=6c16f919b0cf84a833b695340fe4b57744c1dbb2

Merged to master
Comment 17 Sravan Kumar Lakkimsetti CLA 2020-11-09 23:23:33 EST
Verified in I20201109-1800
Comment 18 Eclipse Genie CLA 2020-11-11 04:32:23 EST
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/172084
Comment 19 Eclipse Genie CLA 2020-11-13 06:17:38 EST
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/172200
Comment 22 Sravan Kumar Lakkimsetti CLA 2020-11-17 02:33:42 EST
Verified newly refactored fix in 
Eclipse SDK
Version: 2020-12 (4.18)
Build id: I20201116-1800
OS: Mac OS X, v.10.16, x86_64 / cocoa
Java version: 15.0.1