Bug 570062 - Shell not auto-rescaled when moved to a secondary monitor with a different dpi
Summary: Shell not auto-rescaled when moved to a secondary monitor with a different dpi
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.19   Edit
Hardware: PC Windows 10
: P3 major with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-04 16:05 EST by Nicolas Falliere CLA
Modified: 2021-01-12 15:12 EST (History)
0 users

See Also:


Attachments
Sample code (947 bytes, application/octet-stream)
2021-01-04 16:05 EST, Nicolas Falliere CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas Falliere CLA 2021-01-04 16:05:35 EST
Created attachment 285173 [details]
Sample code

If a Shell is created on a high-dpi primary monitor, and subsequently moved to a secondary monitor having a different dpi (in my test case, lower), the Shell and its contents are not auto-rescaled, therefore appearing very large.

A listener for SWT.ZoomChanged on the Shell does receive the event, as expected.

I noticed that Eclipse IDE does auto-rescale its windows/shells when they are moved to a different dpi monitor. How is that achieved? Could it be done as well for regular SWT shells and components?

Notes:
- test system is Windows 10 (untested with GTK, macOS)
- the Shell is a standard shell with SHELL_TRIM
- not using any swt.autoScale setting

Test code attached.
Comment 1 Nicolas Falliere CLA 2021-01-12 15:12:11 EST
Could anybody help or provide a pointer for the above? Thanks.