Skip to content

Conversation

@akoch-yatta
Copy link
Contributor

This PR replaces most calls to Font#handle to use the SWTFontProvider instead. This assures the most Font reusage possible.

@akoch-yatta akoch-yatta linked an issue Apr 25, 2025 that may be closed by this pull request
@github-actions
Copy link
Contributor

github-actions bot commented Apr 25, 2025

Test Results

   539 files   -  6     539 suites   - 6   29m 30s ⏱️ + 3m 35s
 4 337 tests  - 37   4 320 ✅  - 36   15 💤  - 3  2 ❌ +2 
16 601 runs   - 37  16 462 ✅  - 36  137 💤  - 3  2 ❌ +2 

For more details on these failures, see this check.

Results for commit 35c3b17. ± Comparison against base commit 807b159.

This pull request removes 37 tests.
AllWin32Tests org.eclipse.swt.graphics.ImageWin32Tests ‑ testImageDataForDifferentFractionalZoomsShouldBeDifferent
AllWin32Tests org.eclipse.swt.graphics.ImageWin32Tests ‑ testImageShouldHaveDimesionAsPerZoomLevel
AllWin32Tests org.eclipse.swt.tests.win32.Test_org_eclipse_swt_dnd_DND ‑ testByteArrayTransfer
AllWin32Tests org.eclipse.swt.tests.win32.Test_org_eclipse_swt_dnd_DND ‑ testFileTransfer
AllWin32Tests org.eclipse.swt.tests.win32.Test_org_eclipse_swt_dnd_DND ‑ testHtmlTransfer
AllWin32Tests org.eclipse.swt.tests.win32.Test_org_eclipse_swt_dnd_DND ‑ testImageTransfer_fromCopiedImage
AllWin32Tests org.eclipse.swt.tests.win32.Test_org_eclipse_swt_dnd_DND ‑ testImageTransfer_fromImage
AllWin32Tests org.eclipse.swt.tests.win32.Test_org_eclipse_swt_dnd_DND ‑ testImageTransfer_fromImageData
AllWin32Tests org.eclipse.swt.tests.win32.Test_org_eclipse_swt_dnd_DND ‑ testImageTransfer_fromImageDataFromImage
AllWin32Tests org.eclipse.swt.tests.win32.Test_org_eclipse_swt_dnd_DND ‑ testRtfTransfer
…

♻️ This comment has been updated with latest results.

@akoch-yatta akoch-yatta marked this pull request as draft April 25, 2025 08:11
@akoch-yatta akoch-yatta force-pushed the font-handle-via-fontprovider branch from 3737757 to fb0f2ec Compare April 25, 2025 08:19
@akoch-yatta akoch-yatta marked this pull request as ready for review April 25, 2025 08:34
Copy link
Member

@fedejeanne fedejeanne left a comment

Choose a reason for hiding this comment

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

The changes look good, just minor comments

@akoch-yatta akoch-yatta force-pushed the font-handle-via-fontprovider branch from fb0f2ec to 55af4cd Compare April 25, 2025 12:39
This commit replaces several calls to Font#handle to use the
SWTFontProvider instead. This assures the most Font reusage possible.
@fedejeanne fedejeanne force-pushed the font-handle-via-fontprovider branch from 55af4cd to 35c3b17 Compare April 25, 2025 12:40
Copy link
Member

@fedejeanne fedejeanne left a comment

Choose a reason for hiding this comment

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

@akoch-yatta I took the liberty of doing the changes myself. Approved ✔️

@fedejeanne
Copy link
Member

Version increment check is failing for infrastructure reasons and no further version bump is required here.

Test failures are unrelated: #1843 , #2063

@fedejeanne fedejeanne merged commit ddd1862 into eclipse-platform:master Apr 25, 2025
7 of 10 checks passed
@fedejeanne fedejeanne deleted the font-handle-via-fontprovider branch April 25, 2025 12:59
arunjose696 added a commit to vi-eclipse/eclipse.platform.swt that referenced this pull request Jul 31, 2025
Prior to PR eclipse-platform#2062, the hFont variable in Caret::setIMEFont was
retrieved directly from the font object (using font.handle). Since eclipse-platform#2602, hFont is
fetched via SWTFontProvider, which throws an exception if the font is disposed.

Previously, when the font was disposed, hFont (font.handle) would be zero, and the
method would fall back to using defaultFont for setting the IME font.
After eclipse-platform#2602, this fallback no longer works because the exception is
thrown before the fallback can occur.

This commit restores the intended behavior by setting hfont as zero if
the font is disposed, preventing the exception.

Fixes eclipse-platform#2323
arunjose696 added a commit to vi-eclipse/eclipse.platform.swt that referenced this pull request Jul 31, 2025
Prior to PR eclipse-platform#2062, the hFont variable in Caret::setIMEFont was
retrieved directly from the font object (using font.handle). Since eclipse-platform#2602, hFont is
fetched via SWTFontProvider, which throws an exception if the font is disposed.

Previously, when the font was disposed, hFont (font.handle) would be zero, and the
method would fall back to using defaultFont for setting the IME font.
After eclipse-platform#2602, this fallback no longer works because the exception is
thrown before the fallback can occur.

This commit restores the intended behavior by setting hfont as zero if
the font is disposed, preventing the exception.

Fixes eclipse-platform#2323
arunjose696 added a commit to vi-eclipse/eclipse.platform.swt that referenced this pull request Aug 1, 2025
Prior to PR eclipse-platform#2062, the hFont variable in Caret::setIMEFont was
retrieved directly from the font object (using font.handle). Since eclipse-platform#2602, hFont is
fetched via SWTFontProvider, which throws an exception if the font is disposed.

Previously, when the font was disposed, hFont (font.handle) would be zero, and the
method would fall back to using defaultFont for setting the IME font.
After eclipse-platform#2602, this fallback no longer works because the exception is
thrown before the fallback can occur.

This commit restores the intended behavior by setting hfont as zero if
the font is disposed, preventing the exception.

Fixes eclipse-platform#2323
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.

Get font handles via SWTFontProvider

2 participants