Incorrect image offset in wxListCtrl when using scaling in wxGTK >= 3.3.0 (Issue #26349)

30 views
Skip to first unread message

Mia McMahill

unread,
Apr 5, 2026, 12:38:32 AM (7 days ago) Apr 5
to wx-...@googlegroups.com, Subscribed
electricbrass created an issue (wxWidgets/wxWidgets#26349)

Description

Icons in wxListCtrls aren't drawn quite right when using scaling on wxGTK. It appears they have lost padding on the bottom and right sides, or are maybe being offset down and left. Any scale factor other than 100%, whether fractional or integral, results in the the exact same issue. This issue occurs with all 3.3.x versions, and none of the 3.0-3.2 versions I tested.

Screenshots:

wxWidgets 3.2.8, 150% scale:
image.png (view on web)

wxWidgets 3.3.2, 150% scale:
image.png (view on web)

wxWidgets 3.3.2, 100% scale:
image.png (view on web)

wxWidgets 3.3.2, 200% scale:
image.png (view on web)

Expected vs observed behaviour:

I would expect the icons to be placed exactly the same as in versions earlier than 3.3.0. In those versions, the icon is vertically centered in the list item, and is not overlapped by text from the same cell.

Platform and version information

  • wxWidgets version you use: 3.2.8 and 3.3.2
  • wxWidgets port you use: wxGTK
  • OS and its version:
    • GTK version:
    • Which GDK backend is used: Wayland
    • Desktop environment : GNOME
    • Current theme: Adwaita dark


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/26349@github.com>

Mia McMahill

unread,
Apr 5, 2026, 12:54:21 AM (7 days ago) Apr 5
to wx-...@googlegroups.com, Subscribed
electricbrass left a comment (wxWidgets/wxWidgets#26349)

Also tested with the current latest commit: 719c678
Behavior is the same as with all 3.3.x releases


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/26349/4188283804@github.com>

VZ

unread,
Apr 5, 2026, 9:05:29 AM (7 days ago) Apr 5
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#26349)

There must be something which makes the problem appear in your code but not in the listctrl sample which appears just fine in 200% scaling. Could you please try to find out what the difference is and, ideally, make the smallest possible patch reproducing the problem in the sample?

Also, does your code use legacy wxImageList or newer API supporting high DPI?


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/26349/4188863009@github.com>

Mia McMahill

unread,
Apr 9, 2026, 2:25:30 PM (2 days ago) Apr 9
to wx-...@googlegroups.com, Subscribed
electricbrass left a comment (wxWidgets/wxWidgets#26349)

Could you please try to find out what the difference is and, ideally, make the smallest possible patch reproducing the problem in the sample?

Yep! I was already planning on it, but just hadn't gotten around to it yet. Will see what I can do.

Also, does your code use legacy wxImageList or newer API supporting high DPI?

wxImageList at the moment, currently migrating from v3.0.5. All the icons are 16x16.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/26349/4216509307@github.com>

Mia McMahill

unread,
Apr 9, 2026, 2:54:24 PM (2 days ago) Apr 9
to wx-...@googlegroups.com, Subscribed
electricbrass left a comment (wxWidgets/wxWidgets#26349)

It looks like building the 3.1.5 version of the listctrl example (the last before it stopped using wxImageList) with 3.3.x shows the exact same issue I was seeing.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/26349/4216708074@github.com>

Mia McMahill

unread,
Apr 9, 2026, 3:49:23 PM (2 days ago) Apr 9
to wx-...@googlegroups.com, Subscribed
electricbrass left a comment (wxWidgets/wxWidgets#26349)

Updating my code to use the newer API seems to fix this as well, so it definitely appears to be an issue with wxImageList.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/26349/4217077519@github.com>

VZ

unread,
Apr 9, 2026, 5:00:02 PM (2 days ago) Apr 9
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#26349)

Oops, I do indeed see the problem with the 3.1.5 version of the sample built against current master, I'll have a look. I thought I had tested this before making changes to the sample, but apparently not :-(


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/26349/4217440997@github.com>

Mia McMahill

unread,
Apr 9, 2026, 5:02:31 PM (2 days ago) Apr 9
to wx-...@googlegroups.com, Subscribed
electricbrass left a comment (wxWidgets/wxWidgets#26349)

I wonder if #24033 might be the source of the issue.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/26349/4217454312@github.com>

VZ

unread,
Apr 9, 2026, 5:33:15 PM (2 days ago) Apr 9
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#26349)

The fix for this bug is just

diff --git a/include/wx/withimages.h b/include/wx/withimages.h
index f19f5cfbe8..48fa4c79d2 100644
--- a/include/wx/withimages.h
+++ b/include/wx/withimages.h
@@ -196,8 +196,7 @@ public:
             }
             else if ( m_imageList )
             {
-                // All images in the image list are of the same size.
-                size = window->FromPhys(m_imageList->GetSize());
+                size = m_imageList->GetBitmap(iconIndex).GetLogicalSize();
             }
         }
 

however I found another problem under Windows while testing it, so I'll push this a bit later, when I find and fix that one too.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/26349/4217680333@github.com>

VZ

unread,
Apr 9, 2026, 8:18:45 PM (2 days ago) Apr 9
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#26349)

I'm finally going to push this fix directly because the MSW problem is more serious (and not really related, as it's not in wxImageList itself but in wxIcon).


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/26349/4218778867@github.com>

VZ

unread,
Apr 9, 2026, 8:23:57 PM (2 days ago) Apr 9
to wx-...@googlegroups.com, Subscribed

Closed #26349 as completed via 21264e2.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issue/26349/issue_event/24357983056@github.com>

Reply all
Reply to author
Forward
0 new messages