Skip to content

Conversation

freakboy3742
Copy link
Member

@freakboy3742 freakboy3742 commented Jun 16, 2025

Fedora doesn't install the GDK image loader for ICO format by default. This causes the toga demo to crash, as it currently only provides ICO and ICNS format icons.

This can be fixed by users installing the gdk-pixbuf2-modules-extra package on Fedora; or we can add a PNG icon (as PNG icons will be loaded before ICO is attempted. This PR adds the PNG to resolve the immediate problem, and adds a documentation advisory for the general case.

Fixes #3422.

PR Checklist:

  • All new features have been tested
  • All new features have been documented
  • I have read the CONTRIBUTING.md file
  • I will abide by the code of conduct

@freakboy3742 freakboy3742 requested a review from rmartin16 June 16, 2025 02:18
@freakboy3742
Copy link
Member Author

@rmartin16 Tagging you for a review here because you were able to reproduce the problem.

default. The name of the system package that provides the ICO loader is distribution
dependent:

- Fedora: ``gdk-pixbuf2-modules-extra``
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm... is there anywhere else that lets you specify system deps when packaging in Briefcase? If so, might be worth documenting that this needs to be manually added when packaging your app if you're using ICO icons.

Or just make it default.

Sorry if this is already existent.

Copy link
Member Author

Choose a reason for hiding this comment

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

In Briefcase - yes. That's what system-runtime-requires is for.

Given we know this package is a dependency, it wouldn't be the worst idea to add this to the Toga bootstrap, similar to how webkit2gtk3 is listed, but commented out. That way, it's visible that the requirement might be needed, but isn't a forced requirement unless you know you need it.

There's a couple of similar requirements for status icon apps, and geolocation IIRC.

Copy link
Member

Choose a reason for hiding this comment

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

This package isn't even 1 megabyte; I think it'd be better to just add by default. However, maybe worth a note that versions of Fedora before 41 do not support the package (although, <41 is EOL).

Copy link
Member Author

Choose a reason for hiding this comment

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

This package isn't even 1 megabyte; I think it'd be better to just add by default.

True - but by that logic - why has Fedora split it out as a standalone package at all?

Maybe it's worth adding it into the Briefcase default, but we should still annotate why it's being included (implicitly noting that it could be removed to save the precious megabyte if you wanted to)

However, maybe worth a note that versions of Fedora before 41 do not support the package (although, <41 is EOL).

Fedora 41 is the oldest release that Fedora supports, so I'm not sure that's too much of a concern.

Copy link
Member

Choose a reason for hiding this comment

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

True - but by that logic - why has Fedora split it out as a standalone package at all?

I agree; this feels more about ideology than pragmatism. From conversing with chatgpt o3, this seems to be part of Fedora's desire to be highly modular and efficient...

Fedora 41 is the oldest release that Fedora supports, so I'm not sure that's too much of a concern.

True; i was thinking about users trying to build for earlier versions of Fedora. It seems that Fedora is quickly deprecating older versions; so, I could imagine users building for older versions and getting surprised when the install of the distributable fails.

Copy link
Member

@rmartin16 rmartin16 left a comment

Choose a reason for hiding this comment

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

I'm still getting caught on brutus.ico.

(venv) user@fedora:~/tmp/toga/demo$ python -m toga_demo
Traceback (most recent call last):
  File "/home/user/tmp/toga/gtk/src/toga_gtk/icons.py", line 36, in __init__
    native = GdkPixbuf.Pixbuf.new_from_file(str(path)).scale_simple(
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
gi.repository.GLib.GError: gdk-pixbuf-error-quark: Couldn’t recognize the image file format for file “/home/user/tmp/toga/demo/toga_demo/resources/brutus.ico” (3)

@freakboy3742
Copy link
Member Author

I'm still getting caught on brutus.ico.

Ok - I've finally got a working Fedora 42 box, and I can reproduce this.

It looks like the icon lookup order isn't what I thought it was... so it's trying "no suffix .ico" before it tries "png with suffix"...

Back to the drawing board, I guess...

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.

toga-demo fails to start on Fedora 41 with KDE
3 participants