Linux: wxAboutDialogInfo::SetIcon() can't use a hiDPI image (Issue #22192)

32 views
Skip to first unread message

Will Cosgrove

unread,
Mar 11, 2022, 5:22:08 PM3/11/22
to wx-...@googlegroups.com, Subscribed

Describe the bug
When running on linux, you can't use a hiDPI image in the about dialog.

Expected vs observed behaviour
SetIcon() takes a wxIcon and can't scale it based on DPI, it just doubles the size. A possible solution would be to take an wxIconBundle and use the correct icon for the scale factor.

Patch or snippet allowing to reproduce the problem

On a hiDPI display, attempt to put a hi res icon into the about dialog on linux like so:

wxAboutDialogInfo aboutInfo;
aboutInfo.SetIcon(icon);

Skip this step if the problem can be reproduced in one of the samples without any changes.

To Reproduce
See above

Platform and version information

  • wxWidgets version you use: 3.1.5
  • wxWidgets port you use: wxGTK
  • OS and its version: Fedora 35
  • For wxGTK only:
    • GTK version: 3.24.31
    • Which GDK backend is used: Wayland


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/22192@github.com>

VZ

unread,
Mar 19, 2022, 9:19:38 PM3/19/22
to wx-...@googlegroups.com, Subscribed

@paulcor This doesn't seem GTK-specific, I just forgot about this class and didn't change its SetIcon() to take wxBitmapBundle yet.

I'll ask @kosh543 to look at this as this should be similar to the other recent changes.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

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

paulcor

unread,
Mar 20, 2022, 1:35:42 AM3/20/22
to wx-...@googlegroups.com, Subscribed

Using wxBitmapBundle won't help for GTK, as GtkAboutDialog only accepts a GdkPixbuf. I don't think there is a way to use a HiDPI image with that.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

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

VZ

unread,
Mar 20, 2022, 9:18:45 AM3/20/22
to wx-...@googlegroups.com, Subscribed

Sorry if I'm missing something, but couldn't we extract/create a GdkPixbuf of appropriate size and pass it to gtk_about_dialog_set_logo()?

In any case, I think we need to change the API (and implement support for high DPI images in the generic version) in 3.2.0, even if we can't fix this wxGTK right because perhaps we'll be able to do it later and at least like this it ought to be possible without breaking the ABI.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

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

paulcor

unread,
Mar 20, 2022, 11:39:12 AM3/20/22
to wx-...@googlegroups.com, Subscribed

Of course you can make a GdkPixbuf any size you want, but it will be drawn at that size, it has no scaling information.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

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

VZ

unread,
Mar 20, 2022, 11:43:57 AM3/20/22
to wx-...@googlegroups.com, Subscribed

I'm confused... Isn't this what we want? Suppose you have an icon of logical size 32x32 existing in normal and high DPI (2x) versions. Currently only the normal icon would be used, resulting in not very detailed and tiny looking icon being shown on a screen using 200% DPI scaling. If we showed the 64x64 icon instead, it should be shown in the expected size, i.e. 32 logical or 64 physical pixels. Shouldn't it?


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

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

Will Cosgrove

unread,
Mar 20, 2022, 11:57:42 AM3/20/22
to wx-...@googlegroups.com, Subscribed

It appears most Gnome apps (eg Nautilus) are drawing HiPDI images, so it does seem possible in some way.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

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

paulcor

unread,
Mar 20, 2022, 12:08:15 PM3/20/22
to wx-...@googlegroups.com, Subscribed

A GdkPixbuf has no scaling information, there is only "physical" size. If your screen is using 200% DPI scaling, a 64x64 GdkPixbuf will be 128x128 pixels on that screen. This is the reason we have wxGtkImage.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

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

VZ

unread,
Mar 20, 2022, 12:44:57 PM3/20/22
to wx-...@googlegroups.com, Subscribed

Sorry, I forgot once again that the meaning of logical pixels is different in wxGTK3 and wxMSW. So yes, this is not going to work. GTK4 adds something called GdkPaintable which would seem to allow for a custom implementation but I have no idea if it's really supposed to be used for this and it doesn't help right now anyhow.

Nautilus uses icon file which could also work for us but we'd need to provide a new API for this.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

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

VZ

unread,
Mar 24, 2022, 4:18:08 PM3/24/22
to wx-...@googlegroups.com, Subscribed

I think what we really want here is to use the "application" icon for the About dialog by default. I think all systems have the notion of such icon, but we won't have anything like this in wx API. I think it would be nice to add some wxApp::GetIcon() that would use the first icon from the app resource file under MSW, the icon bundle under Mac and whatever is the standard location of the icon file under Linux. Then we'd also use this icon with gtk_window_set_default_icon() which would make the GTK dialog use it by default 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/22192/1078164466@github.com>

VZ

unread,
May 18, 2026, 8:23:56 PM (6 hours ago) May 18
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#22192)

Should this be closed now that the PR has been merged?


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

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

paulcor

unread,
May 18, 2026, 8:59:49 PM (5 hours ago) May 18
to wx-...@googlegroups.com, Subscribed
paulcor left a comment (wxWidgets/wxWidgets#22192)

I don't think so. wxAboutDialogInfo still has no wxBitmapBundle API.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

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

VZ

unread,
May 18, 2026, 11:05:34 PM (3 hours ago) May 18
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#22192)

Sorry, I didn't look at the changes in that commit carefully and wrongly thought that it did this.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

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

Reply all
Reply to author
Forward
0 new messages