Skip to content

libs-gui: only create icon/miniwindow when GSSuppressAppIcon is explicitly NO - #930

Open
probonopd wants to merge 1 commit into
gnustep:masterfrom
probonopd:gssuppressappicon-only-no
Open

libs-gui: only create icon/miniwindow when GSSuppressAppIcon is explicitly NO#930
probonopd wants to merge 1 commit into
gnustep:masterfrom
probonopd:gssuppressappicon-only-no

Conversation

@probonopd

@probonopd probonopd commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

As discussed in the last monthly meeting, creating miniwindows should only happen when requested (opt-in).

Previously, the app icon and miniwindow were created unconditionally and only the display was suppressed. This led to unnecessary allocations and potential issues when GSSuppressAppIcon was not set.

With this change, _appIconInit returns early if GSSuppressAppIcon is not set to NO, and miniwindow creation is skipped unless GSSuppressAppIcon is NO. Also adds a nil check before GSRemoveIcon to prevent potential crashes.

This change is based on gershwin-desktop/gershwin-developer@e8f2110

cc @gcasa @pkgdemon

@probonopd
probonopd requested a review from fredkiefer as a code owner August 31, 2026 14:16
…citly NO

Previously, the app icon and miniwindow were created unconditionally
and only the display was suppressed. This led to unnecessary allocations
and potential issues when GSSuppressAppIcon was not set.

Now _appIconInit returns early if GSSuppressAppIcon is not set to NO,
and miniwindow creation is skipped unless GSSuppressAppIcon is NO.
Also adds a nil check before GSRemoveIcon to prevent potential crashes.
@probonopd
probonopd force-pushed the gssuppressappicon-only-no branch from 3d3d4cb to 94a16b9 Compare August 31, 2026 14:23
@probonopd

probonopd commented Aug 31, 2026

Copy link
Copy Markdown
Contributor Author

I suspect the test failures are not caused by this PR (which doesn't touch fonts), what do you think?

gui/NSFont/named.m:
Failed file:  named.m aborted without running all tests!
Failed test:     (2026-08-31 14:26:57.787 UTC)   named.m:37 ... fontWithName:size: returns a font
Failed test:     (2026-08-31 14:26:57.787 UTC)   named.m:39 ... the font keeps the requested name
Failed test:     (2026-08-31 14:26:57.787 UTC)   named.m:40 ... the font has the requested point size

@gcasa

gcasa commented Aug 31, 2026

Copy link
Copy Markdown
Member

I suspect the test failures are not caused by this PR (which doesn't touch fonts), what do you think?

gui/NSFont/named.m:
Failed file:  named.m aborted without running all tests!
Failed test:     (2026-08-31 14:26:57.787 UTC)   named.m:37 ... fontWithName:size: returns a font
Failed test:     (2026-08-31 14:26:57.787 UTC)   named.m:39 ... the font keeps the requested name
Failed test:     (2026-08-31 14:26:57.787 UTC)   named.m:40 ... the font has the requested point size

I just re-ran this. It fails in the same way. I am not sure what could have changed to cause this issue.

@gcasa

gcasa commented Aug 31, 2026

Copy link
Copy Markdown
Member

The failure in named.m is because there doesn't always have to be a "Helvetica" font. In the art backend, this was a safe assumption since it copied in a "Helvetica.nfont" (nfonts are something created by Deek / Jeff Teuneissen) to fulfill this. I am not sure why we didn't see this failure until now, but it's my guess that that is the cause here.

@gcasa

gcasa commented Aug 31, 2026

Copy link
Copy Markdown
Member

Please try this version of named.m... I have zipped it here. It retrieves the names of all fonts and then grabs one by name. This ensures were are using a font that is actually installed.

named.m.zip

@probonopd

Copy link
Copy Markdown
Contributor Author

Thanks @gcasa.
Wouldn't you want to get that applied independently from my PR, and then rebase my PR on top of it?

@gcasa

gcasa commented Aug 31, 2026

Copy link
Copy Markdown
Member

Thanks @gcasa. Wouldn't you want to get that applied independently from my PR, and then rebase my PR on top of it?

I had thought about that. I will try it.

@fredkiefer

Copy link
Copy Markdown
Member

Not sure whether that change will help. What should happen with the name "Helvetica" is that it is hard coded into NSFont and if no font with that name can be found, we try the default font, whatever the backend uses for that. What could be happening there is that none of the well known fonts is present.
And as you correctly asked, why is this happening now and didn't happen for the last merged PR? One possible option is that a new base image is being used.

I'll have a look at what the frame buffer version of cairo is using here, but I would expect it to have all the normal fontconfig fonts.

@gcasa

gcasa commented Aug 31, 2026

Copy link
Copy Markdown
Member

I have pushed this change on master. Please pull that change.

@gcasa

gcasa commented Aug 31, 2026

Copy link
Copy Markdown
Member

FYI, I have been frustrated with the current behavior. In my view, GSSuppressAppIcon should act as you suggest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants