-
Notifications
You must be signed in to change notification settings - Fork 144
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
HiDPI improvements in SWT with single and multiple monitor setup. #62
Comments
As Addition i checked the fixes done in the past like: I tried it with the per monitorv2 feature "on" in the javaw.exe.manifest: The application is in permonitorv2 mode: So I expected that a zoom changed event is fired when moving my application from one monitor to the other. When moving the application from secondary monitor to primary monitor i get no event: When moving the application from primary monitor to secondary monitor, i get an event: As you can see this is a problem since the oldSWTZoom is gotten from the static field of the dpi Util, which is the "150%" rounded down to 100%. The first step i suggest is to get WM_DPICHANGED event handled correctly, so that you recognize the zoom change. And i would suggest that a control knows his monitor, and the monitor knows his zoom. The zoomchanged event should not only work when changing the zoom within a monitor, but also when moving from one monitor to the other sending the old value and the new value. |
Just an FYI, note that the only place this event is currently handled is here: Clearly we will not want to suggest to the user to restart Eclipse when they move windows between monitors. This also hints at the extent to which the overall application is not able to deal with dynamic resolution changes... |
Reason for this behavior: Since SWT by-design is taking starting reference zoom value of Primary monitor only while initialization:
So, let's use this bug to discuss and investigate a solution here, that's why I updated the bug title. |
On a side note, can you experiment with 'PerMonitor' settings here: Related SWT FAQ: https://www.eclipse.org/swt/faq.php#winexternalmanifestfile IIRC, with 'PerMonitor' we might miss on the WM_DPICHANGED event, but does it give you a better UI experience when switching across monitors and other scenarios that you are trying ? |
I first would like to understand why this design is chosen.
The current solution in swt Controls class supports only the cases 3 and 4.(2 is only partly supported depending if you have you laptop monitor opened, then external monitor is used as secondary device by default, when the laptop is closed it is used as primary) What is the goal we'd like to reach? So let's look at the control classes code:
Why is the oldSWTZoom relevant? It is not fired with the event. So what is the behavior achieved by this code? For case 1: When moving from primary to secondary your application gets an event, which say, zoomchanged, but when moving it back it does not tell the same. => This is not expected, since our goal is to adapt to the scaling of the monitor on which the application is currently placed. What would be the expectation? So my question: Would it not be correct and consistent to always fire the zoom changed event whenever WM_DPICHANGED event occures by os? If not please be so kind to explain the situation or usecase when i do want the inconsistent behavior? |
To my understanding, the biggest blocker in current design is that in Windows, DPI is assigned per top-level window ( A proper fix would be to teach If someone volunteers to do that, I could assist to a reasonable extent. |
In my test with Single monitor on changing the OS zoom, the SWT.ZoomChanged event is not consistent. |
There are multiple areas which are required to be addressed here, listing them what I recall:
I have put some starting pointer on few of the issues for someone to start with. Thanks @SyntevoAlex for offering to help here and I will also pitch in as needed. |
Contributes to eclipse-platform#62 and eclipse-platform#127
… containing control Contributes to eclipse-platform#62 and eclipse-platform#127
This contribution adds the base logics to support the dynamical adaption on SWT applications on DPI related zoom changes in the win32 implementation. It consists of: - adds "swt.autoScale.updateOnRuntime"-flag to enable updating the widgets on runtime on DPI zoom changes - Component to register callbacks on DPI changes. Each callback should be responsible for the attributes of its class Contributes to eclipse-platform#62 and eclipse-platform#127
Contributes to eclipse-platform#62 and eclipse-platform#127
… containing control Contributes to eclipse-platform#62 and eclipse-platform#127
This contribution adds the base logics to support the dynamical adaption on SWT applications on DPI related zoom changes in the win32 implementation. It consists of: - adds "swt.autoScale.updateOnRuntime"-flag to enable updating the widgets on runtime on DPI zoom changes - Component to register callbacks on DPI changes. Each callback should be responsible for the attributes of its class Contributes to eclipse-platform#62 and eclipse-platform#127
Contributes to eclipse-platform#62 and eclipse-platform#127
… containing control Contributes to eclipse-platform#62 and eclipse-platform#127
This contribution adds the base logics to support the dynamical adaption on SWT applications on DPI related zoom changes in the win32 implementation. It consists of: - adds "swt.autoScale.updateOnRuntime"-flag to enable updating the widgets on runtime on DPI zoom changes - Component to register callbacks on DPI changes. Each callback should be responsible for the attributes of its class Contributes to eclipse-platform#62 and eclipse-platform#127
This commit refactors usage of ImageDataProvider and ImageFilenameProvider to make the code more readable. contributes to eclipse-platform#62 and eclipse-platform#127
This commit refactors usage of ImageDataProvider and ImageFilenameProvider to make the code more readable. contributes to eclipse-platform#62 and eclipse-platform#127
This contribution encapsulates the metadata of the image in an innerclass ImageHandle which is used to create a hashmap of zoom level to imageHandle object inside an image object, making it straight forward to obtain any metadata information from an image for a zoom level. contributes to eclipse-platform#62 and eclipse-platform#127
This contribution encapsulates the metadata of the image in an innerclass ImageHandle which is used to create a hashmap of zoom level to imageHandle object inside an image object, making it straight forward to obtain any metadata information from an image for a zoom level. contributes to eclipse-platform#62 and eclipse-platform#127
This contribution encapsulates the metadata of the image in an innerclass ImageHandle which is used to create a hashmap of zoom level to imageHandle object inside an image object, making it straight forward to obtain any metadata information from an image for a zoom level. contributes to #62 and #127
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 Contributes to eclipse-platform#62 and eclipse-platform#131
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 Contributes to eclipse-platform#62 and eclipse-platform#131
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 Contributes to eclipse-platform#62 and eclipse-platform#131
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 Contributes to eclipse-platform#62 and eclipse-platform#131
This commit adds a listener for the ZoomChanged event to the canvas of a LineNumberRulerColumn. If the listener is notified of this event this means, that state, that differs over different zoom values, must be recalculated. Therefore the indentation are reset, when the event occurs. Contributes to eclipse-platform/eclipse.platform.swt#62 and eclipse-platform/eclipse.platform.swt#131
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 Contributes to eclipse-platform#62 and eclipse-platform#131
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 Contributes to eclipse-platform#62 and eclipse-platform#131
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 Contributes to eclipse-platform#62 and eclipse-platform#131
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 Contributes to eclipse-platform#62 and eclipse-platform#131
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
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
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 #62 and #131 Fixes eclipse-platform/eclipse.platform.ui#2595
This commit enforces device zoom to be used for scaling down the DPI values instead of the native zoom. contributes to eclipse-platform#62 and eclipse-platform#127
This contribution encapsulates the metadata of the image in an innerclass ImageHandle which is used to create a hashmap of zoom level to imageHandle object inside an image object, making it straight forward to obtain any metadata information from an image for a zoom level. contributes to eclipse-platform#62 and eclipse-platform#127
This commit refactors usage of ImageDataProvider and ImageFilenameProvider to make the code more readable. contributes to eclipse-platform#62 and eclipse-platform#127
This commit refactors usage of ImageDataProvider and ImageFilenameProvider to make the code more readable. contributes to eclipse-platform#62 and eclipse-platform#127
This contribution encapsulates the metadata of the image in an innerclass ImageHandle which is used to create a hashmap of zoom level to imageHandle object inside an image object, making it straight forward to obtain any metadata information from an image for a zoom level. contributes to eclipse-platform#62 and eclipse-platform#127
This commit refactors usage of ImageDataProvider and ImageFilenameProvider to make the code more readable. contributes to eclipse-platform#62 and eclipse-platform#127
This commit adds a check for imageMetadata for handle in case, there already exists an entry in the zoomLeveltoImageHandle map for a zoom level and it must throw an exception in that case. contributes to eclipse-platform#62 and eclipse-platform#127
This commit adds a check for imageMetadata for handle in case, there already exists an entry in the zoomLeveltoImageHandle map for a zoom level and it must throw an exception in that case. contributes to eclipse-platform#62 and eclipse-platform#127
When using the swts Display class it has different methods which take care about the zoom. The Display class should not have the zooms, only the devices should have the zoom. When you call the getMonitor method of the display class, the zoom to the devices is set to the ones of the primary monitor on windows versions above 8.1:
As you see this can not happen since the else case can not be reached on windows 8.1. And even if the dpi is used you do not get the results which are helping. When you have dpi unaware, the dpi is always 96 pixels, if you have dpi aware application mode than you get the one from the primary monitor and if you have the per monitor (v2) you get the correct dpi. But the last mode can not be used since the dpi awareness only works on the main window and its direct child. The other controls like tabs and so on are not taking part in the per monitor awareness.
The text was updated successfully, but these errors were encountered: