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

Closes #9529
  • Loading branch information
rcalixte committed Aug 29, 2024
1 parent c7eedb1 commit c618e77
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 @@ -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")

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 c618e77

Please sign in to comment.