AyatanaIndicators / ayatana-webmail

Webmail notifications and actions for any desktop
GNU General Public License v3.0
8 stars 4 forks source link

tray icon should show whether unread messages are available #24

Closed IngoMeyer441 closed 2 years ago

IngoMeyer441 commented 2 years ago

First, thanks. This is a very useful project to watch mail accounts without using a full mail client. :slightly_smiling_face:

I use ayatana-webmail without ayatana-indicator-messages on Manjaro XFCE. For me, the tray icon always looks like this, independent of unread messages:

image

It would be nice, if the tray icon would change when unread mails are available.

IngoMeyer441 commented 2 years ago

Had a quick look at the code. Seems that changing the icon actually should work (https://github.com/AyatanaIndicators/ayatana-webmail/blob/21.11.17/ayatanawebmail/application.py#L288-L291):

            if len(self.oMenu.get_children()) - self.nMenuItems == 0:

                self.oIndicator.set_status(self.oAppIndicator.IndicatorStatus.ACTIVE)
                self.oMenuItemClear.set_sensitive(False)

Maybe this is a problem related to XFCE?

tari01 commented 2 years ago

@IngoMeyer441

The icon that you show above is actually ayatanawebmail-messages-new.svg, which is displayed when new messages are available. You should see these:

https://github.com/AyatanaIndicators/ayatana-webmail/tree/main/data/usr/share/icons/hicolor/scalable/status

Note that clearing messages does not mark them as read instantly - it happens the next time the IMAP server checks in (around 15-20 minutes usually).

IngoMeyer441 commented 2 years ago

Thanks for your fast reply @tari01. I marked all messages as read in an email client and restarted ayatana-webmail, but I always see ayatanawebmail-messages-new.svg even after waiting for some time.

tari01 commented 2 years ago

Hmm... Are you using ayatana-indicator-application or the old systray?

IngoMeyer441 commented 2 years ago

I use the old systray.

tari01 commented 2 years ago

I have tested it with ayatana-indicator-messages, ayatana-indicator-applicaton, and natively (the old Gtk.StatusIcon).

It changes the icon with the first two, but not with the last one. Since Gtk.StatusIcon is seriously deprecated, I am not going to support it any more (It's only a matter of time before Gtk drops it completely).

My advice is to run it with Ayatana Indicators - if you don't want the Messages indicator, it will happily fall back to the Application indicator.

I will close this now, but feel free to comment if you have any more questions/problems.

IngoMeyer441 commented 2 years ago

Thanks for looking into this. I also tried ayatana-indicator-messages first, but didn't get any panel icon at all. Then I realized that XFCE has no native support for indicators (AFAIK, this is integrated in Xubuntu by additional work from Canonical), so I tried the xfce4-indicator-plugin, but no luck (even with ayatana-indicator-applicaton). But I suspect this is a problem with XFCE on Manjaro... So for now I stick with the old GTK status icon.

tari01 commented 2 years ago

@IngoMeyer441

I am also using Manjaro - to make Ayatana work, I am maintaining mate-indicator-applet. Perhaps you could do the same with xfce4-indicator-plugin. The trick is to replace the old (and dead) Ubuntu indicator component names with Ayatana indicator component names in configure.ac.in.

Tamaranch commented 1 year ago

Hi, I am the maintainer of xfce4-panel. I come here after this bug report: https://gitlab.xfce.org/xfce/xfce4-panel/-/issues/726#note_68809. I think there is something to do here.

The systray plugin of xfce4-panel supports the X11 specific legacy protocol and the Status Notifier Item protocol. In this case Status Notifier is used, but the panel doesn't get a status update when a new mail arrives or when mails are marked as read. You have to restart the plugin or the panel to force the icon to be updated.

I could be wrong but by quickly tracing the problem I have the impression that it comes from your side. I use ayatana-webmail 22.12.15 on Arch Linux.

Tamaranch commented 1 year ago

Hmm I see, in fact you only emit the NewStatus signal, which xfce4-panel handles differently from other signals. Usually other apps also emit NewAttentionIcon and/or NewIcon when they change status, which the spec suggests: "The Freedesktop-compliant name of an icon. this can be used by the visualization to indicate that the item is in RequestingAttention state."

But it's a matter of interpretation, when you read the part about NewStatus, you think that this signal could also suffice as an indication of icon update. In fact I'm surprised that the problem didn't arise before. I'll change the panel code to handle it better.