After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 776058 - Withdraw notifications when shuting down
Withdraw notifications when shuting down
Status: RESOLVED FIXED
Product: gnome-boxes
Classification: Applications
Component: general
3.23.x
Other Linux
: Normal normal
: --
Assigned To: GNOME Boxes maintainer(s)
GNOME Boxes maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2016-12-13 19:54 UTC by Felipe Borges
Modified: 2017-01-18 11:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
app: Add api to keep track of notifications (2.61 KB, patch)
2016-12-13 19:55 UTC, Felipe Borges
needs-work Details | Review
app: Withdraw notifications when shuting down (810 bytes, patch)
2016-12-13 19:55 UTC, Felipe Borges
none Details | Review
app: Withdraw system notifications when shutting down (2.87 KB, patch)
2017-01-17 15:15 UTC, Felipe Borges
needs-work Details | Review
app: Withdraw system notifications on exit (2.85 KB, patch)
2017-01-18 09:50 UTC, Felipe Borges
committed Details | Review

Description Felipe Borges 2016-12-13 19:54:48 UTC
.
Comment 1 Felipe Borges 2016-12-13 19:55:13 UTC
Created attachment 341910 [details] [review]
app: Add api to keep track of notifications

The HIG[0] says that "Notifications in GNOME 3 persist after they
have been initially displayed. It is therefore important to remove
notification messages that are no longer relevant to the user."

[0] https://developer.gnome.org/hig/stable/notifications.html.en
Comment 2 Felipe Borges 2016-12-13 19:55:19 UTC
Created attachment 341911 [details] [review]
app: Withdraw notifications when shuting down
Comment 4 Zeeshan Ali 2017-01-17 12:56:05 UTC
Review of attachment 341910 [details] [review]:

There is no API (not api) being added. Just "app: Keep track of notifications" is fine.

Nice description but would be good to first clarify what we are talking about (system notifications rather than in-app notifications) before diving into reasons.

Actually this is one of those rare moments where I'd recommend to merging the patch with the next one. We are not adding new API and it's very simple change so not worth having it's own patch IMO.
Comment 5 Zeeshan Ali 2017-01-17 12:57:02 UTC
Review of attachment 341910 [details] [review]:

::: src/app.vala
@@ +38,3 @@
     private HashTable<string,Broker> brokers;
     private HashTable<string,CollectionSource> sources;
+    private HashTable<string,GLib.Notification> notifications;

Let's name it 'system_notifications' to ensure no confusion with in-app notifications.
Comment 6 Zeeshan Ali 2017-01-17 12:59:36 UTC
Review of attachment 341911 [details] [review]:

typo: shutting.

::: src/app.vala
@@ +290,3 @@
         suspend_machines ();
+
+        // withdraw all the existing notifications

nitpick: Capitalize first letter please.

@@ +291,3 @@
+
+        // withdraw all the existing notifications
+        foreach (var notification_id in notifications.get_keys ())

If we are not gonna make use of access by ID, no point in having this as hashtable. Just use a GLib.List.
Comment 7 Felipe Borges 2017-01-17 15:15:05 UTC
Created attachment 343659 [details] [review]
app: Withdraw system notifications when shutting down

This patch keeps track of the system notifications as they appear
and withdraws them when the application quits.

The HIG[0] says that "Notifications in GNOME 3 persist after they
have been initially displayed. It is therefore important to remove
notification messages that are no longer relevant to the user."

[0] https://developer.gnome.org/hig/stable/notifications.html.en
Comment 8 Zeeshan Ali 2017-01-18 09:40:41 UTC
Review of attachment 343659 [details] [review]:

Boxes deals with VMs so "shutdown" is ambiguous here, let's "when shutting down" -> "on exit". It'll also make it fit 50 chars.

::: src/app.vala
@@ +294,3 @@
+
+        // Withdraw all the existing notifications
+        foreach (var notification_id in system_notifications)

there is no ID involved anymore.
Comment 9 Felipe Borges 2017-01-18 09:50:28 UTC
Created attachment 343698 [details] [review]
app: Withdraw system notifications on exit

This patch keeps track of the system notifications as they appear
and withdraws them when the application quits.

The HIG[0] says that "Notifications in GNOME 3 persist after they
have been initially displayed. It is therefore important to remove
notification messages that are no longer relevant to the user."

[0] https://developer.gnome.org/hig/stable/notifications.html.en
Comment 10 Zeeshan Ali 2017-01-18 11:32:38 UTC
Review of attachment 343698 [details] [review]:

ack
Comment 11 Felipe Borges 2017-01-18 11:41:28 UTC
Thank you!

Attachment 343698 [details] pushed as d6e5294 - app: Withdraw system notifications on exit