aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2015-05-15 16:40:29 +0000
committerCI Train Bot <ci-train-bot@canonical.com>2015-05-15 16:40:29 +0000
commitdcf21a7dfe5548a08b182adf30e04f1d4373d41e (patch)
treef0483bbcbde164735da800176fdb977aeae4093c
parent05d07c82954637215f05ea8c707b8d917f3acef6 (diff)
parent373d9f1ca238da2e9a158bc720c6ad9c75931858 (diff)
downloadayatana-indicator-power-dcf21a7dfe5548a08b182adf30e04f1d4373d41e.tar.gz
ayatana-indicator-power-dcf21a7dfe5548a08b182adf30e04f1d4373d41e.tar.bz2
ayatana-indicator-power-dcf21a7dfe5548a08b182adf30e04f1d4373d41e.zip
Fix timing issue that caused "Adjust brightness automatically" menuitem to sometimes not be shown. Fixes: #1382861
Approved by: PS Jenkins bot, Rodney Dawes
-rw-r--r--src/service.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/service.c b/src/service.c
index dad6dc8..f0b3ef9 100644
--- a/src/service.c
+++ b/src/service.c
@@ -110,6 +110,7 @@ struct _IndicatorPowerServicePrivate
guint actions_export_id;
GDBusConnection * conn;
+ gboolean menus_built;
struct ProfileMenuInfo menus[N_PROFILES];
GSimpleActionGroup * actions;
@@ -674,7 +675,7 @@ rebuild_now (IndicatorPowerService * self, guint sections)
g_simple_action_set_state (p->header_action, create_header_state (self));
}
- if (p->conn == NULL) /* we haven't built the menus yet */
+ if (!p->menus_built)
return;
if (sections & SECTION_DEVICES)
@@ -1184,6 +1185,7 @@ indicator_power_service_init (IndicatorPowerService * self)
for (i=0; i<N_PROFILES; ++i)
create_menu(self, i);
+ p->menus_built = TRUE;
g_signal_connect_swapped(p->brightness, "notify::auto-brightness-supported",
G_CALLBACK(on_auto_brightness_supported_changed), self);