gnome.gnome-shell-extensions: 45.alpha → 45.beta

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/compare/45.alpha...45.beta

Ported to ESM, rewritten the fix_gmenu.patch, I found these
docs useful for frontend newbie like me:

https://gjs.guide/extensions/upgrading/gnome-shell-45.html#esm
https://gitlab.gnome.org/GNOME/gjs/-/blob/1.77.2/doc/ESModules.md

Using dynamic import() statements with top-level await since we need to control what is imported.
Seem to work, though it might potentially block gnome-shell thread for a bit?

Changelog-reviewed-by: Bobby Rong <rjl931189261@126.com>
Changelog-reviewed-by: Jan Tojnar <jtojnar@gmail.com>
This commit is contained in:
Bobby Rong
2023-11-21 08:41:52 +01:00
committed by Jan Tojnar
parent 5b2f26a978
commit 64fb2f4bf2
2 changed files with 21 additions and 10 deletions
@@ -13,11 +13,11 @@
stdenv.mkDerivation rec {
pname = "gnome-shell-extensions";
version = "45.alpha";
version = "45.beta";
src = fetchurl {
url = "mirror://gnome/sources/gnome-shell-extensions/${lib.versions.major version}/${pname}-${version}.tar.xz";
sha256 = "uq3CF0wRKKQ2NO3WQNWXaLlPWBcDGA2T1mO/gu8AvA8=";
sha256 = "C2IUTB55M7SH4LyxSLjXclDFCGPJK9Lf9xjGOdEZEE0=";
};
patches = [
@@ -1,11 +1,22 @@
diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js
index 6eb58f1..28e1195 100644
--- a/extensions/apps-menu/extension.js
+++ b/extensions/apps-menu/extension.js
@@ -1,6 +1,8 @@
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
/* exported init enable disable */
@@ -10,7 +10,7 @@ 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';
import GObject from 'gi://GObject';
import Gtk from 'gi://Gtk';
import Meta from 'gi://Meta';
@@ -25,6 +25,8 @@ import * as Main from 'resource:///org/gnome/shell/ui/main.js';
import * as PanelMenu from 'resource:///org/gnome/shell/ui/panelMenu.js';
import * as PopupMenu from 'resource:///org/gnome/shell/ui/popupMenu.js';
+imports.gi.GIRepository.Repository.prepend_search_path('@gmenu_path@');
+
const {
Atk, Clutter, Gio, GLib, GMenu, GObject, Gtk, Meta, Shell, St
} = imports.gi;
+GIRepository.Repository.prepend_search_path('@gmenu_path@');
+const {default: GMenu} = await import('gi://GMenu');
const appSys = Shell.AppSystem.get_default();
const APPLICATION_ICON_SIZE = 32;