cleanup: Stop using Mainloop module

It is deprecated in favor of the regular GLib functions.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/718
This commit is contained in:
Florian Müllner
2019-08-19 20:50:33 +02:00
parent 4525ad346d
commit 2fc4987c73
30 changed files with 151 additions and 165 deletions

View File

@ -2,8 +2,7 @@
imports.gi.versions.Gtk = '3.0';
const Gtk = imports.gi.Gtk;
const Mainloop = imports.mainloop;
const { GLib, Gtk } = imports.gi;
function nextTitle() {
let length = Math.random() * 20;
@ -26,7 +25,7 @@ function main() {
});
win.present();
Mainloop.timeout_add(5000, function() {
GLib.timeout_add(GLib.PRIORITY_DEFAULT, 5000, function() {
win.title = nextTitle();
return true;
});