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

Restrict autoScale to Allowed Values Only #182

Open
ShahzaibIbrahim opened this issue Jan 10, 2025 · 4 comments · May be fixed by eclipse-platform/eclipse.platform.swt#1721
Open

Restrict autoScale to Allowed Values Only #182

ShahzaibIbrahim opened this issue Jan 10, 2025 · 4 comments · May be fixed by eclipse-platform/eclipse.platform.swt#1721
Assignees
Labels
HiDPI/Integer200 HiDPI issues specific to using "integer" or "integer200" scaling mode HiDPI A HiDPI-Related Issue or Feature SWT Issue for SWT
Milestone

Comments

@ShahzaibIbrahim
Copy link

We need to enforce stricter validation on the autoScale parameter. Currently, unsupported values such as half and int200 are being used. To ensure consistent functionality and reduce errors, we will now throw an SWT error if an unsupported value is provided.

Allowed Values:

  • quarter
  • exact
  • false
  • Any numeric value (e.g., 166)

Disallowed Values:

  • half
  • int200
  • Any value not included in the above whitelist

Expected Behavior:

Users attempting to set autoScale to any value outside the allowed list will encounter an SWT error with a clear message indicating the invalid value and the list of permitted options.

@ShahzaibIbrahim ShahzaibIbrahim moved this to 🔖 Ready: Atomic in HiDPI Jan 10, 2025
@ShahzaibIbrahim ShahzaibIbrahim self-assigned this Jan 10, 2025
@ShahzaibIbrahim ShahzaibIbrahim added SWT Issue for SWT HiDPI A HiDPI-Related Issue or Feature HiDPI/Integer200 HiDPI issues specific to using "integer" or "integer200" scaling mode labels Jan 10, 2025
@ShahzaibIbrahim ShahzaibIbrahim pinned this issue Jan 10, 2025
@ShahzaibIbrahim ShahzaibIbrahim unpinned this issue Jan 10, 2025
@HeikoKlare HeikoKlare added this to the 4.35 M2 milestone Jan 13, 2025
@akoch-yatta
Copy link

Important Only in combination with autoScale.updateOnRuntime = true

@akoch-yatta
Copy link

Extension: We should extend the check for the (experimental) flag -> only allow checking it, when a valid scaling mode is configured

@HeikoKlare
Copy link
Contributor

Extension: We should extend the check for the (experimental) flag -> only allow checking it, when a valid scaling mode is configured

This is actually not that easy to achieve: everything related to these scaling modes is hidden in the DPIUtil class, which is internal, So without accessing internal code or replicating some of its implementation, it is currently not possible to realize this. This might be something we could provide as proper API for Display once we also agree on the one for activating the scaling as well.

@akoch-yatta
Copy link

Ah okay, you are right, then it is not in scope for this ticket, I would say. This should never happen anyway, unless you are doing something explicitly e.g. in the ini

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
HiDPI/Integer200 HiDPI issues specific to using "integer" or "integer200" scaling mode HiDPI A HiDPI-Related Issue or Feature SWT Issue for SWT
Projects
Status: 🏗 In Work: Short
Development

Successfully merging a pull request may close this issue.

3 participants