Skip to content

[Gtk4] Fix Button image size by using GtkPicture instead of GtkImage#3323

Merged
akurtakov merged 1 commit into
eclipse-platform:masterfrom
akurtakov:colorbutton
May 30, 2026
Merged

[Gtk4] Fix Button image size by using GtkPicture instead of GtkImage#3323
akurtakov merged 1 commit into
eclipse-platform:masterfrom
akurtakov:colorbutton

Conversation

@akurtakov
Copy link
Copy Markdown
Member

Gtk 4 works in logical points while Cairo works in pixel thus this is needed for proper size of the pixbuf scale to the original image size.

This makes Button consistent with Label, which already uses GtkPicture for the same reason (see commit
#2766 ).

Also fix a memory leak in Label where the GdkTexture created by gdk_texture_new_for_pixbuf() was not unreffed after being handed to gtk_picture_set_paintable().

@akurtakov
Copy link
Copy Markdown
Member Author

Before:
Screenshot From 2026-05-25 18-19-42
After:
Screenshot From 2026-05-25 18-20-32

@akurtakov akurtakov self-assigned this May 25, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 25, 2026

Test Results (linux)

   94 files  ±0     94 suites  ±0   14m 16s ⏱️ -19s
4 597 tests ±0  4 373 ✅ ±0  224 💤 ±0  0 ❌ ±0 
3 383 runs  ±0  3 308 ✅ ±0   75 💤 ±0  0 ❌ ±0 

Results for commit d563113. ± Comparison against base commit 1ac0cbf.

♻️ This comment has been updated with latest results.

akurtakov added a commit to akurtakov/eclipse.platform.swt that referenced this pull request May 26, 2026
GTK4 works in logical points while Cairo works in pixels, causing images
to appear smaller at HiDPI scaling. Using GtkPicture (instead of
GtkImage)
correctly maps the pixbuf to the right display size.

This is the same fix applied to Button
(eclipse-platform#3323 )
and Label
(eclipse-platform#2766
) for the same reason.
Copy link
Copy Markdown
Contributor

@jonahgraham jonahgraham left a comment

Choose a reason for hiding this comment

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

Approved (for when master reopens)

Gtk 4 works in logical points while Cairo works in pixel thus this is
needed for proper size of the pixbuf scale to the original image size.

This makes Button consistent with Label, which already uses GtkPicture
for the same reason (see commit
eclipse-platform#2766 ).

Also fix a memory leak in Label where the GdkTexture
created by gdk_texture_new_for_pixbuf() was not unreffed after being
handed to gtk_picture_set_paintable().
akurtakov added a commit to akurtakov/eclipse.platform.swt that referenced this pull request May 30, 2026
GTK4 works in logical points while Cairo works in pixels, causing images
to appear smaller at HiDPI scaling. Using GtkPicture (instead of
GtkImage)
correctly maps the pixbuf to the right display size.

This is the same fix applied to Button
(eclipse-platform#3323 )
and Label
(eclipse-platform#2766
) for the same reason.
@akurtakov akurtakov merged commit 0087243 into eclipse-platform:master May 30, 2026
20 checks passed
@akurtakov akurtakov deleted the colorbutton branch May 30, 2026 08:35
akurtakov added a commit to akurtakov/eclipse.platform.swt that referenced this pull request May 30, 2026
GTK4 works in logical points while Cairo works in pixels, causing images
to appear smaller at HiDPI scaling. Using GtkPicture (instead of
GtkImage)
correctly maps the pixbuf to the right display size.

This is the same fix applied to Button
(eclipse-platform#3323 )
and Label
(eclipse-platform#2766
) for the same reason.
akurtakov added a commit to akurtakov/eclipse.platform.swt that referenced this pull request May 30, 2026
GTK4 works in logical points while Cairo works in pixels, causing images
to appear smaller at HiDPI scaling. Using GtkPicture (instead of
GtkImage)
correctly maps the pixbuf to the right display size.

This is the same fix applied to Button
(eclipse-platform#3323 )
and Label
(eclipse-platform#2766
) for the same reason.
akurtakov added a commit to akurtakov/eclipse.platform.swt that referenced this pull request May 30, 2026
GTK4 works in logical points while Cairo works in pixels, causing images
to appear smaller at HiDPI scaling. Using GtkPicture (instead of
GtkImage)
correctly maps the pixbuf to the right display size.

This is the same fix applied to Button
(eclipse-platform#3323 )
and Label
(eclipse-platform#2766
) for the same reason.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants