Skip to content

Regression: Line Numbers are broken in different ways on Linux/MacOS #2740

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
2 tasks done
BeckerWdf opened this issue Jan 21, 2025 · 9 comments · Fixed by #2754
Closed
2 tasks done

Regression: Line Numbers are broken in different ways on Linux/MacOS #2740

BeckerWdf opened this issue Jan 21, 2025 · 9 comments · Fixed by #2754
Labels
bug Something isn't working Linux Happens on Linux macOS happens on macOS regression

Comments

@BeckerWdf
Copy link
Contributor

Let's make sure issue is not already fixed in latest builds first.

Steps to reproduce

From a fresh installation and clean workspace:

I tried

  • Open a Java Class and scroll up and down slowly

I expected: line number to be sharp

But got: partly blurry line numbers at the top or the bottom. See

Image

I think this is a regression from #2722

Tested under this environment:

  • OS & version: macOS
  • Eclipse IDE/Platform version (as shown in Help > About): newest i-build

Community

  • I understand reporting an issue to this OSS project does not mandate anyone to fix it. Other contributors may consider the issue, or not, at their own convenience. The most efficient way to get it fixed is that I fix it myself and contribute it back as a good quality patch to the project.
@BeckerWdf BeckerWdf added the bug Something isn't working label Jan 21, 2025
@BeckerWdf
Copy link
Contributor Author

@akoch-yatta and @HeikoKlare can you please have a look?

@akoch-yatta
Copy link
Contributor

We have a look

@iloveeclipse iloveeclipse changed the title Regression: Line Numbers are partly blurry on macOS Regression: Line Numbers are broken in different ways on Linux/MacOS Jan 21, 2025
@iloveeclipse
Copy link
Member

OMG. I see on Linux line numbers completely broken after scrolling up/down few times:

Image

This must be fixed ASAP.

@iloveeclipse iloveeclipse added macOS happens on macOS Linux Happens on Linux labels Jan 21, 2025
@HeikoKlare
Copy link
Contributor

Looks to me as if it might got worse with the recent changes, but it seems like this is long broken on GTK. I just tested with a 1,5-year-old SDK and got this:
Version: 2023-06 (4.28)
Build id: I20230605-0440

Image

akoch-yatta added a commit to vi-eclipse/eclipse.platform.ui that referenced this issue Jan 21, 2025
@iloveeclipse
Copy link
Member

iloveeclipse commented Jan 21, 2025

Whatever issues your I20230605-0440 version has is not related to recent regression. It is not the first time the line number ruler got a regression.

It works fine with reverted 57666c4 and is broken with current master.

So please provide a fix or we should revert 57666c4 as it makes line number ruler on Linux unusable.

@HeikoKlare
Copy link
Contributor

HeikoKlare commented Jan 21, 2025

Sure, we'll do that. But we need to understand the reasons for the issue and actually all SDKs I am running on Linux (no matter whether the 2023-06 one, a recent but older I-Build one, or any other) show this behavior to a certain degree. I am able to produce broken line number rulers in all of them. So it's currently quite hard to understand what part of the behavior needs to be fixed, given that it was (at least on some environments) also broken before yesterday's change to a certain degree.
But as said, we are of course investigating the issue and will come up with a fix.

Edit: In particular if I revert 57666c4, the issue is not fixed on my system but just occurs less often.

@iloveeclipse
Copy link
Member

all SDKs I am running on Linux (no matter whether the 2023-06 one, a recent but older I-Build one, or any other) show this behavior to a certain degree

Ugh. I'm using RHEL 9.2 and used to run RHEL 7.9 with almost every nightly SDK build till 4.35 broke compatibility to older Linux distros and I saw no issues with line number ruler (except few regressions clearly identified as such like this one here).

I'm using gtk3-3.24.31-2.el9.x86_64 on RHEL 9.2 / KDE 5 / X11. Not sure if you are using Ubuntu or Wayland, both of them known to have troubles with SWT and together probably unusable for Eclipse anyway.

What I clearly see is that 57666c4 commit breaks status quo and I see no problems with it reverted or in SDK build I20250119-1800.

@HeikoKlare
Copy link
Contributor

Good point. I am running Ubuntu with Wayland. I will test with X11 to hopefully have a state that worked before the commit introducing the regression as a baseline for comparison.

Just as a "demonstration", this is how it looks with 57666c4 reverted for me:

Image

@iloveeclipse
Copy link
Member

OK, let take Wayland out of equation. On X11 Eclipse must work.

HeikoKlare added a commit to vi-eclipse/eclipse.platform.swt that referenced this issue Jan 22, 2025
The current implementation of the Image constructor accepting an
ImageGcDrawer does initialize the image with the given width and height
but extracts them from the image data being initialized with the
ImageGcDrawer. This does not take the current device zoom into account
properly, leading to images unexpectedly being rendered for 100% scaling
while they are supposed to be used at 200% scaling.

With this change, images are properly initialized with the given width
and height and using the according device zoom for the image data
generation, leading to a sharp initialization also on 200% monitors.

Serves as a fix for the MacOS part of issue
eclipse-platform/eclipse.platform.ui#2740
HeikoKlare added a commit to vi-eclipse/eclipse.platform.ui that referenced this issue Jan 22, 2025
…se-platform#2740

This temporarily reverts the image creation for the
LineNumberRulerColumn on Linux to the state before initializing the
buffer image with an ImageGcDrawer. This does currently not work
properly for all use cases on Linux/GTK because of an issue with the
initialization of Image based on existing ImageData due to the usage of
cairo_image_surface_create.

Linux-specific workaround for
eclipse-platform#2740
HeikoKlare added a commit to eclipse-platform/eclipse.platform.swt that referenced this issue Jan 22, 2025
The current implementation of the Image constructor accepting an
ImageGcDrawer does initialize the image with the given width and height
but extracts them from the image data being initialized with the
ImageGcDrawer. This does not take the current device zoom into account
properly, leading to images unexpectedly being rendered for 100% scaling
while they are supposed to be used at 200% scaling.

With this change, images are properly initialized with the given width
and height and using the according device zoom for the image data
generation, leading to a sharp initialization also on 200% monitors.

Serves as a fix for the MacOS part of issue
eclipse-platform/eclipse.platform.ui#2740
HeikoKlare added a commit to vi-eclipse/eclipse.platform.ui that referenced this issue Jan 22, 2025
…se-platform#2740

This temporarily reverts the image creation for the
LineNumberRulerColumn on Linux to the state before initializing the
buffer image with an ImageGcDrawer. This does currently not work
properly for all use cases on Linux/GTK because of an issue with the
initialization of Image based on existing ImageData due to the usage of
cairo_image_surface_create.

Linux-specific workaround for
eclipse-platform#2740
HeikoKlare added a commit to vi-eclipse/eclipse.platform.ui that referenced this issue Jan 22, 2025
…se-platform#2740

This temporarily reverts the image creation for the
LineNumberRulerColumn on Linux to the state before initializing the
buffer image with an ImageGcDrawer. This does currently not work
properly for all use cases on Linux/GTK because of an issue with the
initialization of Image based on existing ImageData due to the usage of
cairo_image_surface_create.

Linux-specific workaround for
eclipse-platform#2740
HeikoKlare added a commit that referenced this issue Jan 22, 2025
This temporarily reverts the image creation for the
LineNumberRulerColumn on Linux to the state before initializing the
buffer image with an ImageGcDrawer. This does currently not work
properly for all use cases on Linux/GTK because of an issue with the
initialization of Image based on existing ImageData due to the usage of
cairo_image_surface_create.

Linux-specific workaround for
#2740
HeikoKlare added a commit to HeikoKlare/eclipse.platform.ui that referenced this issue Jan 24, 2025
…latform#2740

The underlying issue for the required workaround on Linux/GTK was
located in the GTK implementation of GC#copyArea() when source and
target area of a copy operation are overlapping. Since that issue has
been fixed, this change removes the temporary workaround in
LineNumberRulerColumn.

Fixes eclipse-platform#2740
HeikoKlare added a commit to HeikoKlare/eclipse.platform.ui that referenced this issue Jan 25, 2025
…latform#2740

The underlying issue for the required workaround on Linux/GTK was
located in the GTK implementation of GC#copyArea() when source and
target area of a copy operation are overlapping. Since that issue has
been fixed, this change removes the temporary workaround in
LineNumberRulerColumn.

Fixes eclipse-platform#2740
HeikoKlare added a commit that referenced this issue Jan 25, 2025
The underlying issue for the required workaround on Linux/GTK was
located in the GTK implementation of GC#copyArea() when source and
target area of a copy operation are overlapping. Since that issue has
been fixed, this change removes the temporary workaround in
LineNumberRulerColumn.

Fixes #2740
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Linux Happens on Linux macOS happens on macOS regression
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants