Fix HiDPI progress icon clipping by relayouting only on image size change #3567
+11
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
On Windows HiDPI screens, the progress icon in the status bar could appear clipped because Toolbars are initially created by windows with default button size (24×22). When larger images are set (e.g., 32×32 for 200% scaling), the toolbar resizes but the parent layout isn't updated due to deferred layout.
This change replaces the deffered layout with a normal layout and adds a check to determine if the image size actually changed before requesting a relayout. The parent layout is now updated only when necessary, matching SWT's behavior for toolbar images and preventing unnecessary layouts while fixing the clipping issue. More information eclipse-platform/eclipse.platform.swt#706 (comment)
Steps to reproduce:
1)Set the monitors’ zoom to 200%. If using two monitors, make sure both have the same zoom just so that no DPI change occurs during startup.
2)Open a runtime workspace.
3)In the runtime workspace, create a plugin project and run it as an Eclipse application. This will start the progress bar, which is visible only briefly for a second.
4)Once the Eclipse application launches, try to relaunch it with the same workspace. You’ll see an error saying the workspace is already in use by another application.
5)While this dialog is visible, the progress bar remains visible, and here you can observe the clipped/cut-off icon.
Without this change, the progress bar does not relayout correctly on HiDPI screens, causing icon to be partially hidden.
Before

After
Fixes eclipse-platform/eclipse.platform.swt#706