js: Queue 'later' via MetaLaters

This replaces the meta_later_add() API which used now removed global
singletons under the hood.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2557>
This commit is contained in:
Jonas Ådahl
2022-09-07 20:23:38 +02:00
parent 387317aadc
commit 8d68bdaaa1
18 changed files with 66 additions and 33 deletions

View File

@ -188,7 +188,8 @@ var MessageDialogContent = GObject.registerClass({
_onDestroy() {
if (this._updateTitleStyleLater) {
Meta.later_remove(this._updateTitleStyleLater);
const laters = global.compositor.get_laters();
laters.remove(this._updateTitleStyleLater);
delete this._updateTitleStyleLater;
}
}
@ -212,7 +213,8 @@ var MessageDialogContent = GObject.registerClass({
if (this._updateTitleStyleLater)
return;
this._updateTitleStyleLater = Meta.later_add(Meta.LaterType.BEFORE_REDRAW, () => {
const laters = global.compositor.get_laters();
this._updateTitleStyleLater = laters.add(Meta.LaterType.BEFORE_REDRAW, () => {
this._updateTitleStyleLater = 0;
this._title.add_style_class_name('lightweight');
return GLib.SOURCE_REMOVE;