Skip to content

Commit

Permalink
messageTray.js and cs_notifications.py: Add an option for showing not…
Browse files Browse the repository at this point in the history
…ifications in fullscreen (#11844)
  • Loading branch information
rcalixte authored Nov 27, 2024
1 parent ec2ecf8 commit 93bce8e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,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")

Expand Down
4 changes: 3 additions & 1 deletion js/ui/messageTray.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down

0 comments on commit 93bce8e

Please sign in to comment.