GNOME Bugzilla – Bug 743325
Set the urgency hint on main window on new mail
Last modified: 2016-09-05 07:08:47 UTC
It would be great if geary set the urgency hint on the window when it got a new email, or at least had an option for this. So that I can see the workspace geary is in as the urgent color in i3wm. Here is some documentation on setting urgency hints in GTK: http://www.pygtk.org/pygtk2reference/class-gtkwindow.html#method-gtkwindow--set-urgency-hint
I don't think I've ever seen an email application, or any messaging application, use the urgency hint for a new message. Do you have an example of an email client that does this, or a use guide that suggests Geary should?
Google hangouts (running inside of chrome as an extension) sets the urgency of the window when I get a new message. Also there are plugins for thunderbird that give thunderbird this functionality: https://addons.mozilla.org/en-us/thunderbird/addon/new-mail-attention/ (I use this one with over 7000 users) Some more information on the urgency flag from ICCCM: http://tronche.com/gui/x/icccm/sec-4.html#s-4.1.2.4 The UrgencyHint flag, if set in the flags field, indicates that the client deems the window contents to be urgent, requiring the timely response of the user. The window manager must make some effort to draw the user's attention to this window while this flag is set. The window manager must also monitor the state of this flag for the entire time the window is in the Normal or Iconic state and must take appropriate action when the state of the flag changes. The flag is otherwise independent of the window's state; in particular, the window manager is not required to deiconify the window if the client sets the flag on an Iconic window. Clients must provide some means by which the user can cause the UrgencyHint flag to be set to zero or the window to be withdrawn. The user's action can either mitigate the actual condition that made the window urgent, or it can merely shut off the alarm.
I think the key phrase is here: > indicates that the client deems the window contents to be urgent, > requiring the timely response of the user Unlike Hangouts, which is real-time chat, it's hard to justify that the arrival of all email requires an immediate, timely response. For me, the urgency hint is like a ringing phone, not new mail. As far as a Thundebird extension goes, that sounds about right -- it's not a part of the core. What's more, the extension appears to be quite configurable, allowing the urgency hint to be used for specific matching patterns. That's not something we're interested in adding to Geary. This would have to be a user option, which we avoid as much as possible to keep Geary easy to user. What would you propose the Preferences checkbox text read? It would need to be something user-friendly that wouldn't throw off users, i.e. they set it innocently and then wonder why the Geary icon is flashing in their task bar. I'm also unaware what the urgency hint does in GNOME Shell, so that's something else we need to consider.
Yeah I understand that. Perhaps it could be called "Mark window as urgent for new mail". I am happy if it isn't in the visual config (for normal users), is there a power user config, say in a dotfile like `~/.geary.conf`? It is up to each window manager to handle the flag, so they all end up implementing it differently. i3 implements it with a separate colour for the window border and workspace name when something is urgent. If you approve of how it should be handled, I am open to implementing it myself and sending a pull request. I'd have to get my head around vala, but it should be straightforward enough.
We generally avoid hidden power-user settings unless there's really no better solution. Hidden settings create untested code paths that often lead to bit rot and the introduction of obscure bugs. I'm skeptical about adding this feature. Geary's been around for nearly four years and this is the first request to use the urgency bit for notifications. If the setting was hidden as you suggest, it's like adding a feature to fulfill a single user request. We did a lot of research and talking with people when we adopted our notification strategy. It's not something we like to monkey with without reason. You might consider going to the mailing list and asking for people's opinions first. I'm more amenable to this if I felt there was more need from the community.
Fair enough, that all makes sense. I might ping the mailing list and ask if anyone else would be interested
There's a few additional issues here. AFAICT gnome-shell handles the urgent hint using a notification, which makes it at best redundant and at worse actively annoying when running GNOME. So it would need special-case handling based on the current running DE, which is undesirable. Also, the urgency hint is an X-specific thing, and I've not been able to find any reference to it being implemented in Wayland. Currently, the GDK Wayland backend the function implementing gdk_window_set_urgency_hint does nothing, which isn't necessarily a bad sign, but isn't a good one either. Unless I've overlooked something and the urgency hint's future isn't actually looking this grim, I'm reasonably inclined to wontfix this. I'd be happy to be proven wrong, however. Benjamin, what do you think?
Given these circumstances, I'm going to close this bug report. Please feel free to reopen this bug report if some support for it in Wayland looks possible.