eclipse.platform icon indicating copy to clipboard operation
eclipse.platform copied to clipboard

[Windows] Missing scrollbars in compare editor on non default screen scaling

Open merks opened this issue 1 year ago • 16 comments

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

Steps to reproduce

From a fresh installation and clean workspace:

Any files I compare in my updated SDK IDE, it doesn't show scroll bars:

image

But in a debug launched IDE it works.

I noticed this in other recently installed/updated IDEs.

Tested under this environment:

I'm on Windows 10.

merks avatar Aug 05 '24 07:08 merks

@merks : could you please disable themes in preferences and check if that would "fix" the diff editor? @BeckerWdf : could it be related to latest theme changes?

iloveeclipse avatar Aug 09 '24 10:08 iloveeclipse

Neither no theme, nor the choice of theme has an impact. I tried clicking around in case it was just not visibly painted but actually there, but it really seems not to be there at all, just the blank area where it should be.

merks avatar Aug 09 '24 11:08 merks

I see it now too. Linux is not affected. Bisecting... I20240612-0510 OK I20240614-1800 OK I20240617-1800 OK I20240618-1800 BAD I20240715-0020 BAD

iloveeclipse avatar Aug 09 '24 12:08 iloveeclipse

I20240618-1800 BAD => Commit https://github.com/eclipse-platform/eclipse.platform.swt/commit/25b32ef8091c278928027b3326a83033874f134b from https://github.com/eclipse-platform/eclipse.platform.swt/pull/1209 is the bad one.

@ShahzaibIbrahim, @fedejeanne, the PR above broke compare editor on Windows. This is a blocker for 4.33, as it makes the compare editor hardly usable.

Please investigate as soon as possible!

iloveeclipse avatar Aug 09 '24 13:08 iloveeclipse

Can I have more info on this? I tried reproducing on latest build with no VM arguments, Windows 11, Screen Resolution 1920x1080 and zoom level 100%.

I am unable to reproduce it for now. Perhaps, I am missing something?

image

ShahzaibIbrahim avatar Aug 09 '24 14:08 ShahzaibIbrahim

Where one can find zoom value on Windows? I have Notebook with Win 11 and 1920x1080 resolution too.

iloveeclipse avatar Aug 09 '24 14:08 iloveeclipse

Systems -> Display -> Scale

image

ShahzaibIbrahim avatar Aug 09 '24 14:08 ShahzaibIbrahim

OK, I have 125%

iloveeclipse avatar Aug 09 '24 14:08 iloveeclipse

After switching to 100% I see the tiny line for the scrollbar now, and it shows on hover, but I can't read the text anymore because it is all so small now :-)

iloveeclipse avatar Aug 09 '24 14:08 iloveeclipse

My primary display is also 125% The secondary is 225%.

merks avatar Aug 09 '24 14:08 merks

It's now reproduced. It has indeed raised the regression. I will need time to investigate but in the meantime, I can either

  1. Revert the change completely
  2. or fix the regression with a small change but it won't fix the original issue entirely. (by original, I mean the issue my changes were fixing)

Kindly suggest.

ShahzaibIbrahim avatar Aug 09 '24 14:08 ShahzaibIbrahim

4.33 M3 build is planned for 15 August.

The fix (or revert) should be done before, so we could deliver M3 for testing and could revert the fix if it would be still not OK.

iloveeclipse avatar Aug 09 '24 14:08 iloveeclipse

I will create a new PR for this fix.

ShahzaibIbrahim avatar Aug 09 '24 14:08 ShahzaibIbrahim

Thanks folks!

merks avatar Aug 09 '24 14:08 merks

To me, it look as if the introduced method simply uses the wrong zoom value. This line:

return OS.GetSystemMetricsForDpi(nIndex, DPIUtil.mapZoomToDPI(getZoom()));

should instead be:

return OS.GetSystemMetricsForDpi(nIndex, DPIUtil.mapZoomToDPI(nativeZoom));

That's why the issue only appear at 125% (and other quarter scales): getZoom() return 100% instead of the proper 125%.

In preliminary tests, this fixes the problem for me.

@ShahzaibIbrahim can you please further investigate whether that might be the cause?

HeikoKlare avatar Aug 09 '24 15:08 HeikoKlare

To me, it look as if the introduced method simply uses the wrong zoom value. This line:

return OS.GetSystemMetricsForDpi(nIndex, DPIUtil.mapZoomToDPI(getZoom()));

should instead be:

return OS.GetSystemMetricsForDpi(nIndex, DPIUtil.mapZoomToDPI(nativeZoom));

That's why the issue only appear at 125% (and other quarter scales): getZoom() return 100% instead of the proper 125%.

In preliminary tests, this fixes the problem for me.

@ShahzaibIbrahim can you please further investigate whether that might be the cause?

You are right, this is exactly the issue. The higher the zoom level goes, the smaller scrollbar became because getZoom() returned 100% in case the zoom is 125% or 150% and 200% in case of 175%. Using nativeZoom has fixed the issue (I checked in all zoom levels)

ShahzaibIbrahim avatar Aug 09 '24 15:08 ShahzaibIbrahim

Is this issue fixed? If yes, please close.

iloveeclipse avatar Aug 27 '24 05:08 iloveeclipse

Has been fixed via:

  • eclipse-platform/eclipse.platform.swt#1397

I revalidated with latest I-Build (I20240826-2120): the original issue is not present

HeikoKlare avatar Aug 27 '24 06:08 HeikoKlare