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

Dynamically adapt SWT on 'SWT.ZoomChanged' event on single monitor. #127

Open
niraj-modi opened this issue May 11, 2022 · 0 comments
Open
Labels
Windows Happens on Windows OS

Comments

@niraj-modi
Copy link
Member

This bug is to adapt SWT/Eclipse dynamic to changing OS zoom values:
It will require adapting all the SWT widgets to work on the new zoom value.

Note: This is a big ticket item and it will require lot of changes in SWT, here the branch where i could partially achieve this:
https://git.eclipse.org/c/platform/eclipse.platform.swt.git/?h=nmodi%2FDynamicDPI_4909

Since this was partially working then and hence we opted to restart Eclipse on 'SWT.ZoomChanged' event:
https://www.eclipse.org/eclipse/news/4.9/platform.php#zoom-changed

@niraj-modi niraj-modi added the Windows Happens on Windows OS label May 11, 2022
akoch-yatta added a commit to akoch-yatta/eclipse.platform.swt that referenced this issue Mar 28, 2024
akoch-yatta added a commit to akoch-yatta/eclipse.platform.swt that referenced this issue Mar 28, 2024
akoch-yatta added a commit to akoch-yatta/eclipse.platform.swt that referenced this issue Mar 28, 2024
akoch-yatta added a commit to akoch-yatta/eclipse.platform.swt that referenced this issue Mar 28, 2024
akoch-yatta added a commit to akoch-yatta/eclipse.platform.swt that referenced this issue Mar 29, 2024
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
akoch-yatta added a commit to akoch-yatta/eclipse.platform.swt that referenced this issue Mar 29, 2024
akoch-yatta added a commit to akoch-yatta/eclipse.platform.swt that referenced this issue Mar 29, 2024
akoch-yatta added a commit to akoch-yatta/eclipse.platform.swt that referenced this issue Mar 29, 2024
amartya4256 pushed a commit to amartya4256/eclipse.platform.swt that referenced this issue Apr 12, 2024
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
amartya4256 pushed a commit to amartya4256/eclipse.platform.swt that referenced this issue Apr 12, 2024
amartya4256 pushed a commit to amartya4256/eclipse.platform.swt that referenced this issue Apr 12, 2024
amartya4256 pushed a commit to amartya4256/eclipse.platform.swt that referenced this issue Apr 12, 2024
akoch-yatta added a commit to akoch-yatta/eclipse.platform.swt that referenced this issue Apr 12, 2024
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
akoch-yatta added a commit to akoch-yatta/eclipse.platform.swt that referenced this issue Apr 12, 2024
akoch-yatta added a commit to akoch-yatta/eclipse.platform.swt that referenced this issue Apr 12, 2024
akoch-yatta added a commit to akoch-yatta/eclipse.platform.swt that referenced this issue Apr 12, 2024
akoch-yatta added a commit to akoch-yatta/eclipse.platform.swt that referenced this issue Apr 18, 2024
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
akoch-yatta added a commit to akoch-yatta/eclipse.platform.swt that referenced this issue Apr 18, 2024
This contribution extends the support for dynamical adaption on SWT applications on DPI related zoom changes in the win32 implementation by adding support to provider and cache scaled variants of Font. It consists of:
- internal font registries to enable reusage of scaled variants of fonts. If a font is disposed from external, it will be automatically recreated on demand. There are two registries:
- a default registry to mimic the existing behavior, that all fonts are scaled to the native zoom of the primary monitor
- a registry to create and manage scaled variants of fonts
The SWTFontProvider is configured based on the "swt.autoScale.updateOnRuntime"-flag to use one of the two font registries. The creation of system fonts is adapted to use the provider

Contributes to eclipse-platform#62
and eclipse-platform#127
akoch-yatta added a commit to akoch-yatta/eclipse.platform.swt that referenced this issue Apr 18, 2024
This contribution adds and registers a DPI change handler for all widgets in the org.eclipse.swt.widgets package of the win32 implementation. These handler will be registered only, when the "swt.autoScale.updateOnRuntime"-flag is set to true. If a DPI change is detected they will be called accordingly.

Contributes to eclipse-platform#62
and eclipse-platform#127
akoch-yatta added a commit to akoch-yatta/eclipse.platform.swt that referenced this issue Apr 18, 2024
This contribution replaces calls to Image::getBoundsInPixels in the widgets in the win32 implementation with calls to consider the actual zoom of the affected widget.

Contributes to eclipse-platform#62
and eclipse-platform#127
akoch-yatta added a commit to akoch-yatta/eclipse.platform.swt that referenced this issue Apr 19, 2024
This contribution extends the support for dynamical adaption on SWT applications on DPI related zoom changes in the win32 implementation by adding support to provider and cache scaled variants of Font. It consists of:
- internal font registries to enable reusage of scaled variants of fonts. If a font is disposed from external, it will be automatically recreated on demand. There are two registries:
- a default registry to mimic the existing behavior, that all fonts are scaled to the native zoom of the primary monitor
- a registry to create and manage scaled variants of fonts
The SWTFontProvider is configured based on the "swt.autoScale.updateOnRuntime"-flag to use one of the two font registries. The creation of system fonts is adapted to use the provider

Contributes to eclipse-platform#62
and eclipse-platform#127
akoch-yatta added a commit to akoch-yatta/eclipse.platform.swt that referenced this issue Apr 19, 2024
This contribution adds and registers a DPI change handler for all widgets in the org.eclipse.swt.widgets package of the win32 implementation. These handler will be registered only, when the "swt.autoScale.updateOnRuntime"-flag is set to true. If a DPI change is detected they will be called accordingly.

Contributes to eclipse-platform#62
and eclipse-platform#127
akoch-yatta added a commit to akoch-yatta/eclipse.platform.swt that referenced this issue Apr 19, 2024
This contribution replaces calls to Image::getBoundsInPixels in the widgets in the win32 implementation with calls to consider the actual zoom of the affected widget.

Contributes to eclipse-platform#62
and eclipse-platform#127
akoch-yatta added a commit to akoch-yatta/eclipse.platform.swt that referenced this issue Apr 19, 2024
This contribution extends the support for dynamical adaption on SWT applications on DPI related zoom changes in the win32 implementation by adding support to provider and cache scaled variants of Font. It consists of:
- internal font registries to enable reusage of scaled variants of fonts. If a font is disposed from external, it will be automatically recreated on demand. There are two registries:
- a default registry to mimic the existing behavior, that all fonts are scaled to the native zoom of the primary monitor
- a registry to create and manage scaled variants of fonts
The SWTFontProvider is configured based on the "swt.autoScale.updateOnRuntime"-flag to use one of the two font registries. The creation of system fonts is adapted to use the provider

Contributes to eclipse-platform#62
and eclipse-platform#127
akoch-yatta added a commit to akoch-yatta/eclipse.platform.swt that referenced this issue Apr 19, 2024
This contribution adds and registers a DPI change handler for all widgets in the org.eclipse.swt.widgets package of the win32 implementation. These handler will be registered only, when the "swt.autoScale.updateOnRuntime"-flag is set to true. If a DPI change is detected they will be called accordingly.

Contributes to eclipse-platform#62
and eclipse-platform#127
akoch-yatta added a commit to akoch-yatta/eclipse.platform.swt that referenced this issue Apr 19, 2024
This contribution replaces calls to Image::getBoundsInPixels in the widgets in the win32 implementation with calls to consider the actual zoom of the affected widget.

Contributes to eclipse-platform#62
and eclipse-platform#127
akoch-yatta added a commit to akoch-yatta/eclipse.platform.swt that referenced this issue Apr 23, 2024
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
akoch-yatta added a commit to akoch-yatta/eclipse.platform.swt that referenced this issue Apr 23, 2024
This contribution extends the support for dynamical adaption on SWT applications on DPI related zoom changes in the win32 implementation by adding support to provider and cache scaled variants of Font. It consists of:
- internal font registries to enable reusage of scaled variants of fonts. If a font is disposed from external, it will be automatically recreated on demand. There are two registries:
- a default registry to mimic the existing behavior, that all fonts are scaled to the native zoom of the primary monitor
- a registry to create and manage scaled variants of fonts
The SWTFontProvider is configured based on the "swt.autoScale.updateOnRuntime"-flag to use one of the two font registries. The creation of system fonts is adapted to use the provider

Contributes to eclipse-platform#62
and eclipse-platform#127
amartya4256 added a commit to amartya4256/eclipse.platform.swt that referenced this issue Jan 13, 2025
This commit refactors the Display to separate single zoom and multi zoom
coordinate system mappers in separate classes. Additionally, it adds
some tests for validating the multi zoom coordinate system mapper. A few
tests are disabled because of the current state of multi zoom coordinate
system limitations.

contributes to eclipse-platform#62 and eclipse-platform#127
amartya4256 added a commit to amartya4256/eclipse.platform.swt that referenced this issue Jan 13, 2025
This commit refactors the Display to separate single zoom and multi zoom
coordinate system mappers in separate classes. Additionally, it adds
some tests for validating the multi zoom coordinate system mapper. A few
tests are disabled because of the current state of multi zoom coordinate
system limitations.

contributes to eclipse-platform#62 and eclipse-platform#127
HeikoKlare pushed a commit to amartya4256/eclipse.platform.swt that referenced this issue Jan 13, 2025
This contribution helps retrieve the imageData for the
requested zoom by searching for the zoom in the zoomToHandleMap
followed by (if not available) scaling the handle at the zoom nearest to
it while getting rid of only searching among the autoscaled zoom values.

Contributes to eclipse-platform#62 and eclipse-platform#127
HeikoKlare pushed a commit that referenced this issue Jan 13, 2025
This contribution helps retrieve the imageData for the
requested zoom by searching for the zoom in the zoomToHandleMap
followed by (if not available) scaling the handle at the zoom nearest to
it while getting rid of only searching among the autoscaled zoom values.

Contributes to #62 and #127
HeikoKlare pushed a commit to amartya4256/eclipse.platform.swt that referenced this issue Jan 13, 2025
This contribution reimplements the logic for scaling the Program Icons
while getting rid of the DPIUtil::getDeviceZoom usage and enhancing the image
quality of icons on scaling up.

contributes to eclipse-platform#62 and eclipse-platform#127
amartya4256 added a commit to amartya4256/eclipse.platform.swt that referenced this issue Jan 14, 2025
This commit refactors the Display to separate single zoom and multi zoom
coordinate system mappers in separate classes. Additionally, it adds
some tests for validating the multi zoom coordinate system mapper. A few
tests are disabled because of the current state of multi zoom coordinate
system limitations.

contributes to eclipse-platform#62 and eclipse-platform#127
amartya4256 added a commit to amartya4256/eclipse.platform.swt that referenced this issue Jan 14, 2025
This commit refactors the Display to separate single zoom and multi zoom
coordinate system mappers in separate classes. Additionally, it adds
some tests for validating the multi zoom coordinate system mapper. A few
tests are disabled because of the current state of multi zoom coordinate
system limitations.

contributes to eclipse-platform#62 and eclipse-platform#127
amartya4256 added a commit to amartya4256/eclipse.platform.swt that referenced this issue Jan 14, 2025
This commit refactors the Display to separate single zoom and multi zoom
coordinate system mappers in separate classes. Additionally, it adds
some tests for validating the multi zoom coordinate system mapper. A few
tests are disabled because of the current state of multi zoom coordinate
system limitations.

contributes to eclipse-platform#62 and eclipse-platform#127
HeikoKlare pushed a commit to amartya4256/eclipse.platform.swt that referenced this issue Jan 14, 2025
This commit refactors the Display to separate single zoom and multi zoom
coordinate system mappers in separate classes. Additionally, it adds
some tests for validating the multi-zoom coordinate system mapper. A few
tests are disabled because of the current state of multi-zoom coordinate
system limitations.

Contributes to eclipse-platform#62 and eclipse-platform#127
HeikoKlare pushed a commit that referenced this issue Jan 14, 2025
This commit refactors the Display to separate single zoom and multi zoom
coordinate system mappers in separate classes. Additionally, it adds
some tests for validating the multi-zoom coordinate system mapper. A few
tests are disabled because of the current state of multi-zoom coordinate
system limitations.

Contributes to #62 and #127
HeikoKlare pushed a commit to amartya4256/eclipse.platform.swt that referenced this issue Jan 15, 2025
This contribution reimplements the logic for scaling the Program Icons
while getting rid of the DPIUtil::getDeviceZoom usage and enhancing the image
quality of icons on scaling up.

contributes to eclipse-platform#62 and eclipse-platform#127
HeikoKlare pushed a commit to amartya4256/eclipse.platform.swt that referenced this issue Jan 15, 2025
This contribution reimplements the logic for scaling the Program Icons
while getting rid of the DPIUtil::getDeviceZoom usage and enhancing the image
quality of icons on scaling up.

contributes to eclipse-platform#62 and eclipse-platform#127
HeikoKlare pushed a commit that referenced this issue Jan 15, 2025
This contribution reimplements the logic for scaling the Program Icons
while getting rid of the DPIUtil::getDeviceZoom usage and enhancing the image
quality of icons on scaling up.

contributes to #62 and #127
amartya4256 added a commit to amartya4256/eclipse.platform.swt that referenced this issue Jan 16, 2025
This commit contributes to the correct scaling of the Shell using its
own zoom on Shell::setBounds call as the scaling of the shell in case of a monitor
change is directly handled by the DPI_CHANGED event.

contributes to eclipse-platform#62 and eclipse-platform#127
amartya4256 added a commit to amartya4256/eclipse.platform.swt that referenced this issue Jan 17, 2025
This commit contributes to the use of MonitorAware points and rectangles in the multi zoom
coordinate system mapper for translation between points and pixels.

contributes to eclipse-platform#62 and eclipse-platform#127
amartya4256 added a commit to amartya4256/eclipse.platform.swt that referenced this issue Jan 17, 2025
This commit contributes to the use of MonitorAware points and rectangles in the multi zoom
coordinate system mapper for translation between points and pixels.

contributes to eclipse-platform#62 and eclipse-platform#127
amartya4256 added a commit to amartya4256/eclipse.platform.swt that referenced this issue Jan 17, 2025
This commit contributes to the correct scaling of the Shell using its
own zoom on Shell::setBounds call as the scaling of the shell in case of a monitor
change is directly handled by the DPI_CHANGED event.

contributes to eclipse-platform#62 and eclipse-platform#127
amartya4256 added a commit to amartya4256/eclipse.platform.swt that referenced this issue Jan 17, 2025
This commit contributes to the correct scaling of the Shell using its
own zoom on Shell::setBounds call as the scaling of the shell in case of a monitor
change is directly handled by the DPI_CHANGED event.

contributes to eclipse-platform#62 and eclipse-platform#127
amartya4256 added a commit to amartya4256/eclipse.platform.swt that referenced this issue Jan 17, 2025
This commit contributes to the use of MonitorAware points and rectangles in the multi zoom
coordinate system mapper for translation between points and pixels.

contributes to eclipse-platform#62 and eclipse-platform#127
amartya4256 added a commit to amartya4256/eclipse.platform.swt that referenced this issue Jan 17, 2025
This commit contributes to the use of MonitorAware points and rectangles in the multi zoom
coordinate system mapper for translation between points and pixels.

contributes to eclipse-platform#62 and eclipse-platform#127
fedejeanne pushed a commit to amartya4256/eclipse.platform.swt that referenced this issue Jan 20, 2025
This commit contributes to the use of MonitorAware points and rectangles in the multi zoom
coordinate system mapper for translation between points and pixels.

contributes to eclipse-platform#62 and eclipse-platform#127
fedejeanne pushed a commit to amartya4256/eclipse.platform.swt that referenced this issue Jan 20, 2025
This commit contributes to the use of MonitorAware points and rectangles
in the multi zoom
coordinate system mapper for translation between points and pixels.

contributes to eclipse-platform#62 and eclipse-platform#127
amartya4256 added a commit to amartya4256/eclipse.platform.swt that referenced this issue Jan 20, 2025
This commit contributes to the use of MonitorAware Points and
Rectangles for the translation between points and pixels coordinates in
the Display Coordinate System. Since the Display Coordinate System can
have different scales (zoom) in different area, it is designed to be not
continuous in the points coordinates. Hence when we manipulate the
coordinates of a Point or a Rectangle object, it might end up in a
region which is between the 2 monitors in the point coordibate system,
which we consider a gap. So, we need the context of the monitor on which
those points and rectangles were created in the first place to evaluate
the scaling factor. If the context is not available or the coordinates
were updated to an irrelevant value, a fallback method tries to evaluate
the right monitor for the coordinates and evaluates the scaled value
with that.

contributes to eclipse-platform#62 and eclipse-platform#127
HeikoKlare pushed a commit to amartya4256/eclipse.platform.swt that referenced this issue Jan 20, 2025
This commit contributes to the use of MonitorAware Points and
Rectangles for the translation between points and pixels coordinates in
the Display Coordinate System. Since the Display Coordinate System can
have different scales (zoom) in different area, it is designed to be not
continuous in the points coordinates. Hence when we manipulate the
coordinates of a Point or a Rectangle object, it might end up in a
region which is between the 2 monitors in the point coordibate system,
which we consider a gap. So, we need the context of the monitor on which
those points and rectangles were created in the first place to evaluate
the scaling factor. If the context is not available or the coordinates
were updated to an irrelevant value, a fallback method tries to evaluate
the right monitor for the coordinates and evaluates the scaled value
with that.

contributes to eclipse-platform#62 and eclipse-platform#127
HeikoKlare pushed a commit to amartya4256/eclipse.platform.swt that referenced this issue Jan 20, 2025
This commit contributes to the use of monitor-aware Points and
Rectangles for the translation between points and pixels coordinates in
the Display Coordinate System. Since the Display Coordinate System can
have different scales (zoom) in different monitors, it is designed to be
not continuous in the points coordinates. Hence when we manipulate the
coordinates of a Point or a Rectangle object, it might end up in a
region which is between two monitors in the point coordinate system,
which we consider a gap. So, we need the context of the monitor on which
those points and rectangles were created in the first place to evaluate
the scaling factor. If the context is not available or the coordinates
were updated to an irrelevant value, a fallback method tries to evaluate
the right monitor for the coordinates and evaluates the scaled value
with that.

Contributes to eclipse-platform#62 and eclipse-platform#127
HeikoKlare pushed a commit to amartya4256/eclipse.platform.swt that referenced this issue Jan 20, 2025
This commit contributes to the use of monitor-aware Points and
Rectangles for the translation between points and pixels coordinates in
the Display Coordinate System. Since the Display Coordinate System can
have different scales (zoom) in different monitors, it is designed to be
not continuous in the points coordinates. Hence when we manipulate the
coordinates of a Point or a Rectangle object, it might end up in a
region which is between two monitors in the point coordinate system,
which we consider a gap. So, we need the context of the monitor on which
those points and rectangles were created in the first place to evaluate
the scaling factor. If the context is not available or the coordinates
were updated to an irrelevant value, a fallback method tries to evaluate
the right monitor for the coordinates and evaluates the scaled value
with that.

Contributes to eclipse-platform#62 and eclipse-platform#127
HeikoKlare pushed a commit to amartya4256/eclipse.platform.swt that referenced this issue Jan 20, 2025
This commit contributes to the use of monitor-aware Points and
Rectangles for the translation between points and pixels coordinates in
the Display Coordinate System. Since the Display Coordinate System can
have different scales (zoom) in different monitors, it is designed to be
not continuous in the points coordinates. Hence when we manipulate the
coordinates of a Point or a Rectangle object, it might end up in a
region which is between two monitors in the point coordinate system,
which we consider a gap. So, we need the context of the monitor on which
those points and rectangles were created in the first place to evaluate
the scaling factor. If the context is not available or the coordinates
were updated to an irrelevant value, a fallback method tries to evaluate
the right monitor for the coordinates and evaluates the scaled value
with that.

Contributes to eclipse-platform#62 and eclipse-platform#127
HeikoKlare pushed a commit that referenced this issue Jan 20, 2025
This commit contributes to the use of monitor-aware Points and
Rectangles for the translation between points and pixels coordinates in
the Display Coordinate System. Since the Display Coordinate System can
have different scales (zoom) in different monitors, it is designed to be
not continuous in the points coordinates. Hence when we manipulate the
coordinates of a Point or a Rectangle object, it might end up in a
region which is between two monitors in the point coordinate system,
which we consider a gap. So, we need the context of the monitor on which
those points and rectangles were created in the first place to evaluate
the scaling factor. If the context is not available or the coordinates
were updated to an irrelevant value, a fallback method tries to evaluate
the right monitor for the coordinates and evaluates the scaled value
with that.

Contributes to #62 and #127
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Windows Happens on Windows OS
Projects
None yet
Development

No branches or pull requests

1 participant