diff options
Diffstat (limited to 'plugins/Toaster/src/services.cpp')
-rw-r--r-- | plugins/Toaster/src/services.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/plugins/Toaster/src/services.cpp b/plugins/Toaster/src/services.cpp index a2747758e8..9c3d4b12bd 100644 --- a/plugins/Toaster/src/services.cpp +++ b/plugins/Toaster/src/services.cpp @@ -111,14 +111,7 @@ static INT_PTR PopupQuery(WPARAM wParam, LPARAM) {
bool enabled = db_get_b(0, "Popup", "ModuleIsEnabled", 1) != 0;
if (enabled) db_set_b(0, "Popup", "ModuleIsEnabled", 0);
-
- mir_cslock lck(csNotifications);
- while (lstNotifications.getCount())
- {
- lstNotifications[0].Hide();
- lstNotifications.remove(0);
- }
-
+ HideAllToasts();
return enabled;
}
break;
@@ -131,6 +124,16 @@ static INT_PTR PopupQuery(WPARAM wParam, LPARAM) }
}
+void HideAllToasts()
+{
+ mir_cslock lck(csNotifications);
+ while (lstNotifications.getCount())
+ {
+ lstNotifications[0].Hide();
+ lstNotifications.remove(0);
+ }
+}
+
void InitServices()
{
CreateServiceFunction(MS_POPUP_ADDPOPUP, CreatePopup);
|