Re: [gtk-osx-users] Black screen on ARM based Macs



Miroslav,

There's more than one moving part here: Adwaita-icon-theme and the Adwaita icons built in to Gtk3 itself. It looks to me like there was a bit of a communications failure between the two groups. One of the Gtk devs has moved the icons eliminated by adwaita-icon-theme into Gtk3 itself, but it will take a couple of weeks for that to percolate into a release and probably quite a bit longer before I update the gtk-osx modules  to pick it up. Regardless, switching to the -symbolic icon names is the way forward so you might as well get it over with.

Regards,
John Ralls


On Jun 30, 2022, at 12:03 PM, Miroslav Rajcic <mrajcic hotmail com> wrote:

Thanks John,

the information was quite helpful, but also quite surprising.
When choosing what icon names to use to replace stock icons, I used official documentation, see for example comments in this file:

Example comment:
/**
 * GTK_STOCK_OPEN:
 *
 * The “Open” item and icon.
 *
 * Deprecated: 3.10: Use named icon &quot;document-open&quot; or the label &quot;_Open&quot;.
 */
I guess that means that the documentation does not match the current state.
Will replace names with "-symbolic" variants.

Best regards,
  Miroslav


From: john <jralls ceridwen us>
Sent: Thursday, June 30, 2022 6:39 PM
To: Miroslav Rajcic <mrajcic hotmail com>
Cc: gtk-osx-users-list gnome org <gtk-osx-users-list gnome org>
Subject: Re: [gtk-osx-users] Black screen on ARM based Macs
 
Miroslav,

The basic problem is that all of those color icons were declared "legacy" by the Gnome designers a long time ago and Adwaita-icon-theme v42 finally removed them. As it happens that broke a Gtk test, see https://gitlab.gnome.org/GNOME/gtk/-/issues/4754, so they've been added back to Gtk-3.24.34. Another "but": It's only the legacy icons used by Gtk3 itself, so it might not cover all of the icons you need.

The simplest temporary fix is to add a module for an older Adwaita version to your local moduleset. I picked 3.38.0 for GnuCash, see https://github.com/Gnucash/gnucash-on-osx/blob/cd34a47d2236929c931a8676845b5714e2ccde20/modulesets/gnucash.modules#L376. Just arrange for it to be built after meta-gtk-osx-gtk3 and it will overwrite the current Adwaita-42.

The longer-term fix is to switch to the newer foo-symbolic names, e.g. "document-new-symbolic". You should do that soon because the legacy icons will disappear from Linux distros soon if they haven't already, particularly on bleeding-edge distros like Arch Linux and Gentoo. I don't know if all of the legacy icons were converted, so you may need to find alternatives or design your own in some cases.

Regards,
John Ralls


 
On Jun 30, 2022, at 4:14 AM, Miroslav Rajcic <mrajcic hotmail com> wrote:

I've been converting from stock icons to symbolic icons, but no luck so far.

Example code (both GTK2 and GTK3 builds are supported):
#if GTK_CHECK_VERSION(3,10,0)
            icon = gtk_image_new_from_icon_name("edit-delete", GTK_ICON_SIZE_MENU);
#else
            icon = gtk_image_new_from_stock(GTK_STOCK_DELETE, GTK_ICON_SIZE_MENU);
#endif

As I can see adwaita theme icons are correctly bundled, and I added test code on startup to write the theme name and search paths:
    gchar* szIconTheme = nullptr;
    g_object_get(gtk_settings_get_default(), "gtk-icon-theme-name", &szIconTheme, (char*) nullptr);
    XLOG(LL_INFO, "Icon theme used: %s\n", szIconTheme);
    g_free(szIconTheme);

  gint n_elements = 0;
  gchar **path;
  gtk_icon_theme_get_search_path(gtk_icon_theme_get_default(), &path, &n_elements);
  for(int j=0; j<n_elements; j++)
    XLOG(LL_INFO, "Icon path: %s\n", path[j]);

Logs below indicate that the search paths are correct, but the icons can not be found anyway:
12:38:03.534 Icon theme used: Adwaita
12:38:03.534 Icon path: /Users/gtk3/.local/share/icons
12:38:03.534 Icon path: /Users/gtk3/.icons
12:38:03.534 Icon path: /Applications/NotecasePro.app/Contents/Resources/share/icons
12:38:03.534 Icon path: /Applications/NotecasePro.app/Contents/Resources/share/pixmaps
...
12:38:03.925 GTK [16]:
(notecase-bin:79345): Gtk-WARNING **: 12:38:03.925: Error loading theme icon 'document-new' for stock: Icon 'document-new' not present in theme Adwaita
12:38:03.927 GTK [16]: 
(notecase-bin:79345): Gtk-WARNING **: 12:38:03.927: Error loading theme icon 'document-open' for stock: Icon 'document-open' not present in theme Adwaita
12:38:03.927 GTK [16]: 
(notecase-bin:79345): Gtk-WARNING **: 12:38:03.927: Error loading theme icon 'document-save' for stock: Icon 'document-save' not present in theme Adwaita
12:38:03.928 GTK [16]: 
(notecase-bin:79345): Gtk-WARNING **: 12:38:03.928: Error loading theme icon 'list-add' for stock: Icon 'list-add' not present in theme Adwaita
12:38:03.928 GTK [16]: 
(notecase-bin:79345): Gtk-WARNING **: 12:38:03.928: Error loading theme icon 'go-previous' for stock:
12:38:03.928 GTK [16]: 
(notecase-bin:79345): Gtk-WARNING **: 12:38:03.928: Error loading theme icon 'go-next' for stock:
12:38:03.928 GTK [16]: 
(notecase-bin:79345): Gtk-WARNING **: 12:38:03.928: Error loading theme icon 'edit-undo' for stock:

I've uploaded the new build, as it seems the icons are correctly bundled (lot of "<name>-symbolic.symbolic.png" files):

Any idea how to debug this?
Can I perhaps activate an additional GTK logging for the GTK theme related code through GTK_DEBUG variable or something similar?

Best regards,
  Miroslav


From: gtk-osx-users-list <gtk-osx-users-list-bounces gnome org> on behalf of Miroslav Rajcic via gtk-osx-users-list <gtk-osx-users-list gnome org>
Sent: Sunday, June 26, 2022 7:52 PM
To: john <jralls ceridwen us>
Cc: gtk-osx-users-list gnome org <gtk-osx-users-list gnome org>
Subject: Re: [gtk-osx-users] Black screen on ARM based Macs
 
Will do, thanks!

Best regards,
  Miroslav

From: john <jralls ceridwen us>
Sent: Sunday, June 26, 2022 6:24 PM
To: Miroslav Rajcic <mrajcic hotmail com>
Cc: gtk-osx-users-list gnome org <gtk-osx-users-list gnome org>
Subject: Re: [gtk-osx-users] Black screen on ARM based Macs
 
Miroslav,

That's good news, and I tested it here as well. Don't forget to investigate the toolbar icons and menu. BTW, File>Quit doesn't work though command-Q does.

Regards,
John Ralls

On Jun 26, 2022, at 1:01 AM, Miroslav Rajcic <mrajcic hotmail com> wrote:

Hi John,

I've got confirmation that the following new build works OK for the user:

Changelog: I've updated the launcher script, set the target to 10.12 (as you've done) and removed libspell.
I can now experiment to see which of these helped to resolve the issue.

Thanks again for your help.

Best regards,
   Miroslav

From: gtk-osx-users-list <gtk-osx-users-list-bounces gnome org> on behalf of Miroslav Rajcic via gtk-osx-users-list <gtk-osx-users-list gnome org>
Sent: Saturday, June 25, 2022 11:34 AM
To: John Ralls <jralls ceridwen us>
Cc: gtk-osx-users-list gnome org <gtk-osx-users-list gnome org>
Subject: Re: [gtk-osx-users] Black screen on ARM based Macs
 
Thanks John,

will work to fix the issues you've observed.

Best regards,
Miroslav


From: John Ralls <jralls ceridwen us>
Sent: Saturday, June 25, 2022 1:45 AM
To: Miroslav Rajcic <mrajcic hotmail com>
Cc: gtk-osx-users-list gnome org <gtk-osx-users-list gnome org>
Subject: Re: [gtk-osx-users] Black screen on ARM based Macs
 
Miroslav,

I built a fresh meta-gtk-osx-gtk3 with macOS version min set to 10.12, symlinked $PREFIX/inst to $PREFIX/Resources and copied notecore-bin to $PREFIX/MacOS/notecore so that it would find my libraries with @executable_path/../Resources, then ran notecore from a jhbuild shell. It displayed correctly on both Retina and not. That tells me that whatever is messed up it isn't Gtk.

There seems to be a lot of extraneous stuff in your bundle as well, your launcher-script looks rather haphazardly ported from a Gtk2 one, and libspell is in the wrong place.  So start off with a fresh build of meta-gtk-osx-gtk3 in an empty folder starting with bootstrap-gtk-osx and for safety libspell too. While the build is going on clean up your bundle file so that only the libraries and other folders that you need are installed and redo your launcher script based on gtk-mac-bundler/examples/gtk3-launcher.sh.

Some other things that need addressing: You seem not to have updated your use of gtk-mac-integration for Gtk3: It doesn't work, the menu bar is on the window instead of at the top of the screen. The Gtk-supplied icons aren't visible, perhaps you're trying to use the GTK_STOCK icons that were deprecated in Gtk-3.0.0 and removed somewhere around Gtk 3.10. I thought at first you'd gotten tripped up with the removal of the deprecated stock names in Adwaita-42, but they don't work with Adwaita-3.38 either.

Once you've got a clean bundle I'll test it for you, but you might want to get the Additional Tools for Xcode 13 from https://developer.apple.com/downloads. It includes Quartz Debug that might enable you to fake retina resolution if your MBA has enough GPU to support it.

Regards,
John Ralls


> On Jun 24, 2022, at 2:17 PM, John Ralls <jralls ceridwen us> wrote:
> 
> Miroslav,
> 
> Thanks. I can confirm that it’s a Retina issue, not an Apple Silicon one. I have the same 1/4 render on my Retina monitor on both my Intel Mac Pro and my M1 mini. It looks normal on the non-Retina monitor on both systems.
> Next I tried my 2014 MBP Retina running macOS 11 BigSur. Same problem. Maybe this is your user’s first experience with Retina displays? 
> 
> I hadn’t really paid attention to https://gitlab.gnome.org/GNOME/gtk/-/issues/4342#note_1299321 until now. I think that’s a separate issue from the Monterey absolute value change that screwed up flipping the coordinate system. His issue appears similar to yours and he worked around it by removing the scaling line,https://gitlab.gnome.org/GNOME/gtk/-/blob/3.24.33/gdk/quartz/gdkwindow-quartz.c#L194 , altogether. I’m not sure why that would be necessary for you and him and not for anybody else. That line has been there for 6 years, having been introduced in https://gitlab.gnome.org/GNOME/gtk/-/commit/3f077ec36f4a59e803c9f4509996269c862e04af. Note that the scale division in the CTM is countered by scaling the size of the Cairo surface athttps://gitlab.gnome.org/GNOME/gtk/-/blob/3.24.33/gdk/quartz/gdkwindow-quartz.c#L352.
> 
> Regards,
> John Ralls
> 
> 
> 
>> On Jun 24, 2022, at 12:01 PM, Miroslav Rajcic <mrajcic hotmail com> wrote:
>> 
>> Hi John,
>> 
>> you can find the installer with new build here:
>> http://notecase.sourceforge.net/temp/notecase-4.6.4pre1.pkg
>> 
>> Thanks for the help.
>> 
>> Best regards,
>>  Miroslav
>> 
>> From: john <jralls ceridwen us>
>> Sent: Friday, June 24, 2022 7:49 PM
>> To: Miroslav Rajcic <mrajcic hotmail com>
>> Cc: gtk-osx-users-list gnome org <gtk-osx-users-list gnome org>
>> Subject: Re: [gtk-osx-users] Black screen on ARM based Macs
>> 
>> Miroslav,
>> 
>> I installed NoteCasePro from your download page to my M1Pro MBP running the Ventura developer beta and it looks just like your screenshot. It also has Gtk-3.24.30. Can you give me a link to your Gtk3.24.33 installer?
>> 
>> I think that the reason you can't see the problem is that your 2017 MBA doesn't have a Retina display. I'll check it on my MacPro that does have a Retina display in a bit and follow up.
>> 
>> I haven't tried cross-compiling to arm64 from intel yet, but it didn't work at all back in the PPC->Intel days so when I was distributing PPC apps I built on the respective machines. Universal builds definitely don't work from the command line, I did try that. I can also say that I haven't seen any significant behavior differences between running Intel builds with Rosetta2 and native builds on M1s, so I think it's unlikely that that's the problem. The Xcode version shouldn't matter either.
>> 
>> Regards,
>> John Ralls
>> 
>> 
>> 
>>> On Jun 24, 2022, at 5:45 AM, Miroslav Rajcic <mrajcic hotmail com> wrote:
>>> 
>>> Thanks John,
>>> 
>>> I don't have M1 hardware, so I depend on users to help troubleshooting the issue. 
>>> 
>>> I do my build on Intel hardware (macOS 12.0.1, MacBook Air 2017, XCode 13.2.1), with the following target setup:
>>> setup_sdk(target="10.9", sdk_version="native", architectures=["x86_64"])
>>> i.e. program is being run on M1 through Rosetta.
>>> 
>>> The issue was reported against the build using GTK 3.24.30, then I've rebuilt the program to use latest v3.24.33,
>>> but both users reported that the issue was not fixed (screenshots below). They are not developers, so they did not try running gtk-demo.
>>> 
>>> I do have an app log that redirects all GTK logging, but could not find any clue (GTK error/warning) in it. The same binary works fine
>>> on Intel hardware, no such issues were reported.
>>> I will re-check to make sure they properly installed the newer build.
>>> 
>>> Could adding native "arm64" architecture into the setup help with this bug (based on the bug that was fixed)?
>>> Do I need to use newer XCode for this?
>>> 
>>> Best regards,
>>>  Miroslav
>>> 
>>> <Screenshot 2022-06-20 at 18.56.35.png>
>>> 
>>> <Screenshot 2022-06-17 at 06.18.07.png>
>>> 
>>> From: john <jralls ceridwen us>
>>> Sent: Thursday, June 23, 2022 2:30 AM
>>> To: Miroslav Rajcic <mrajcic hotmail com>
>>> Cc: gtk-osx-users-list gnome org <gtk-osx-users-list gnome org>
>>> Subject: Re: [gtk-osx-users] Black screen on ARM based Macs
>>> 
>>> 
>>> 
>>>> On Jun 21, 2022, at 9:50 PM, Miroslav Rajcic via gtk-osx-users-list <gtk-osx-users-list gnome org> wrote:
>>>> 
>>>> Hi,
>>>> 
>>>> several users of my program reported the main application screen being partially black on ARM based Macs (M1) on macOS Monterey.
>>>> Digging online, it seems that this bug has been known:
>>>> https://gitlab.gnome.org/GNOME/gtk/-/issues/4342
>>>> https://gitlab.gnome.org/GNOME/gtk/-/issues/4395
>>>> 
>>>> I've rebuilt latest gtk-osx yesterday (moduleset-stable), but the issue still seems to be here.
>>>> What's the status of this issue in gtk-osx?
>>> 
>>> Miroslav,
>>> 
>>> The fix for issue 4342 is in Gtk+-3.0 since 3.24.31 and modulesets-stable has 3.24.33, so perhaps the problem your users have found isn't the same one. 
>>> 
>>> Is this an Apple Silicon build or an Intel one? What minimum macOS version did you specify? Does the problem reproduce in gtk3-demo or is it just your app?
>>> 
>>> Regards,
>>> John Ralls
> 
> _______________________________________________
> gtk-osx-users-list mailing list
> gtk-osx-users-list gnome org
> https://mail.gnome.org/mailman/listinfo/gtk-osx-users-list



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]