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

shell.getMonitor().zoom returning wrong zoom sometimes when frequently switching between two different zoom level monitors #132

Open
ShahzaibIbrahim opened this issue Oct 14, 2024 · 1 comment
Labels
Bug A Derivation of Expected Behavior HiDPI A HiDPI-Related Issue or Feature SWT Issue for SWT

Comments

@ShahzaibIbrahim
Copy link

ShahzaibIbrahim commented Oct 14, 2024

Monitor zoom returning wrong value when moving between two different zoom level monitors. This happens when swt.autoScale.updateOnRuntime is false. This could lead to weird behavior in some of the widgets that are using custom drawing.

Steps to reproduce

  • Add this line System.out.println("Monitor Zoom in Button= " + this.getShell().getMonitor().zoom); in WM_SIZE method in Button.class.
  • Go to ControlExample.java and add the line OS.setTheme(true);
  • Run the ControlExample.java with swt.autoScale.updateOnRuntime=false
  • Move the window between two monitors frequently and check the console if it returns the correct zoom level all the time.

This issue was found during testing the menuItem in Dark theme PR: eclipse-platform/eclipse.platform.swt#1405 (comment). The vertical alignment was broken in some cases when getMonitor().zoom returned the wrong zoom level.

@ShahzaibIbrahim ShahzaibIbrahim converted this from a draft issue Oct 14, 2024
@ShahzaibIbrahim ShahzaibIbrahim added SWT Issue for SWT Bug A Derivation of Expected Behavior HiDPI A HiDPI-Related Issue or Feature labels Oct 14, 2024
@fedejeanne
Copy link

@ShahzaibIbrahim could you please mention the issue (or comment) to which this finding is related? IIRC it was a comment from Heiko.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A Derivation of Expected Behavior HiDPI A HiDPI-Related Issue or Feature SWT Issue for SWT
Projects
Status: 🔖 Ready: Epics
Development

No branches or pull requests

2 participants