First try for Gnome Shell 45
This commit is contained in:
parent
3ed3394a33
commit
63e48d7c8a
58
extension.js
58
extension.js
|
@ -29,17 +29,17 @@
|
|||
https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/panel.js
|
||||
*/
|
||||
|
||||
const St = imports.gi.St;
|
||||
const Gio = imports.gi.Gio;
|
||||
const GLib = imports.gi.GLib
|
||||
const Main = imports.ui.main;
|
||||
const Mainloop = imports.mainloop;
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const PanelMenu = imports.ui.panelMenu;
|
||||
const PopupMenu = imports.ui.popupMenu;
|
||||
const GObject = imports.gi.GObject;
|
||||
const Pixbuf = imports.gi.GdkPixbuf;
|
||||
const Cogl = imports.gi.Cogl;
|
||||
import St from 'gi://St';
|
||||
import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import Main from 'resource:///org/gnome/shell/ui/main.js';
|
||||
import Clutter from 'gi://Clutter';
|
||||
import PanelMenu from 'resource:///org/gnome/shell/ui/panelMenu.js';
|
||||
import PopupMenu from 'resource:///org/gnome/shell/ui/popupMenu.js';
|
||||
import GObject from 'gi://GObject';
|
||||
import Pixbuf from 'gi://GdkPixbuf';
|
||||
import Cogl from 'gi://Cogl';
|
||||
import Extension from 'resource:///org/gnome/shell/extensions/extension.js';
|
||||
|
||||
|
||||
function hashGet(hash, key, defaultValue) {
|
||||
|
@ -50,7 +50,7 @@ function hashGet(hash, key, defaultValue) {
|
|||
}
|
||||
|
||||
function log(message) {
|
||||
global.log('[GenericMontior]', message);
|
||||
console.error('[GenericMontior]', message);
|
||||
}
|
||||
|
||||
|
||||
|
@ -189,7 +189,8 @@ class SignalMgt {
|
|||
this.button = event.get_button();
|
||||
this.nbClicks = 1;
|
||||
|
||||
let sourceId = Mainloop.timeout_add(this.dbus.ClutterSettings['double-click-time'],
|
||||
let sourceId = Glib.timeout_add(Glib.G_PRIORITY_DEFAULT,
|
||||
this.dbus.ClutterSettings['double-click-time'],
|
||||
this._doClickCallback.bind(this));
|
||||
this.timeouts.push(sourceId);
|
||||
}
|
||||
|
@ -556,13 +557,13 @@ class MonitorWidget extends PanelMenu.Button {
|
|||
// From https://github.com/ubuntu/gnome-shell-extension-appindicator/blob/master/interfaces.js
|
||||
// loads a xml file into an in-memory string
|
||||
function loadInterfaceXml(filename) {
|
||||
const extension = imports.misc.extensionUtils.getCurrentExtension();
|
||||
const extension = Extension.getCurrentExtension();
|
||||
|
||||
const interfacesDir = extension.dir.get_child('.');
|
||||
|
||||
const file = interfacesDir.get_child(filename);
|
||||
|
||||
let [result, contents] = imports.gi.GLib.file_get_contents(file.get_path());
|
||||
let [result, contents] = GLib.file_get_contents(file.get_path());
|
||||
|
||||
if (result) {
|
||||
// HACK: The "" + trick is important as hell because file_get_contents returns
|
||||
|
@ -799,30 +800,21 @@ class GenericMonitorDBUS {
|
|||
}
|
||||
}
|
||||
|
||||
class Extension {
|
||||
export default class GenericMonitorExtension {
|
||||
constructor(...args) {
|
||||
super(...args);
|
||||
this.textDBusService = null;
|
||||
}
|
||||
|
||||
enable() {
|
||||
this.textDBusService = new GenericMonitorDBUS();
|
||||
}
|
||||
|
||||
disable() {
|
||||
if (this.textDBusService !== null) {
|
||||
this.textDBusService.destructor();
|
||||
delete this.textDBusService;
|
||||
}
|
||||
}
|
||||
|
||||
let extension = null;
|
||||
|
||||
function init() {
|
||||
}
|
||||
|
||||
function enable() {
|
||||
extension = new Extension();
|
||||
extension.enable();
|
||||
}
|
||||
|
||||
function disable() {
|
||||
if (extension) {
|
||||
extension.disable();
|
||||
extension = null;
|
||||
this.textDBusService = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,13 +2,9 @@
|
|||
"uuid": "generic-monitor@gnome-shell-extensions",
|
||||
"name": "Generic Monitor",
|
||||
"description": "Display text & icon on systray using DBUS",
|
||||
"version": "13",
|
||||
"version": "14",
|
||||
"shell-version": [
|
||||
"44",
|
||||
"43",
|
||||
"42.3",
|
||||
"42",
|
||||
"41"
|
||||
"45"
|
||||
],
|
||||
"url": "http://indefero.soutade.fr/p/genericmonitor"
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user