Skip to content

Conversation

@amartya4256
Copy link
Contributor

@amartya4256 amartya4256 commented Jan 6, 2026

This adds a Shell#getZoom() method to make the zoom of a shell as considered by the OS available to consumers. Currently, there is a (undocumented) data field on controls in the Windows implementation for this (SHELL_ZOOM). And for other operating system (which only use a static zoom value for everything), the value is provided internally via DPIUtil#getNativeDeviceZoom() and may also be calculated from Device#getDPI().
It also serves as a preparation for allowing explicit disablement of auto-scaling for specific controls as proposed with #2863, which requires access to the shell's zoom to custom-zoom auto-scale-disabled controls.

This PR also renames the method Widget#getZoom to getAutoscalingZoom since this methods return the value of the zoom based on the autoscaling technique, i.e. quarter, half, etc and whether autoscaling is enabled or disabled, and would conflict with the newly added Shell#getZoom() method.
Note: This change has been made using Eclipse refactoring tool.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

Test Results (win32)

   34 files  ±0     34 suites  ±0   4m 35s ⏱️ +36s
4 628 tests ±0  4 555 ✅ ±0  73 💤 ±0  0 ❌ ±0 
  167 runs  ±0    164 ✅ ±0   3 💤 ±0  0 ❌ ±0 

Results for commit b2b17db. ± Comparison against base commit 892be33.

Copy link
Contributor

@HeikoKlare HeikoKlare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the purpose of this renaming?

@amartya4256
Copy link
Contributor Author

What's the purpose of this renaming?

Since #2863 (comment) in this comment youhad requested to expose the API with a better name that makes sense, i.e. getZoom(), it makes sense to rename the internal method getZoom() to something specific to its behaviour, hence the refactoring.

@amartya4256 amartya4256 force-pushed the amartya4256/rename_getZoom branch 2 times, most recently from d10241e to fc87e89 Compare January 12, 2026 13:37
@amartya4256 amartya4256 force-pushed the amartya4256/rename_getZoom branch from fc87e89 to e40ae0e Compare January 12, 2026 14:41
@github-actions
Copy link
Contributor

github-actions bot commented Jan 12, 2026

Test Results

  176 files  ±0    176 suites  ±0   30m 25s ⏱️ + 4m 2s
4 676 tests ±0  4 654 ✅ ±0  22 💤 ±0  0 ❌ ±0 
  482 runs  ±0    476 ✅ ±0   6 💤 ±0  0 ❌ ±0 

Results for commit aef7bf3. ± Comparison against base commit 9a91cae.

♻️ This comment has been updated with latest results.

@HeikoKlare HeikoKlare force-pushed the amartya4256/rename_getZoom branch from e40ae0e to 45e6f13 Compare January 12, 2026 14:57
@HeikoKlare HeikoKlare changed the title Renamed Widget#getZoom to getAutoscalingZoom Add Shell#getZoom() Jan 12, 2026
@HeikoKlare HeikoKlare force-pushed the amartya4256/rename_getZoom branch from 45e6f13 to c5221e6 Compare January 12, 2026 15:05
Copy link
Contributor

@HeikoKlare HeikoKlare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've fixed the compilation error on MacOS (missing import) and faulty commit messages. I also updated the outdated PR title and description. With that, the PR is fine for me.
@akoch-yatta can you please also have a look?

After merging this, we also need to add a N&N for the new API.

This commit renames the method Widget#getZoom to getAutoscalingZoom
since this methods return the value of the zoom based on the autoscaling
technique, i.e. quarter, half, etc and whether autoscaling is enabled or
disabled.
This commit adds an API Shell#getZoom() which returns the native zoom of
the shell.
@HeikoKlare HeikoKlare force-pushed the amartya4256/rename_getZoom branch from c5221e6 to aef7bf3 Compare January 12, 2026 15:09
Copy link
Contributor

@akoch-yatta akoch-yatta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM as well

@akoch-yatta akoch-yatta merged commit f7fb840 into eclipse-platform:master Jan 12, 2026
23 checks passed
@akoch-yatta akoch-yatta deleted the amartya4256/rename_getZoom branch January 12, 2026 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants