Conversation
Contributor
Author
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Reused column model slots retain stale surfaces, causing removed images to reappear.
Review effort: Balanced
Findings: 2
Open (2)
What changed in this PR
Uses scale-aware Cairo surfaces to render crisp Tree/Table images on GTK3 HiDPI displays.
Changes:
- Binds GTK3 cell renderers to stored image surfaces.
- Registers pixbuf data callbacks for all Tree/Table renderers.
- Adds the GTK
surfaceproperty constant.
| File | Description |
|---|---|
Tree.java |
Renders Tree images from Cairo surfaces. |
Table.java |
Renders Table images from Cairo surfaces. |
OS.java |
Defines the native surface property name. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
vogella
force-pushed
the
gtk-tree-cell-surface
branch
from
September 29, 2026 11:46
4734b80 to
ea39ed9
Compare
Contributor
vogella
force-pushed
the
gtk-tree-cell-surface
branch
from
September 29, 2026 14:41
ea39ed9 to
cfece1f
Compare
Member
|
There are all the details to handle here but it also fixes a nasty drawing problem: with GDK_SCALE=2 draws a solid gray instead of striped. |
vogella
force-pushed
the
gtk-tree-cell-surface
branch
from
September 30, 2026 04:02
cfece1f to
ab288e4
Compare
vogella
force-pushed
the
gtk-tree-cell-surface
branch
2 times, most recently
from
September 30, 2026 04:34
98c9281 to
010e9df
Compare
vogella
force-pushed
the
gtk-tree-cell-surface
branch
2 times, most recently
from
September 30, 2026 16:17
0ee8728 to
371ae10
Compare
GtkCellRendererPixbuf treats the "pixbuf" attribute as a scale 1 image, so at 200% zoom native Tree and Table cell images were reduced to 1x and upscaled again, while the same image drawn with GC.drawImage stayed sharp. The cell data function now feeds the renderer the cairo surface already stored in CELL_SURFACE, which carries the device scale. Disposing a column now also clears its CELL_SURFACE slot, so a column that later reuses the slot neither renders nor returns the old image. The surface is only used at a device scale above 1 on an enabled control, because it bypasses GTK's icon effects such as dimming when disabled. Elsewhere the pixbuf path including the SWT.SetData refresh is unchanged. Surface backed cells report no accessible image size, since GTK reads that from the pixbuf only. CELL_SURFACE now holds a reference through the cairo surface boxed type, so a surface stays valid while a row shows it even after its image was disposed, and its address cannot be reused by another image. Assisted-by: multiple AI agents and layers of automated tooling 🤖
Contributor
Author
|
Fixed |
vogella
force-pushed
the
gtk-tree-cell-surface
branch
from
October 2, 2026 04:22
371ae10 to
74ebb77
Compare
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.





On GTK3 at 200% zoom, images set with TreeItem.setImage or TableItem.setImage were rendered blurry, because GtkCellRendererPixbuf treats the bound pixbuf as a scale 1 image and reduces it to 1x before scaling it up again. Views that paint their images in a PaintItem listener, such as JFace StyledCellLabelProvider based ones, were unaffected, so plain label provider trees like the Mylyn Task List looked noticeably softer than their neighbours. The cell data function now hands the pixbuf renderer the cairo surface already kept in CELL_SURFACE, which carries the device scale, so native cell images are as sharp as GC.drawImage output. Rendering at 100% and on GTK4 is unchanged.