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

[win32] different coordinate system strategies #1630

Conversation

akoch-yatta
Copy link
Contributor

@akoch-yatta akoch-yatta commented Dec 2, 2024

This contributes extracts two different strategies to provide a consistent coordinate system in the win32 implemenentation for a single-zoom and a multi-zoom environment. The existing logic remains unchanged in this commit. It is only moved and consolidated in the new inner classes in Display.

This PR fixes eclipse-platform/eclipse.platform.ui#2595 as well

Copy link
Contributor

github-actions bot commented Dec 2, 2024

Test Results

   383 files  +1     383 suites  +1   5m 21s ⏱️ -35s
 4 286 tests ±0   4 272 ✅ +1  14 💤 ±0  0 ❌  - 1 
12 150 runs  ±0  12 065 ✅ +1  85 💤 ±0  0 ❌  - 1 

Results for commit fbfb9c0. ± Comparison against base commit 43b6820.

♻️ This comment has been updated with latest results.

@akoch-yatta akoch-yatta marked this pull request as ready for review December 2, 2024 11:13
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.

The changes look sound to me. I've not tested yet, but just looked at static code correctness. I only have minor comments so far.

Since I did quite some manual comparison with the state before 0e7f799 (which introduced specific coordinate system behavior for rescaling at runtime), I was wondering whether we may add a revert commit for 0e7f799 and reapply this on top of it, to make it easier to review and identify the changes compared to existing behavior.

@akoch-yatta akoch-yatta force-pushed the extract-display-coordinate-system branch from f642464 to 137fbd8 Compare December 5, 2024 16:36
@akoch-yatta akoch-yatta force-pushed the extract-display-coordinate-system branch 2 times, most recently from c2d8158 to 34aab7f Compare December 10, 2024 11:03
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 did a quick review and testing and found no further issues with this PR 👍

@akoch-yatta akoch-yatta force-pushed the extract-display-coordinate-system branch 2 times, most recently from 7d0ba65 to dde6558 Compare December 10, 2024 13:20
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.

Thank you for splitting up the commit to a revert and the separation of different mapping strategies. The changes look good to me now. I have taken a particularly thorough look at the SingleZoomCoordinateSystemMapper for the existing HiDPI behavior.

I have some minor points left:

Comment on lines 3141 to 3143
private int getApplicableMonitorZoom(Monitor monitor) {
return DPIUtil.getZoomForAutoscaleProperty(isRescalingAtRuntime() ? monitor.zoom : getDeviceZoom());
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This method only seems to be used within the MultiZoomCoordinateSystemMapper, so maybe we could move it there and remove the case distinction whether rescaling at runtime is active (as that mapper is only used when that mode is active).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, I moved and adapted the method accordingly

@akoch-yatta akoch-yatta force-pushed the extract-display-coordinate-system branch from dde6558 to 4ef8e11 Compare December 10, 2024 14:57
This contribution extracts two different strategies to provide a consistent coordinate system in the win32 implemenentation for a single-zoom and a multi-zoom environment. The existing logic remains unchanged in this commit. It is only moved and consolidated in the new inner classes in Display.

Contributes to eclipse-platform#62 and eclipse-platform#131
Fixes eclipse-platform/eclipse.platform.ui#2595
@HeikoKlare HeikoKlare force-pushed the extract-display-coordinate-system branch from 4ef8e11 to fbfb9c0 Compare December 10, 2024 16:10
@HeikoKlare HeikoKlare merged commit 6d83968 into eclipse-platform:master Dec 10, 2024
7 of 11 checks passed
@HeikoKlare HeikoKlare linked an issue Dec 10, 2024 that may be closed by this pull request
@akoch-yatta akoch-yatta deleted the extract-display-coordinate-system branch December 12, 2024 06:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants