On Sat, 2014-10-18 at 17:43 +0200, Hendrik Rosendahl wrote:
> Hi everyone,
> 
> I noticed, that no notification is displayed, if the applet is
disabled
> by the gsettings.
> 
> How to reproduce:
> 
>  1. Start nm-applet, if it isn't already
>  2. Make sure, that you get a notification, when interacting with
>     NetworkManager (e.g. connecting to a network)
>  3. Execute gsettings set org.gnome.nm-applet show-applet 'false'
>  4. Interact with NetworkManager (e.g. through nmtui) to repeat the
>     steps in 1.
>  5. Notice, that there is no notification shown
> 
> What I expected:
> As the option only says "show-applet", we should still see the
> notifications.
> 
> Solution?
> I had a look at the source and with this diff I could produce the
> expected behavior:
> 
> diff --git a/src/applet.c b/src/applet.c
> index 81e2ac5..7d411c7 100644
> --- a/src/applet.c
> +++ b/src/applet.c
> @@ -884,9 +884,6 @@ applet_do_notify (NMApplet *applet,
>         g_return_if_fail (summary != NULL);
>         g_return_if_fail (message != NULL);
>  
> -       if (!gtk_status_icon_is_embedded (applet->status_icon))
> -               return;
> -
>         /* if we're not acting as a secret agent, don't notify either
*/
>         if (!applet->agent)
>                 return;
> 
> It is running on my system right now, but I don't know if this breaks
> anything else.
> The originating commit b74deac92d8192591ddbb62f2e2b1b7101a5e95d
doesn't
> say why the notification shouldn't be shown, if the applet isn't
> visible. But in my opinion it doesn't make sense to not show the
> notification, only because the applet isn't shown. Additionally we now
> have the gsettings to control what should be shown, which wasn't the
> case when this commit was made, as far as I can tell.
> 
> Please excuse any formal mistakes I made, as it is my first time using
a
> mailing list.

Thanks for the report and investigation.  I believe the original intent
was that when nm-applet wasn't being shown it shouldn't provide any user
interaction other than it's secret agent, because if it's not being
shown, whatever other UI *is* shown should be providing those
notifications.  I'm not sure we ever thought about running the applet
hidden, but only providing notifications.

If that's useful to you, I'd be happy to take a patch that adds a new
GSetting called "notify-when-hidden" that turns the notifications back
on in this case.  Would you be able to work on a patch for that?

Dan


_______________________________________________
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list

Reply via email to