[gnome] Update extensions

This commit is contained in:
2026-06-10 11:03:09 -04:00
parent 20fc1e4e75
commit 6c973853c6
394 changed files with 12513 additions and 1340 deletions

View File

@ -463,8 +463,8 @@ const Store = GObject.registerClass({
}
/**
* Lookup a contact for each address object in @addresses and return a
* dictionary of address (eg. phone number) to contact object.
* Lookup a contact for each address object in {@link addresses} and return
* a dictionary of address (eg. phone number) to contact object.
*
* { "555-5555": { "name": "...", "numbers": [], ... } }
*

View File

@ -41,7 +41,7 @@ const Default = new Map();
* followed by a call to `release()`.
*
* @param {string} name - The module name
* @returns {*} The default instance of a component
* @returns {object} The default instance of a component
*/
export function acquire(name) {
if (functionOverrides.acquire)

View File

@ -9,6 +9,12 @@ import GObject from 'gi://GObject';
import * as DBus from '../utils/dbus.js';
// DesktopAppInfo is no longer in Gio in GNOME 49
let GioUnix;
GioUnix = import('gi://GioUnix?version=2.0').catch(() => {
GioUnix = Gio;
});
const _nodeInfo = Gio.DBusNodeInfo.new_for_xml(`
<node>
@ -100,7 +106,7 @@ const Listener = GObject.registerClass({
path: `/org/gnome/desktop/notifications/application/${app}/`,
});
const appInfo = Gio.DesktopAppInfo.new(
const appInfo = GioUnix.DesktopAppInfo.new(
appSettings.get_string('application-id')
);
@ -140,10 +146,10 @@ const Listener = GObject.registerClass({
}
/**
* Try and find a well-known name for @sender on the session bus
* Try and find a well-known name for {@link sender} on the session bus
*
* @param {string} sender - A DBus unique name (eg. :1.2282)
* @param {string} appName - @appName passed to Notify() (Optional)
* @param {string} appName - appName passed to Notify() (Optional)
* @returns {string} A well-known name or %null
*/
async _getAppId(sender, appName) {
@ -185,7 +191,7 @@ const Listener = GObject.registerClass({
}
/**
* Try and find the application name for @sender
* Try and find the application name for {@link sender}
*
* @param {string} sender - A DBus unique name
* @param {string} [appName] - `appName` supplied by Notify()
@ -198,7 +204,7 @@ const Listener = GObject.registerClass({
try {
const appId = await this._getAppId(sender, appName);
const appInfo = Gio.DesktopAppInfo.new(`${appId}.desktop`);
const appInfo = GioUnix.DesktopAppInfo.new(`${appId}.desktop`);
this._names[appName] = appInfo.get_name();
appName = appInfo.get_name();
} catch {
@ -213,10 +219,26 @@ const Listener = GObject.registerClass({
*
* @param {DBus.Interface} iface - The DBus interface
* @param {string} name - The DBus method name
* @param {GLib.Variant} parameters - The method parameters
* @param {Gio.DBusMethodInvocation} invocation - The method invocation info
* @param {GLib.Variant|Gio.DBusMethodInvocation} param1 - The method parameters or invocation (GNOME 50+ changed order)
* @param {Gio.DBusMethodInvocation|GLib.Variant} param2 - The method invocation or parameters (GNOME 50+ changed order)
*/
async _onHandleMethodCall(iface, name, parameters, invocation) {
async _onHandleMethodCall(iface, name, param1, param2) {
let invocation, parameters;
// GNOME 50+ changed the callback signature from
// (iface, name, parameters, invocation) to
// (iface, name, invocation, parameters)
// Detect which order is being used
if (param1 instanceof GLib.Variant) {
// Old order: parameters, invocation
parameters = param1;
invocation = param2;
} else {
// New order: invocation, parameters
invocation = param1;
parameters = param2;
}
try {
// Check if notifications are disabled in desktop settings
if (!this._settings.get_boolean('show-banners'))
@ -357,7 +379,7 @@ const Listener = GObject.registerClass({
if (application === 'org.gnome.Shell.Extensions.GSConnect')
return;
const appInfo = Gio.DesktopAppInfo.new(`${application}.desktop`);
const appInfo = GioUnix.DesktopAppInfo.new(`${application}.desktop`);
// Try to get an icon for the notification
if (!notification.hasOwnProperty('icon'))

View File

@ -80,7 +80,7 @@ class Stream {
}
/**
* Gradually raise or lower the stream volume to @value
* Gradually raise or lower the stream volume to {@link value}
*
* @param {number} value - A number in the range 0-1
* @param {number} [duration] - Duration to fade in seconds