[gnome] Update extensions for v46

This commit is contained in:
2024-04-03 12:59:14 -04:00
parent 3fb1ec63ae
commit 7421cdba8f
251 changed files with 15759 additions and 3153 deletions

View File

@ -147,18 +147,7 @@ const RemoteSession = GObject.registerClass({
}
scrollPointer(dx, dy) {
// NOTE: NotifyPointerAxis only seems to work on Wayland, but maybe
// NotifyPointerAxisDiscrete is the better choice anyways
if (HAVE_WAYLAND) {
this._call(
'NotifyPointerAxis',
GLib.Variant.new('(ddu)', [dx, dy, 0])
);
this._call(
'NotifyPointerAxis',
GLib.Variant.new('(ddu)', [0, 0, 1])
);
} else if (dy > 0) {
if (dy > 0) {
this._call(
'NotifyPointerAxisDiscrete',
GLib.Variant.new('(ui)', [Gdk.ScrollDirection.UP, 1])
@ -266,50 +255,6 @@ class Controller {
return this._connection;
}
/**
* Check if this is a Wayland session, specifically for distributions that
* don't ship pipewire support (eg. Debian/Ubuntu).
*
* FIXME: this is a super ugly hack that should go away
*
* @return {boolean} %true if wayland is not supported
*/
_checkWayland() {
if (HAVE_WAYLAND) {
// eslint-disable-next-line no-global-assign
HAVE_REMOTEINPUT = false;
const service = Gio.Application.get_default();
if (service === null)
return true;
// First we're going to disabled the affected plugins on all devices
for (const device of service.manager.devices.values()) {
const supported = device.settings.get_strv('supported-plugins');
let index;
if ((index = supported.indexOf('mousepad')) > -1)
supported.splice(index, 1);
if ((index = supported.indexOf('presenter')) > -1)
supported.splice(index, 1);
device.settings.set_strv('supported-plugins', supported);
}
// Second we need each backend to rebuild its identity packet and
// broadcast the amended capabilities to the network
for (const backend of service.manager.backends.values())
backend.buildIdentity();
service.manager.identify();
return true;
}
return false;
}
_onNameAppeared(connection, name, name_owner) {
try {
this._connection = connection;
@ -394,10 +339,6 @@ class Controller {
if (this.connection === null) {
debug('Falling back to Atspi');
// If we got here in Wayland, we need to re-adjust and bail
if (this._checkWayland())
return;
const fallback = imports.service.components.atspi;
this._session = new fallback.Controller();

View File

@ -190,7 +190,7 @@ const Mixer = GObject.registerClass({
*/
lowerVolume(duration = 1) {
try {
if (this.output.volume > 0.15) {
if (this.output && this.output.volume > 0.15) {
this._previousVolume = Number(this.output.volume);
this.output.fade(0.15, duration);
}
@ -204,7 +204,7 @@ const Mixer = GObject.registerClass({
*/
muteVolume() {
try {
if (this.output.muted)
if (!this.output || this.output.muted)
return;
this.output.muted = true;
@ -219,7 +219,7 @@ const Mixer = GObject.registerClass({
*/
muteMicrophone() {
try {
if (this.input.muted)
if (!this.input || this.input.muted)
return;
this.input.muted = true;
@ -266,4 +266,3 @@ const Mixer = GObject.registerClass({
* The service class for this component
*/
var Component = Mixer;

View File

@ -410,10 +410,6 @@ var ChannelService = GObject.registerClass({
});
for (const name in imports.service.plugins) {
// Exclude mousepad/presenter capability in unsupported sessions
if (!HAVE_REMOTEINPUT && ['mousepad', 'presenter'].includes(name))
continue;
const meta = imports.service.plugins[name].Metadata;
if (meta === undefined)

View File

@ -298,10 +298,6 @@ var Device = GObject.registerClass({
const supported = [];
for (const name in imports.service.plugins) {
// Exclude mousepad/presenter plugins in unsupported sessions
if (!HAVE_REMOTEINPUT && ['mousepad', 'presenter'].includes(name))
continue;
const meta = imports.service.plugins[name].Metadata;
if (meta === undefined)

View File

@ -99,13 +99,7 @@ for (const path of [Config.CACHEDIR, Config.CONFIGDIR, Config.RUNTIMEDIR])
GLib.mkdir_with_parents(path, 0o755);
/**
* Check if we're in a Wayland session (mostly for input synthesis)
* https://wiki.gnome.org/Accessibility/Wayland#Bugs.2FIssues_We_Must_Address
*/
globalThis.HAVE_REMOTEINPUT = GLib.getenv('GDMSESSION') !== 'ubuntu-wayland';
globalThis.HAVE_WAYLAND = GLib.getenv('XDG_SESSION_TYPE') === 'wayland';
globalThis.HAVE_GNOME = GLib.getenv('GNOME_SETUP_DISPLAY') !== null;
globalThis.HAVE_GNOME = GLib.getenv('GSCONNECT_MODE')?.toLowerCase() !== 'cli' && (GLib.getenv('GNOME_SETUP_DISPLAY') !== null || GLib.getenv('XDG_CURRENT_DESKTOP')?.toUpperCase()?.includes('GNOME') || GLib.getenv('XDG_SESSION_DESKTOP')?.toLowerCase() === 'gnome');
/**