[Users] [Bug 4680] New: Trayicon not updated

noreply at thewildbeast.co.uk noreply at thewildbeast.co.uk
Sun Jun 11 07:15:26 UTC 2023


https://www.thewildbeast.co.uk/claws-mail/bugzilla/show_bug.cgi?id=4680

            Bug ID: 4680
           Summary: Trayicon not updated
           Product: Claws Mail (GTK 2)
           Version: other
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P3
         Component: Plugins/Notification
          Assignee: users at lists.claws-mail.org
          Reporter: sjs at phelum.net

With gtk2 under buster (was okay with stretch) the trayicon is not updated
after the initial load at BOJ.  This appears to be a gtk bug rather than a
claws bug.  It is possible to overcome this bug by toggling the "visible"
attribute after changing the pixbuf for the icon.

diff --git a/src/plugins/notification/notification_trayicon.c
b/src/plugins/notification/notification_trayicon.c
index c35781f77..6dcb59f98 100644
--- a/src/plugins/notification/notification_trayicon.c
+++ b/src/plugins/notification/notification_trayicon.c
@@ -278,6 +278,7 @@ void notification_update_trayicon()
                        count.new_msgs, count.unread_msgs,
                        count.total_msgs);
   gtk_status_icon_set_tooltip_text(trayicon, buf);
+  debug_print("Notification plugin: tooltip updated (%s)\n", buf);

   g_free(buf);

@@ -300,11 +301,23 @@ void notification_update_trayicon()
     new_icon =
       notification_pixbuf_get(NOTIFICATION_TRAYICON_NOMAIL+offset);

+  debug_print("Notification plugin: icon was %d, now %d\n", old_icon,
new_icon);
   if(new_icon != old_icon) {
     gtk_status_icon_set_from_pixbuf(trayicon, new_icon);
+/*
+    gtk2 no longer (post stretch) updates the display when the icon is
changed.
+    So we hide and then display the icon to update the display.
+    There doesn't seem to be a "refresh" function that would do this less
clumsily.
+*/
+    gtk_status_icon_set_visible(trayicon, FALSE);
+    gtk_status_icon_set_visible(trayicon, TRUE);
+
+    debug_print("Notification plugin: icon updated\n");
     old_icon = new_icon;
   }
-}
+  else
+    debug_print("Notification plugin: icon already correct\n");
+  }

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Users mailing list