[gnome-shell/gnome-40] lockScreen: Don't wake up screen in DND mode
- From: Robert Mader <rmader src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gnome-40] lockScreen: Don't wake up screen in DND mode
- Date: Sun, 9 Jan 2022 21:03:41 +0000 (UTC)
commit 51c67b181e541cd36fa013fff5244551b70e6a0b
Author: kyte <kyteinsky gmail com>
Date: Sat Nov 27 13:20:23 2021 +0530
lockScreen: Don't wake up screen in DND mode
Screen woke up whenever a new notification popped up
on lock screen even when DND was turned on.
This commit changes this behaviour to not wake
the screen up in such case.
https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4710
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2051>
(cherry picked from commit 920714008c1eb04e5d757de6c249c57defbd8fa3)
js/ui/unlockDialog.js | 21 +++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)
---
diff --git a/js/ui/unlockDialog.js b/js/ui/unlockDialog.js
index 8ddae8b036..5b55cb08a5 100644
--- a/js/ui/unlockDialog.js
+++ b/js/ui/unlockDialog.js
@@ -46,6 +46,10 @@ var NotificationsBox = GObject.registerClass({
this.add_child(this._scrollView);
+ this._settings = new Gio.Settings({
+ schema_id: 'org.gnome.desktop.notifications',
+ });
+
this._sources = new Map();
Main.messageTray.getSources().forEach(source => {
this._sourceAdded(Main.messageTray, source, true);
@@ -176,6 +180,14 @@ var NotificationsBox = GObject.registerClass({
this._updateSourceBoxStyle(source, obj, box);
}
+ _wakeUpScreenForSource(source) {
+ if (!this._settings.get_boolean('show-banners'))
+ return;
+ const obj = this._sources.get(source);
+ if (obj?.sourceBox.visible)
+ this.emit('wake-up-screen');
+ }
+
_sourceAdded(tray, source, initial) {
let obj = {
visible: source.policy.showInLockScreen,
@@ -235,8 +247,7 @@ var NotificationsBox = GObject.registerClass({
});
this._updateVisibility();
- if (obj.sourceBox.visible)
- this.emit('wake-up-screen');
+ this._wakeUpScreenForSource(source);
}
}
@@ -268,8 +279,7 @@ var NotificationsBox = GObject.registerClass({
obj.sourceBox.visible = obj.visible && (source.unseenCount > 0);
this._updateVisibility();
- if (obj.sourceBox.visible)
- this.emit('wake-up-screen');
+ this._wakeUpScreenForSource(source);
}
_visibleChanged(source, obj) {
@@ -280,8 +290,7 @@ var NotificationsBox = GObject.registerClass({
obj.sourceBox.visible = obj.visible && source.unseenCount > 0;
this._updateVisibility();
- if (obj.sourceBox.visible)
- this.emit('wake-up-screen');
+ this._wakeUpScreenForSource(source);
}
_detailedChanged(source, obj) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]