libs-gui: only create icon/miniwindow when GSSuppressAppIcon is explicitly NO - #930
libs-gui: only create icon/miniwindow when GSSuppressAppIcon is explicitly NO#930probonopd wants to merge 1 commit into
Conversation
3d3d4cb to
94a16b9
Compare
|
I suspect the test failures are not caused by this PR (which doesn't touch fonts), what do you think? |
I just re-ran this. It fails in the same way. I am not sure what could have changed to cause this issue. |
|
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. |
|
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. |
|
Thanks @gcasa. |
I had thought about that. I will try it. |
|
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. 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. |
|
I have pushed this change on master. Please pull that change. |
|
FYI, I have been frustrated with the current behavior. In my view, GSSuppressAppIcon should act as you suggest. |
My approach here was to avoid the hardcoding and find all fonts and get the name of the first one. This way it preserves the intention of the test. I think you're saying we should hardcode "Helvetica" so that referencing that (if Helvetica itself isn't available) it will get the default font. Is that correct? |
94a16b9 to
e8d53c8
Compare
|
So now the font tests are failing in a different place? |
From the test log: |
e8d53c8 to
4d3e06e
Compare
|
Looks like the Cairo backend needs a window for the screen to be initialized, which is used for font size conversions. Since we no longer have the miniicon windows, we probably need to initialize the display connection manually in the test. Does this sound correct @gcasa? |
…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.
4d3e06e to
4b8a923
Compare
I don't think so. From my experience... (granted I have limited experience with the backend, thankfully it is very stable)... initializeContext for CairoContext currently only registers the default graphics context and font classes. It doesn't create or inspect a window. It just creates the display server. What leads you to the conclusion that a window is needed? |
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
GSSuppressAppIconwas not set.With this change,
_appIconInitreturns early ifGSSuppressAppIconis not set toNO, and miniwindow creation is skipped unlessGSSuppressAppIconisNO. Also adds a nil check beforeGSRemoveIconto prevent potential crashes.This change is based on gershwin-desktop/gershwin-developer@e8f2110
cc @gcasa @pkgdemon