Merge [Backport release-25.05] gnomeExtensions.applications-menu: fix GMenu import (#408196)

This commit is contained in:
Jan Tojnar
2025-05-19 00:24:49 +02:00
committed by GitHub
2 changed files with 29 additions and 0 deletions

View File

@@ -6,6 +6,7 @@
easyeffects,
gjs,
glib,
gnome-menus,
nautilus,
gobject-introspection,
hddtemp,
@@ -47,6 +48,17 @@ in
# the upstream repository's sources.
super:
lib.trivial.pipe super [
(patchExtension "apps-menu@gnome-shell-extensions.gcampax.github.com" (old: {
patches = [
(replaceVars
./extensionOverridesPatches/apps-menu_at_gnome-shell-extensions.gcampax.github.com.patch
{
gmenu_path = "${gnome-menus}/lib/girepository-1.0";
}
)
];
}))
(patchExtension "caffeine@patapon.info" (old: {
meta.maintainers = with lib.maintainers; [ eperuffo ];
}))

View File

@@ -0,0 +1,17 @@
diff --git a/extension.js b/extension.js
index c608441..2b25335 100644
--- a/extension.js
+++ b/extension.js
@@ -9,7 +9,11 @@ import Atk from 'gi://Atk';
import Clutter from 'gi://Clutter';
import Gio from 'gi://Gio';
import GLib from 'gi://GLib';
-import GMenu from 'gi://GMenu';
+
+import GIRepository from 'gi://GIRepository';
+GIRepository.Repository.prepend_search_path('@gmenu_path@');
+const {default: GMenu} = await import('gi://GMenu');
+
import GObject from 'gi://GObject';
import Gtk from 'gi://Gtk';
import Meta from 'gi://Meta';