Skip to content
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

Non system cursors adaption to DPI scale changes #1603

Merged
merged 1 commit into from
Nov 27, 2024

Conversation

ShahzaibIbrahim
Copy link
Contributor

Creating a map to provide different handle w.r.t the current zoom of the display. The method win32_getHandle provides the appropriate handle for the scaled image as per requested by the client.

HOW TO TEST

  • Run the Snippet92 (Image) or Snippet119 (Icon) with the following VM Arguments
-Dswt.autoScale=quarter
-Dswt.autoScale.updateOnRuntime=true
  • Run the example
  • Move the mouse pointer to the window
  • See if the mouse pointer is scaled to the current monitor zoom level.
  • Now move the window to another monitor with different zoom level (i.e. 200%)
  • Move the mouse pointer to the window again
  • See if the pointer still scaled correctly according to 200% zoom level

Copy link
Contributor

github-actions bot commented Nov 20, 2024

Test Results

   381 files   -   102     381 suites   - 102   3m 35s ⏱️ - 5m 2s
 4 060 tests  -    35   4 052 ✅  -    33   8 💤 + 1  0 ❌  - 3 
11 923 runs   - 4 250  11 885 ✅  - 4 195  38 💤  - 52  0 ❌  - 3 

Results for commit 29c0bdb. ± Comparison against base commit ca1bb19.

This pull request removes 35 tests.
org.eclipse.swt.graphics.ImageWin32Tests ‑ testImageShouldHaveDimesionAsPerZoomLevel
org.eclipse.swt.tests.win32.Test_org_eclipse_swt_dnd_DND ‑ testByteArrayTransfer
org.eclipse.swt.tests.win32.Test_org_eclipse_swt_dnd_DND ‑ testFileTransfer
org.eclipse.swt.tests.win32.Test_org_eclipse_swt_dnd_DND ‑ testHtmlTransfer
org.eclipse.swt.tests.win32.Test_org_eclipse_swt_dnd_DND ‑ testImageTransfer_fromCopiedImage
org.eclipse.swt.tests.win32.Test_org_eclipse_swt_dnd_DND ‑ testImageTransfer_fromImage
org.eclipse.swt.tests.win32.Test_org_eclipse_swt_dnd_DND ‑ testImageTransfer_fromImageData
org.eclipse.swt.tests.win32.Test_org_eclipse_swt_dnd_DND ‑ testImageTransfer_fromImageDataFromImage
org.eclipse.swt.tests.win32.Test_org_eclipse_swt_dnd_DND ‑ testRtfTransfer
org.eclipse.swt.tests.win32.Test_org_eclipse_swt_dnd_DND ‑ testTextTransfer
…
This pull request skips 4 tests.
org.eclipse.swt.tests.junit.Test_org_eclipse_swt_browser_Browser ‑ test_Constructor_multipleInstantiationsInDifferentThreads[browser flags: 0]
org.eclipse.swt.tests.junit.Test_org_eclipse_swt_browser_Browser ‑ test_setUrl_local[browser flags: 0]
org.eclipse.swt.tests.junit.Test_org_eclipse_swt_browser_Browser ‑ test_setUrl_remote[browser flags: 0]
org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Button ‑ test_traverseCheckButton

♻️ This comment has been updated with latest results.

Copy link
Contributor

@fedejeanne fedejeanne left a comment

Choose a reason for hiding this comment

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

I didn't test this, I only have some proposals regarding the coding style and JavaDoc.

I also have 2 questions regarding returning a handle of a cursor that is already disposed and about making the field handle private.

Copy link
Contributor

@fedejeanne fedejeanne left a comment

Choose a reason for hiding this comment

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

Changes look good, they produce the expected result and I see no regressions either.

Please remove the extra (unnecessary) call to registerResourceWithZoomSupport(this) from the constructor, squash and rebase your commits and then this PR is good to go ✔️

Creating a map to provide different handle w.r.t the current zoom of the
display. The method win32_getHandle provides the appropriate handle for
the scaled image as per requested by the client.
Copy link
Contributor

@fedejeanne fedejeanne left a comment

Choose a reason for hiding this comment

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

Test failures are unrelated

@fedejeanne fedejeanne merged commit 8c5bc7f into eclipse-platform:master Nov 27, 2024
8 of 14 checks passed
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.

Non system cursors are not adapted to DPI scale changes
2 participants