Merge lp:~donadigo/wingpanel-indicator-notifications/fix-1649406-not-close-withdrawal into lp:~wingpanel-devs/wingpanel-indicator-notifications/wingpanel-indicator-notifications

Proposed by Adam Bieńkowski on 2017-01-01
Status: Needs review
Proposed branch: lp:~donadigo/wingpanel-indicator-notifications/fix-1649406-not-close-withdrawal
Merge into: lp:~wingpanel-devs/wingpanel-indicator-notifications/wingpanel-indicator-notifications
Diff against target: 37 lines (+11/-1)
1 file modified
src/Indicator.vala (+11/-1)
To merge this branch: bzr merge lp:~donadigo/wingpanel-indicator-notifications/fix-1649406-not-close-withdrawal
Reviewer Review Type Date Requested Status
WingPanel Devs 2017-01-01 Pending
Review via email: mp+313939@code.launchpad.net

Commit message

* Fix popover closing when withdrawal happens

Description of the change

This branch fixes bug #1649406: "Do not close if currently opened".

When the notification is requested a withdrawal, do not close the popover as it's not a user action, other actions such as "clearing all", or closing the popover by the user are allowed.

To post a comment you must log in.

Unmerged revisions

132. By Adam Bieńkowski on 2017-01-01

Disallow closing popover from NotificationsList when withdrawal happens

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Indicator.vala'
2--- src/Indicator.vala 2016-12-12 18:59:44 +0000
3+++ src/Indicator.vala 2017-01-01 16:43:18 +0000
4@@ -34,6 +34,7 @@
5 private NotificationsList nlist;
6
7 private Gee.HashMap<string, Settings> app_settings_cache;
8+ private bool is_withdrawing = false;
9
10 public Indicator () {
11 Object (code_name: Wingpanel.Indicator.MESSAGES,
12@@ -100,7 +101,14 @@
13 var settings_btn = new Wingpanel.Widgets.Button (_("Notifications Settings…"));
14 settings_btn.clicked.connect (show_settings);
15
16- nlist.close_popover.connect (() => close ());
17+ nlist.close_popover.connect (() => {
18+ if (is_withdrawing) {
19+ return;
20+ }
21+
22+ close ();
23+ });
24+
25 nlist.switch_stack.connect (on_switch_stack);
26
27 var monitor = NotificationMonitor.get_instance ();
28@@ -178,7 +186,9 @@
29 foreach (var app_entry in nlist.get_entries ()) {
30 foreach (var item in app_entry.app_notifications) {
31 if (item.notification.id == id) {
32+ is_withdrawing = true;
33 item.notification.close ();
34+ is_withdrawing = false;
35 return;
36 }
37 }

Subscribers

People subscribed via source and target branches

to all changes: