-
Notifications
You must be signed in to change notification settings - Fork 187
[macOS] Initialize image data from ImageGcDrawer only at device zoom #2236
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
[macOS] Initialize image data from ImageGcDrawer only at device zoom #2236
Conversation
93a92f9 to
82b8b3c
Compare
82b8b3c to
2c11ef7
Compare
An Image based on an ImageGcDrawer currently initializes two image representations for 100% and 200% zoom, so that an appropriate representation for each of the two zoom levels can be retrieved. This, however, leads to issues when creating a GC on an Image created in that way, as only one of the two representations (the one fitting to the current device zoom) will be modified by the GC. If later the representation with the other zoom is used, it will not contain the changes performed by the GC. One such scenario is starting an application at a monitor with one zoom (used as the device zoom throughout the application lifecycle then) and moving the shell to a monitor with a different zoom. An image will then be modified only for the zoom of the first monitor, thus if using it inside a control, it will yield the unmodified version on the second monitor. To avoid this issue, this change ensures that an Image based on an ImageGcDrawer is only initialized for the device zoom. Fixes eclipse-platform/eclipse.platform.ui#3039
2c11ef7 to
a374977
Compare
|
@akoch-yatta can you please review the fix? @BeckerWdf may I ask you as a frequent Mac user (if I am not mistaken) to test if this solves eclipse-platform/eclipse.platform.ui#3039? |
Sure I can try do test this myself. So what are the exact step to reproduce? |
|
Thank you, @BeckerWdf!
Prerequisite: 2 monitors with different zooms (e.g., MacBook with 200% (Retina) display and external monitor at 100%). Then do the following:
Without the fix you should see that the scrollbar is stuck (it always shows the same initial line numbers like in the video here: eclipse-platform/eclipse.platform.ui#3039 (comment)). With the fix you should see that the scrollbar works properly. |
|
Stupid question: How do I set the zoom to 100 / 200 on macOS? |
|
Ok i got it. |
|
And the good news is: Your PR fixes the issue. |
|
Thank you for testing it! |

An Image based on an ImageGcDrawer currently initializes two image representations for 100% and 200% zoom, so that an appropriate representation for each of the two zoom levels can be retrieved. This, however, leads to issues when creating a GC on an Image created in that way, as only one of the two representations (the one fitting to the current device zoom) will be modified by the GC. If later the representation with the other zoom is used, it will not contain the changes performed by the GC.
One such scenario is starting an application at a monitor with one zoom (used as the device zoom throughout the application lifecycle then) and moving the shell to a monitor with a different zoom. An image will then be modified only for the zoom of the first monitor, thus if using it inside a control, it will yield the unmodified version on the second monitor.
To avoid this issue, this change ensures that an Image based on an ImageGcDrawer is only initialized for the device zoom.
Fixes eclipse-platform/eclipse.platform.ui#3039