[Win32] Autoscale cursor even on widgets that have autoscaling disabled #2646
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Cursors are initialized with the zoom of the control on which they are set. However, cursors are usually expected to scale according to the autoscaled UI around those controls for which autoscaling was disabled.
This change adapts the cursor initializations to use the autoscale zoom of the containing shell instead of the zoom of the control itself. In consequence, cursors will have the same size in the whole shell, no matter on which control they are set.
Contributes to eclipse-gef/gef-classic#821
How to test
Best possibility to productively test is with Draw2d/GEF and according examples.
For simple testing, the following snippet can be used (adapted from #2308). The lines for different properties
AUTOSCALE_DISABLED
,swt.autoScale
andswt.autoScale.updateOnRuntime
can be changed to test different combinations. The combination that is activated by default shows the bug in the existing implementation. The others allow to test that we do not have possible regressions regarding previous issue reports, such as #2308.In any case, a primary monitor with zoom != 100% should be used.
The red cursor is expected to always have half the width and height of the green shell.
With the default configuration is looks like this without the change:

And this is how it looks with the change:
