Skip to content

Do not leave the tab folder GC in advanced graphics mode - #3529

Merged
vogella merged 1 commit into
eclipse-platform:masterfrom
vogella:issue-3522-dirty-indicator-advanced-gc
Aug 18, 2026
Merged

Do not leave the tab folder GC in advanced graphics mode#3529
vogella merged 1 commit into
eclipse-platform:masterfrom
vogella:issue-3522-dirty-indicator-advanced-gc

Conversation

@vogella

@vogella vogella commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

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 because getClipping(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_CTabFolder shows the same 3 failures as clean master at 150% zoom.

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
@vogella
vogella requested a review from HeikoKlare August 18, 2026 09:41
@vogella

vogella commented Aug 18, 2026

Copy link
Copy Markdown
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.

@vogella

vogella commented Aug 18, 2026

Copy link
Copy Markdown
Contributor Author

@Phillipus please also test it in your RCP app.

@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Test Results

  212 files  ±0    212 suites  ±0   24m 53s ⏱️ - 2m 1s
4 898 tests +1  4 874 ✅ +1   24 💤 ±0  0 ❌ ±0 
7 074 runs  +6  6 906 ✅ +6  168 💤 ±0  0 ❌ ±0 

Results for commit f26c78a. ± Comparison against base commit 83e249e.

♻️ This comment has been updated with latest results.

@Phillipus

Copy link
Copy Markdown
Contributor

@Phillipus please also test it in your RCP app.

@vogella Confirmed that this PR fixes it. Thanks!

@vogella
vogella force-pushed the issue-3522-dirty-indicator-advanced-gc branch from 99824ca to f26c78a Compare August 18, 2026 10:09

@HeikoKlare HeikoKlare left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@vogella
vogella merged commit 3db6f5d into eclipse-platform:master Aug 18, 2026
23 of 24 checks passed
@vogella
vogella deleted the issue-3522-dirty-indicator-advanced-gc branch August 18, 2026 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dirty indicator leads to jumping tab header text

3 participants