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
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 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

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
=== modified file 'src/Indicator.vala'
--- src/Indicator.vala 2016-12-12 18:59:44 +0000
+++ src/Indicator.vala 2017-01-01 16:43:18 +0000
@@ -34,6 +34,7 @@
34 private NotificationsList nlist;34 private NotificationsList nlist;
3535
36 private Gee.HashMap<string, Settings> app_settings_cache;36 private Gee.HashMap<string, Settings> app_settings_cache;
37 private bool is_withdrawing = false;
3738
38 public Indicator () {39 public Indicator () {
39 Object (code_name: Wingpanel.Indicator.MESSAGES,40 Object (code_name: Wingpanel.Indicator.MESSAGES,
@@ -100,7 +101,14 @@
100 var settings_btn = new Wingpanel.Widgets.Button (_("Notifications Settings…"));101 var settings_btn = new Wingpanel.Widgets.Button (_("Notifications Settings…"));
101 settings_btn.clicked.connect (show_settings);102 settings_btn.clicked.connect (show_settings);
102103
103 nlist.close_popover.connect (() => close ());104 nlist.close_popover.connect (() => {
105 if (is_withdrawing) {
106 return;
107 }
108
109 close ();
110 });
111
104 nlist.switch_stack.connect (on_switch_stack);112 nlist.switch_stack.connect (on_switch_stack);
105113
106 var monitor = NotificationMonitor.get_instance ();114 var monitor = NotificationMonitor.get_instance ();
@@ -178,7 +186,9 @@
178 foreach (var app_entry in nlist.get_entries ()) {186 foreach (var app_entry in nlist.get_entries ()) {
179 foreach (var item in app_entry.app_notifications) {187 foreach (var item in app_entry.app_notifications) {
180 if (item.notification.id == id) {188 if (item.notification.id == id) {
189 is_withdrawing = true;
181 item.notification.close ();190 item.notification.close ();
191 is_withdrawing = false;
182 return;192 return;
183 }193 }
184 }194 }

Subscribers

People subscribed via source and target branches

to all changes: