On 2014-10-20 23:35, Dan Williams wrote:On Sat, 2014-10-18 at 17:43 +0200, Hendrik Rosendahl wrote:Hi everyone, I noticed, that no notification is displayed, if the applet isdisabled Hey, here is my first attempt. From 49c5bc4cc3f21c7d9455188b55c913ca7e2992d1 Mon Sep 17 00:00:00 2001 From: Hendrik Rosendahl <hendrik rosendahl rwth-aachen de> Date: Tue, 21 Oct 2014 12:00:02 +0200 Subject: [PATCH] Add GSetting "notify-when-hidden" If this setting is set to true notifications are shown, even if the applet is hidden. The default value is "false", as this is the current behavior. --- org.gnome.nm-applet.gschema.xml.in | 5 +++++ src/applet.c | 2 +- src/applet.h | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/org.gnome.nm-applet.gschema.xml.in b/org.gnome.nm-applet.gschema.xml.in index bf3b9f4..2c6e756 100644 --- a/org.gnome.nm-applet.gschema.xml.in +++ b/org.gnome.nm-applet.gschema.xml.in @@ -36,6 +36,11 @@ <_summary>Show the applet in notification area</_summary> <_description>Set to FALSE to disable displaying the applet in the notification area.</_description> </key> + <key name="notify-when-hidden" type="b"> + <default>false</default> + <_summary>Notify when hidden</_summary> + <_description>Set to true to receive notifications even if the applet itself is hidden.</_description> + </key> </schema> <schema id="org.gnome.nm-applet.eap"> <key name="ignore-ca-cert" type="b"> diff --git a/src/applet.c b/src/applet.c index 81e2ac5..7750226 100644 --- a/src/applet.c +++ b/src/applet.c @@ -884,7 +884,7 @@ 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)) + if (!g_settings_get_boolean (applet->gsettings, PREF_NOTIFY_WHEN_HIDDEN) && !gtk_status_icon_is_embedded (applet->status_icon)) return; /* if we're not acting as a secret agent, don't notify either */ diff --git a/src/applet.h b/src/applet.h index cd5ac97..960b0b2 100644 --- a/src/applet.h +++ b/src/applet.h @@ -69,6 +69,7 @@ typedef struct #define PREF_DISABLE_WIFI_CREATE "disable-wifi-create" #define PREF_SUPPRESS_WIFI_NETWORKS_AVAILABLE "suppress-wireless-networks-available" #define PREF_SHOW_APPLET "show-applet" +#define PREF_NOTIFY_WHEN_HIDDEN "notify-when-hidden" #define ICON_LAYER_LINK 0 #define ICON_LAYER_VPN 1 -- 2.1.2 I am not quite sure, if !gtk_status_icon_is_embedded (applet->status_icon) should or could be replaced with the GSetting show-applet or not. Hendrik |
Attachment:
smime.p7s
Description: S/MIME Cryptographic Signature