Do not leave the tab folder GC in advanced graphics mode - #3529
Merged
vogella merged 1 commit intoAug 18, 2026
Merged
Conversation
CTabFolderRenderer.drawDirtyIndicator() uses alpha and anti-aliasing, which switch the GC to GDI+ on Windows and are not undone by restoring alpha and anti-aliasing. All tabs share one GC and the selected tab is painted last, so tabs painted after a dirty indicator were measured with GDI+ text metrics and their text was elided, and on the double-buffered paint they lost their clipping because getClipping(Region) no longer round-trips. Leave the advanced mode again after drawing the indicator and restore the clipping, which setAdvanced(false) resets. This is a no-op on GTK and macOS. Adds a regression test and a manual test. Repainting also gets faster, as only the indicator is drawn in GDI+ instead of every tab after it: about 20% on a folder with 20 dirty tabs. Fixes eclipse-platform#3522
Contributor
Author
|
@HeikoKlare please test your example. I think RC1 freeze starts tomorrow at least that was what i saw in the email so the freeze check might to eager. |
Contributor
Author
|
@Phillipus please also test it in your RCP app. |
Contributor
Contributor
@vogella Confirmed that this PR fixes it. Thanks! |
vogella
force-pushed
the
issue-3522-dirty-indicator-advanced-gc
branch
from
August 18, 2026 10:09
99824ca to
f26c78a
Compare
HeikoKlare
approved these changes
Aug 18, 2026
HeikoKlare
left a comment
Contributor
There was a problem hiding this comment.
Thank you for the quick fix. It solves the issue for me as well.
The change looks like a good, local workaround for the underlying issue in the GC implementation that we can still bring into the upcoming release.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #3522
CTabFolderRenderer.drawDirtyIndicator()uses alpha and anti-aliasing, which switch the GC to GDI+ on Windows and are not undone by restoring alpha and anti-aliasing. All tabs share one GC and the selected tab is painted last, so tabs painted after a dirty indicator were measured with GDI+ text metrics and their text was elided, and on the double-buffered paint they lost their clipping becausegetClipping(Region)no longer round-trips. That is the jumping text of this issue and the vanishing tab @Phillipus reported in it.The fix leaves the advanced mode again after drawing the indicator and restores the clipping, which
setAdvanced(false)resets. It is a no-op on GTK and macOS, where the GC is always advanced.Verified on Windows 11 at 150% and emulated 100% zoom: both symptoms reproduce on master and are gone with the change, the tab strip is then pixel identical for every repaint geometry, and repainting is about 20% faster on a folder with 20 dirty tabs. The new regression test fails without the change and passes with it.
Test_org_eclipse_swt_custom_CTabFoldershows the same 3 failures as clean master at 150% zoom.