From 08fb067d2428e10cf0f7f6ee4848e07879d821d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Thu, 6 May 2021 22:31:11 +0200 Subject: [PATCH] js: Get idle monitor from backend Its ownership has moved from dangeling to owned by the backend, which has reflected the API is accessible by. Adapt to this change. Part-of: --- js/ui/magnifier.js | 2 +- js/ui/messageTray.js | 2 +- js/ui/pointerWatcher.js | 4 ++-- js/ui/screenShield.js | 2 +- js/ui/unlockDialog.js | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/js/ui/magnifier.js b/js/ui/magnifier.js index 75cc1f901..d818a75b0 100644 --- a/js/ui/magnifier.js +++ b/js/ui/magnifier.js @@ -750,7 +750,7 @@ var ZoomRegion = class ZoomRegion { this._xCaret = 0; this._yCaret = 0; - this._pointerIdleMonitor = Meta.IdleMonitor.get_core(); + this._pointerIdleMonitor = global.backend.get_core_idle_monitor(); this._scrollContentsTimerId = 0; } diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js index 1dab00a70..b793f8a16 100644 --- a/js/ui/messageTray.js +++ b/js/ui/messageTray.js @@ -855,7 +855,7 @@ var MessageTray = GObject.registerClass({ this._userActiveWhileNotificationShown = false; - this.idleMonitor = Meta.IdleMonitor.get_core(); + this.idleMonitor = global.backend.get_core_idle_monitor(); this._useLongerNotificationLeftTimeout = false; diff --git a/js/ui/pointerWatcher.js b/js/ui/pointerWatcher.js index 9dbdcf623..2af35b617 100644 --- a/js/ui/pointerWatcher.js +++ b/js/ui/pointerWatcher.js @@ -1,7 +1,7 @@ // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- /* exported getPointerWatcher */ -const { GLib, Meta } = imports.gi; +const { GLib } = imports.gi; // We stop polling if the user is idle for more than this amount of time var IDLE_TIME = 1000; @@ -35,7 +35,7 @@ var PointerWatch = class { var PointerWatcher = class { constructor() { - this._idleMonitor = Meta.IdleMonitor.get_core(); + this._idleMonitor = global.backend.get_core_idle_monitor(); this._idleMonitor.add_idle_watch(IDLE_TIME, this._onIdleMonitorBecameIdle.bind(this)); this._idle = this._idleMonitor.get_idletime() > IDLE_TIME; this._watches = []; diff --git a/js/ui/screenShield.js b/js/ui/screenShield.js index 9a64fc32c..a1b32aa6b 100644 --- a/js/ui/screenShield.js +++ b/js/ui/screenShield.js @@ -138,7 +138,7 @@ var ScreenShield = class { fadeFactor: 1 }); this._shortLightbox.connect('notify::active', this._onShortLightbox.bind(this)); - this.idleMonitor = Meta.IdleMonitor.get_core(); + this.idleMonitor = global.backend.get_core_idle_monitor(); this._cursorTracker = Meta.CursorTracker.get_for_display(global.display); this._syncInhibitor(); diff --git a/js/ui/unlockDialog.js b/js/ui/unlockDialog.js index 8ddae8b03..239e75ef5 100644 --- a/js/ui/unlockDialog.js +++ b/js/ui/unlockDialog.js @@ -348,7 +348,7 @@ class UnlockDialogClock extends St.BoxLayout { this._powerModeChangedId = this._monitorManager.connect( 'power-save-mode-changed', () => (this._hint.opacity = 0)); - this._idleMonitor = Meta.IdleMonitor.get_core(); + this._idleMonitor = global.backend.get_core_idle_monitor(); this._idleWatchId = this._idleMonitor.add_idle_watch(HINT_TIMEOUT * 1000, () => { this._hint.ease({ opacity: 255, @@ -594,7 +594,7 @@ var UnlockDialog = GObject.registerClass({ this._otherUserButton); this.add_child(mainBox); - this._idleMonitor = Meta.IdleMonitor.get_core(); + this._idleMonitor = global.backend.get_core_idle_monitor(); this._idleWatchId = this._idleMonitor.add_idle_watch(IDLE_TIMEOUT * 1000, this._escape.bind(this)); this.connect('destroy', this._onDestroy.bind(this));