Skip to content

Conversation

@3v1n0
Copy link
Contributor

@3v1n0 3v1n0 commented Sep 11, 2025

In newest glib GioUnix symbols are not anymore exposed in GioUnix, while cjs should use linuxmint/cjs#131 it's still better to use GioUnix all the times.

More importantly though, when scanning the cinnamon headers, GioUnix-2.0 should be used or the APIs exposing GDesktopAppInfo won't work or they will be broken. (this should not be a problem here since you actually use GMenuDesktopAppInfo instead which is not exposed by GioUnix)

It's not included here, but it's highly recommended to now depend on GLib 2.86.0, or at least communicate clearly to distributors that they must recompile cinnamon on GLib 2.86.0 (and with these patches) to get it working with newer GLib version (or well with the newest gio introspection typelibs).

@3v1n0
Copy link
Contributor Author

3v1n0 commented Sep 11, 2025

Note that the Gio -> GioUnix rename commit is optional here, assuming you have linuxmint/cjs#131. While it's not optional the fact that GioUnix should be used to introspect.

@3v1n0 3v1n0 force-pushed the giounix-desktop-app-info branch from b9387bc to e40c404 Compare September 12, 2025 02:32
@Fantu
Copy link
Contributor

Fantu commented Sep 12, 2025

@3v1n0 Thanks for your work.
There are some things I can't quite understand.
linuxmint/cjs#131 seems a "workaround" to keep retrocompatibility while with this patch you use the new APIs which would be better, or I'm wrong?
Cjs PR can be needed also with this patch if other cinnamon components or spices (applets and extensions) use removed API, right?
Searching if needed to update the glib min version for build, GioUnix seems to have been around for a long time but the documentation seems to have just changed for example from Gio.DesktopAppInfo to GioUnix.DesktopAppInfo only recently, from what I thought I saw, so I have a doubt if there was some problem with GioUnix or if it was just not well known what had been moved and deprecated.
Sorry if my doubt is stupid because I didn't understand or find it well.

@3v1n0
Copy link
Contributor Author

3v1n0 commented Sep 12, 2025

linuxmint/cjs#131 seems a "workaround" to keep retrocompatibility while with this patch you use the new APIs which would be better, or I'm wrong?

Yeah, it's more a wrapper to keep deprecated Gio.Unix* stuff to work as it used to do, so it allows all the cjs related stuff to continue working, since Gio unix is used in other places too.

We have the same in upstream gjs.

Cjs PR can be needed also with this patch if other cinnamon components or spices (applets and extensions) use removed API, right?

Yes, this patch is enough to get cinnamon running, but not for all the applets (that indeed requires having an updated cjs, or a workaround to inject GioUnix.DesktopAppInfo into Gio in cinnamon itself).

@3v1n0
Copy link
Contributor Author

3v1n0 commented Sep 12, 2025

Searching if needed to update the glib min version for build, GioUnix seems to have been around for a long time but the documentation seems to have just changed for example from Gio.DesktopAppInfo to GioUnix.DesktopAppInfo only recently, from what I thought I saw, so I have a doubt if there was some problem with GioUnix or if it was just not well known what had been moved and deprecated.

As per gjs change this is deprecated for a while (so I'd switch the dependency on glib 2.79.2), but we did not advertise it properly for Gio.DesktopAppInfo

GioUnix included Gio unix-only symbols since 2.79.2, so depend on that
version

See: linuxmint#13091 (comment)
@Fantu
Copy link
Contributor

Fantu commented Sep 12, 2025

Thanks for all the replies

@3v1n0
Copy link
Contributor Author

3v1n0 commented Sep 12, 2025

Ah, btw I saw all the dependencies using Gio.DesktopAppInfo in linuxmint, they're all in python and that's handled via pygobject (https://gitlab.gnome.org/GNOME/pygobject/-/merge_requests/451) already.

@mtwebster
Copy link
Member

mtwebster commented Sep 12, 2025

if other cinnamon components or spices (applets and extensions) use removed API, right?

I won't mind doing a mass edit to all third-party applets and extensions to fix this stuff when necessary.

@mtwebster mtwebster merged commit 691a049 into linuxmint:master Sep 15, 2025
3 checks passed
@bobby285271
Copy link
Contributor

Hi, I package cinnamon on NixOS and was trying this patch with GLib 2.84.4 and pygobject 3.50.0 (i.e. still GNOME 48) and got this when trying to open "Preferred Applications" in cinnamon-settings:

Traceback (most recent call last):
  File "/nix/store/2x06wciyzljz8lfq06zkhkifz4mvan1j-cinnamon-6.4.12/share/cinnamon/cinnamon-settings/cinnamon-settings.py", line 751, in button_press
    self.side_view_nav(widget, None, category)
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/2x06wciyzljz8lfq06zkhkifz4mvan1j-cinnamon-6.4.12/share/cinnamon/cinnamon-settings/cinnamon-settings.py", line 176, in side_view_nav
    self.go_to_sidepage(sidePage, user_action=True)
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/2x06wciyzljz8lfq06zkhkifz4mvan1j-cinnamon-6.4.12/share/cinnamon/cinnamon-settings/cinnamon-settings.py", line 185, in go_to_sidepage
    sidePage.build()
    ~~~~~~~~~~~~~~^^
  File "/nix/store/2x06wciyzljz8lfq06zkhkifz4mvan1j-cinnamon-6.4.12/share/cinnamon/cinnamon-settings/bin/SettingsWidgets.py", line 212, in build
    self.module.on_module_selected()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/nix/store/2x06wciyzljz8lfq06zkhkifz4mvan1j-cinnamon-6.4.12/share/cinnamon/cinnamon-settings/modules/cs_default.py", line 627, in on_module_selected
    button = DefaultCalculatorButton()
  File "/nix/store/2x06wciyzljz8lfq06zkhkifz4mvan1j-cinnamon-6.4.12/share/cinnamon/cinnamon-settings/modules/cs_default.py", line 367, in __init__
    cat_val = GioUnix.DesktopAppInfo.get_categories(self.this_item)
              ^^^^^^^
NameError: name 'GioUnix' is not defined

After apply the following patch it works. Is that expected?

diff --git a/files/usr/share/cinnamon/cinnamon-settings/modules/cs_default.py b/files/usr/share/cinnamon/cinnamon-settings/modules/cs_default.py
index 4c69191d3..8763511bf 100755
--- a/files/usr/share/cinnamon/cinnamon-settings/modules/cs_default.py
+++ b/files/usr/share/cinnamon/cinnamon-settings/modules/cs_default.py
@@ -4,7 +4,10 @@ import os
 
 from SettingsWidgets import SidePage
 from xapp.GSettingsWidgets import *
+
+gi.require_version('GioUnix', '2.0')
 from gi.repository import *
+from gi.repository import GioUnix
 
 PREF_MEDIA_AUTORUN_NEVER = "autorun-never"
 PREF_MEDIA_AUTORUN_X_CONTENT_START_APP = "autorun-x-content-start-app"

mtwebster added a commit that referenced this pull request Sep 16, 2025
@mtwebster
Copy link
Member

That's odd...

I fixed the imports - 330b9ff

I'm not sure why it would fail to bring in GioUnix - maybe related to the namespace workarounds that had been in place?

We should always be explicit with imports anyhow. (... ignores line 6...)

@Fantu
Copy link
Contributor

Fantu commented Sep 16, 2025

from gi.repository import * is bad
@mtwebster thanks for 330b9ff

sabamdarif added a commit to sabamdarif/termux-packages that referenced this pull request Oct 3, 2025
sabamdarif added a commit to sabamdarif/termux-packages that referenced this pull request Oct 3, 2025
robertkirkman pushed a commit to termux/termux-packages that referenced this pull request Oct 4, 2025
termux-pacman-bot added a commit to termux-pacman/termux-packages that referenced this pull request Oct 4, 2025
bigbio2002 pushed a commit to bigbio2002/termux-packages that referenced this pull request Oct 12, 2025
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.

4 participants