Skip to content

Removing getDeviceZoom from tests #2141

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

arunjose696
Copy link

@arunjose696 arunjose696 commented May 12, 2025

DPIUtil.get[Native]DeviceZoom() is no longer meaningful when monitor-specific scaling is used, so its usage has been removed from most tests. In some cases , these have been left unchanged for now.

Among the occurrences mentioned in Eclipse Platform Issue #195, most have been addressed. Still the following four cases remain unmodified:

1)org.eclipse.swt.tests.junit.Test_org_eclipse_swt_graphics_GC.executeWithNonDefaultDeviceZoom(Runnable)
2)org.eclipse.swt.tests.junit.DPIUtilTests.setup()
3)org.eclipse.swt.tests.junit.Test_org_eclipse_swt_graphics_Image.test_updateWidthHeightAfterDPIChange()

In these three tests, getDeviceZoom() is used to capture the zoom level before execution and restore it afterward. No suitable replacement has been identified yet.

4)org.eclipse.swt.snippets.Snippet373.main(String[])

The snippet description says it is used to to display/refresh Monitor DPI dynamically. However, it uses incorrect DPI access methods and presents a misleading example. It would be better to either remove or rewrite this snippet.

Copy link
Contributor

github-actions bot commented May 13, 2025

Test Results

   545 files  ±0     545 suites  ±0   37m 44s ⏱️ + 4m 41s
 4 377 tests ±0   4 359 ✅ ±0   18 💤 ±0  0 ❌ ±0 
16 647 runs  ±0  16 506 ✅ ±0  141 💤 ±0  0 ❌ ±0 

Results for commit 5eb4ab0. ± Comparison against base commit ad99d4e.

♻️ This comment has been updated with latest results.

@arunjose696 arunjose696 marked this pull request as ready for review May 13, 2025 13:50
@arunjose696 arunjose696 changed the title DRAFT: Removing getDeviceZoom from tests Removing getDeviceZoom from tests May 13, 2025
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.

Replace DPIUtil::get(Native)DeviceZoom() calls for all the snippets and tests
1 participant