[gnome-flashback] notifications: don't crash if last monitor was removed



commit 3865a900a5d9ef42ef60bd43a54376d488d1f131
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Sun Feb 9 14:45:52 2020 +0200

    notifications: don't crash if last monitor was removed

 gnome-flashback/libnotifications/nd-queue.c | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/gnome-flashback/libnotifications/nd-queue.c b/gnome-flashback/libnotifications/nd-queue.c
index 9f4fc1b..a77e1c0 100644
--- a/gnome-flashback/libnotifications/nd-queue.c
+++ b/gnome-flashback/libnotifications/nd-queue.c
@@ -121,6 +121,12 @@ monitor_removed_cb (GdkDisplay *display,
         stack = g_hash_table_lookup (nscreen->stacks, monitor);
         focused_stack = get_stack_with_pointer (queue);
 
+        if (focused_stack == NULL) {
+                g_hash_table_remove (nscreen->stacks, monitor);
+                queue_update (queue);
+                return;
+        }
+
         bubbles = g_list_copy (nd_stack_get_bubbles (stack));
         for (l = bubbles; l != NULL; l = l->next) {
                 /* skip removing the bubble from the


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]