refactor: port away from Mainloop

This commit is contained in:
Andy Holmes
2023-09-21 19:22:31 -07:00
parent b0114216a2
commit 08bd792ae7
5 changed files with 42 additions and 36 deletions

View File

@@ -34,7 +34,6 @@ import * as Main from 'resource:///org/gnome/shell/ui/main.js';
import * as MessageTray from 'resource:///org/gnome/shell/ui/messageTray.js';
const Gi = imports._gi;
const Mainloop = imports.mainloop;
var SCROLL_TIME = Util.SCROLL_TIME / (Util.SCROLL_TIME > 1 ? 1000 : 1);
@@ -165,9 +164,11 @@ export const TimeoutsHandler = class extends BasicHandler {
this._remove(item);
this[name] = Mainloop.timeout_add(delay, () => {
this[name] = GLib.timeout_add(GLib.PRIORITY_DEFAULT, delay, () => {
this[name] = 0;
timeoutHandler();
return GLib.SOURCE_REMOVE;
});
return [[name]];
@@ -181,7 +182,7 @@ export const TimeoutsHandler = class extends BasicHandler {
let name = item[0];
if (this[name]) {
Mainloop.source_remove(this[name]);
GLib.Source.remove(this[name]);
this[name] = 0;
}
}