PKGBUILDs/extra/bluez-gnome/09_visibility.patch
2009-10-09 21:23:22 -05:00

59 lines
1.9 KiB
Diff

# Description: Fixes visibility settings
# This patch was taken from upstream. Please see this link for more information:
# Upstream: http://git.kernel.org/?p=bluetooth/bluez-gnome.git;a=blobdiff;f=applet/main.c;h=62993755f098d06fbdc5aa3eaaa1325e448aa15f;hp=71f8778dd4388187f163fc736e440bace9256f3c;hb=4d56f10dc2a065d60724ccce8496d173fa0dc85a;hpb=68b98e6b6043acd8f6b2875d9f17fce84b14b9fb
# Ubuntu: 297819
diff --git a/applet/main.c b/applet/main.c
index 71f8778..6299375 100644 (file)
diff -Nur -x '*.orig' -x '*~' bluez-gnome-1.8/applet/main.c bluez-gnome-1.8.new/applet/main.c
--- bluez-gnome-1.8/applet/main.c 2008-09-29 07:08:50.000000000 -0500
+++ bluez-gnome-1.8.new/applet/main.c 2009-02-12 14:39:54.000000000 -0600
@@ -288,6 +288,20 @@
}
}
+static void update_icon_visibility()
+{
+ if (icon_policy == ICON_POLICY_NEVER)
+ hide_icon();
+ else if (icon_policy == ICON_POLICY_ALWAYS)
+ show_icon();
+ else if (icon_policy == ICON_POLICY_PRESENT) {
+ if (adapter_present == TRUE)
+ show_icon();
+ else
+ hide_icon();
+ }
+}
+
static GConfEnumStringPair icon_policy_enum_map [] = {
{ ICON_POLICY_NEVER, "never" },
{ ICON_POLICY_ALWAYS, "always" },
@@ -313,16 +327,7 @@
gconf_string_to_enum(icon_policy_enum_map, str, &icon_policy);
- if (icon_policy == ICON_POLICY_NEVER)
- hide_icon();
- else if (icon_policy == ICON_POLICY_ALWAYS)
- show_icon();
- else if (icon_policy == ICON_POLICY_PRESENT) {
- if (adapter_present == TRUE)
- show_icon();
- else
- hide_icon();
- }
+ update_icon_visibility();
return;
}
@@ -410,8 +415,7 @@
statusicon = init_notification();
- if (icon_policy != ICON_POLICY_ALWAYS && adapter_present == FALSE)
- hide_icon();
+ update_icon_visibility();
g_signal_connect(statusicon, "activate",
G_CALLBACK(activate_callback), NULL);