From af8d9c0bd81880115786793c55abeb3da3fc3681 Mon Sep 17 00:00:00 2001 From: Rick Calixte <10281587+rcalixte@users.noreply.github.com> Date: Fri, 1 Sep 2023 15:05:12 -0400 Subject: [PATCH] messageTray.js and cs_notifications.py: Add an option for showing notifications in fullscreen Closes #9529 --- .../cinnamon/cinnamon-settings/modules/cs_notifications.py | 3 +++ js/ui/messageTray.js | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/files/usr/share/cinnamon/cinnamon-settings/modules/cs_notifications.py b/files/usr/share/cinnamon/cinnamon-settings/modules/cs_notifications.py index 24b4199c37..0515b6711a 100755 --- a/files/usr/share/cinnamon/cinnamon-settings/modules/cs_notifications.py +++ b/files/usr/share/cinnamon/cinnamon-settings/modules/cs_notifications.py @@ -76,6 +76,9 @@ def on_module_selected(self): spin.revealer.settings = Gio.Settings("org.cinnamon.desktop.notifications") spin.revealer.settings.bind_with_mapping("notification-screen-display", spin.revealer, "reveal-child", Gio.SettingsBindFlags.GET, lambda option: option == "fixed-screen", None) + switch = GSettingsSwitch(_("Display notifications over fullscreen windows (experimental)"), "org.cinnamon.desktop.notifications", "fullscreen-notifications") + settings.add_reveal_row(switch, "org.cinnamon.desktop.notifications", "display-notifications") + spin = GSettingsSpinButton(_("Notification duration"), "org.cinnamon.desktop.notifications", "notification-duration", _("seconds"), 1, 60, 1, 1) settings.add_reveal_row(spin, "org.cinnamon.desktop.notifications", "display-notifications") diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js index e4be15442b..53ee6e024d 100644 --- a/js/ui/messageTray.js +++ b/js/ui/messageTray.js @@ -993,7 +993,9 @@ MessageTray.prototype = { if (!this._notification.silent || this._notification.urgency >= Urgency.HIGH) { Main.soundManager.play('notification'); } - if (this._notification.urgency == Urgency.CRITICAL) { + + this._showFullscreenNotifications = this.settings.get_boolean("fullscreen-notifications"); + if (this._notification.urgency == Urgency.CRITICAL || this._showFullscreenNotifications) { Main.layoutManager._chrome.modifyActorParams(this._notificationBin, { visibleInFullscreen: true }); } else { Main.layoutManager._chrome.modifyActorParams(this._notificationBin, { visibleInFullscreen: false });