Merge lp:~tkluck/ubuntu/precise/gnome-shell/lp883443 into lp:ubuntu/precise/gnome-shell

Proposed by Timo Kluck on 2012-03-20
Status: Work in progress
Proposed branch: lp:~tkluck/ubuntu/precise/gnome-shell/lp883443
Merge into: lp:ubuntu/precise/gnome-shell
Diff against target: 100 lines (+46/-3)
5 files modified
.pc/applied-patches (+1/-0)
debian/changelog (+10/-0)
debian/patches/12-let-transient-critical-notifications-expire.patch (+31/-0)
debian/patches/series (+1/-0)
js/ui/messageTray.js (+3/-3)
To merge this branch: bzr merge lp:~tkluck/ubuntu/precise/gnome-shell/lp883443
Reviewer Review Type Date Requested Status
Mathieu Trudel-Lapierre Disapprove on 2012-03-28
Jeremy Bicha 2012-03-21 Pending
Ubuntu branches 2012-03-20 Pending
Review via email: mp+98471@code.launchpad.net

Description of the Change

This fixes #883443. Testcase:

send a critical, transient message:

$ notify-send -u critical -h int:transient:1 "blabla"

it will never disappear in gnome-shell. In ubuntu-patched network-manager, a network disconnect leads to such a message. It will even reappear after suspend/hibernate etc (even if the networking situation has changed any number of times in between), which is very confusing. The patch makes sure that critical, transient messages behave as if they are urgency=normal messages. They will show for 4 seconds and then disappear.

I am not aware of any other critical, transient messages, and it seems contrary to the spirit of messaging in gnome-shell. So this should probably be patched on the ubuntu side.

To post a comment you must log in.
49. By Timo Kluck on 2012-03-20

 - Treat transient, critical notifications the same as non-critical
   ones (notably the ubuntu-specific one that says "network disconnected,
   you are now offline") Closes: #883443
*

Luke Yelavich (themuso) wrote :

Jeremy, since you work on gnome-shell a fair bit, could you please have a look at this?

Mathieu Trudel-Lapierre (cyphermox) wrote :

I'll NAK this based on the discussion with upstream; it should be fixed in nm-applet instead, I'll make sure we drop the urgency of the disconnect messages to NORMAL or something to avoid it sticking around.

review: Disapprove

Unmerged revisions

49. By Timo Kluck on 2012-03-20

 - Treat transient, critical notifications the same as non-critical
   ones (notably the ubuntu-specific one that says "network disconnected,
   you are now offline") Closes: #883443
*

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.pc/applied-patches'
2--- .pc/applied-patches 2012-03-14 13:47:20 +0000
3+++ .pc/applied-patches 2012-03-20 18:32:20 +0000
4@@ -1,2 +1,3 @@
5 04_remove-glx-dependency-on-armel.patch
6 11-no-gettext.patch
7+12-let-transient-critical-notifications-expire.patch
8
9=== modified file 'debian/changelog'
10--- debian/changelog 2012-03-14 13:47:20 +0000
11+++ debian/changelog 2012-03-20 18:32:20 +0000
12@@ -1,3 +1,13 @@
13+gnome-shell (3.3.90-0ubuntu2) precise; urgency=low
14+
15+ * debian/12-let-transient-critical-notifications-expire.patch:
16+ - Treat transient, critical notifications the same as non-critical
17+ ones (notably the ubuntu-specific one that says "network disconnected,
18+ you are now offline") Closes: #883443
19+ *
20+
21+ -- Timo Kluck <tkluck@infty.nl> Tue, 20 Mar 2012 18:59:57 +0100
22+
23 gnome-shell (3.3.90-0ubuntu1) precise; urgency=low
24
25 * Sync with Debian experimental svn packaging (LP: #941755, #937709).
26
27=== added file 'debian/patches/12-let-transient-critical-notifications-expire.patch'
28--- debian/patches/12-let-transient-critical-notifications-expire.patch 1970-01-01 00:00:00 +0000
29+++ debian/patches/12-let-transient-critical-notifications-expire.patch 2012-03-20 18:32:20 +0000
30@@ -0,0 +1,31 @@
31+Index: gnome-shell/js/ui/messageTray.js
32+===================================================================
33+--- gnome-shell.orig/js/ui/messageTray.js 2012-03-17 22:29:31.736548539 +0100
34++++ gnome-shell/js/ui/messageTray.js 2012-03-20 18:34:06.452566807 +0100
35+@@ -1978,7 +1978,7 @@
36+ let notificationsPending = this._notificationQueue.length > 0 && (!this._busy || notificationUrgent);
37+ let notificationPinned = this._pointerInTray && !this._pointerInSummary && !this._notificationRemoved;
38+ let notificationExpanded = this._notificationBin.y < 0;
39+- let notificationExpired = (this._notificationTimeoutId == 0 && !(this._notification && this._notification.urgency == Urgency.CRITICAL) && !this._pointerInTray && !this._locked && !(this._pointerInKeyboard && notificationExpanded)) || this._notificationRemoved;
40++ let notificationExpired = (this._notificationTimeoutId == 0 && !(this._notification && this._notification.urgency == Urgency.CRITICAL && !this._notification.isTransient) && !this._pointerInTray && !this._locked && !(this._pointerInKeyboard && notificationExpanded)) || this._notificationRemoved;
41+ let canShowNotification = notificationsPending && this._summaryState == State.HIDDEN;
42+
43+ if (this._notificationState == State.HIDDEN) {
44+@@ -2142,7 +2142,7 @@
45+ // notification we are updating, in case that notification was already expanded and its height
46+ // changed. Therefore we need to call this._expandNotification() for expanded notifications
47+ // to make sure their position is updated.
48+- if (this._notification.urgency == Urgency.CRITICAL || this._notification.expanded)
49++ if ((this._notification.urgency == Urgency.CRITICAL && !this._notification.isTransient) || this._notification.expanded)
50+ this._expandNotification(true);
51+
52+ // We tween all notifications to full opacity. This ensures that both new notifications and
53+@@ -2171,7 +2171,7 @@
54+ },
55+
56+ _showNotificationCompleted: function() {
57+- if (this._notification.urgency != Urgency.CRITICAL)
58++ if (this._notification.urgency != Urgency.CRITICAL || this._notification.isTransient)
59+ this._updateNotificationTimeout(NOTIFICATION_TIMEOUT * 1000);
60+ },
61+
62
63=== modified file 'debian/patches/series'
64--- debian/patches/series 2012-03-14 13:47:20 +0000
65+++ debian/patches/series 2012-03-20 18:32:20 +0000
66@@ -1,3 +1,4 @@
67 04_remove-glx-dependency-on-armel.patch
68 #10-make-NetworkManager-optional.patch
69 11-no-gettext.patch
70+12-let-transient-critical-notifications-expire.patch
71
72=== modified file 'js/ui/messageTray.js'
73--- js/ui/messageTray.js 2012-03-14 13:47:20 +0000
74+++ js/ui/messageTray.js 2012-03-20 18:32:20 +0000
75@@ -1978,7 +1978,7 @@
76 let notificationsPending = this._notificationQueue.length > 0 && (!this._busy || notificationUrgent);
77 let notificationPinned = this._pointerInTray && !this._pointerInSummary && !this._notificationRemoved;
78 let notificationExpanded = this._notificationBin.y < 0;
79- let notificationExpired = (this._notificationTimeoutId == 0 && !(this._notification && this._notification.urgency == Urgency.CRITICAL) && !this._pointerInTray && !this._locked && !(this._pointerInKeyboard && notificationExpanded)) || this._notificationRemoved;
80+ let notificationExpired = (this._notificationTimeoutId == 0 && !(this._notification && this._notification.urgency == Urgency.CRITICAL && !this._notification.isTransient) && !this._pointerInTray && !this._locked && !(this._pointerInKeyboard && notificationExpanded)) || this._notificationRemoved;
81 let canShowNotification = notificationsPending && this._summaryState == State.HIDDEN;
82
83 if (this._notificationState == State.HIDDEN) {
84@@ -2142,7 +2142,7 @@
85 // notification we are updating, in case that notification was already expanded and its height
86 // changed. Therefore we need to call this._expandNotification() for expanded notifications
87 // to make sure their position is updated.
88- if (this._notification.urgency == Urgency.CRITICAL || this._notification.expanded)
89+ if ((this._notification.urgency == Urgency.CRITICAL && !this._notification.isTransient) || this._notification.expanded)
90 this._expandNotification(true);
91
92 // We tween all notifications to full opacity. This ensures that both new notifications and
93@@ -2171,7 +2171,7 @@
94 },
95
96 _showNotificationCompleted: function() {
97- if (this._notification.urgency != Urgency.CRITICAL)
98+ if (this._notification.urgency != Urgency.CRITICAL || this._notification.isTransient)
99 this._updateNotificationTimeout(NOTIFICATION_TIMEOUT * 1000);
100 },
101

Subscribers

People subscribed via source and target branches

to all changes: