[Xfce4-commits] [xfce/xfce4-power-manager] 01/01: Disable trayicon when panel plugin is present (Bug #15682)
noreply at xfce.org
noreply at xfce.org
Tue Jul 16 19:57:10 CEST 2019
This is an automated email from the git hooks/post-receive script.
o c h o s i p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository xfce/xfce4-power-manager.
commit 6e9c6ef3f1a291810b79aec6449219022c206a9d
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date: Mon Jul 15 23:23:21 2019 +0200
Disable trayicon when panel plugin is present (Bug #15682)
---
.../power-manager-plugin/xfce/xfce-power-manager-plugin.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/panel-plugins/power-manager-plugin/xfce/xfce-power-manager-plugin.c b/panel-plugins/power-manager-plugin/xfce/xfce-power-manager-plugin.c
index 2b5db53..994d9fd 100644
--- a/panel-plugins/power-manager-plugin/xfce/xfce-power-manager-plugin.c
+++ b/panel-plugins/power-manager-plugin/xfce/xfce-power-manager-plugin.c
@@ -223,6 +223,7 @@ static PowerManagerPlugin *
power_manager_plugin_new (XfcePanelPlugin *plugin)
{
PowerManagerPlugin *power_manager_plugin;
+ XfconfChannel *channel;
/* allocate memory for the plugin structure */
power_manager_plugin = panel_slice_new0 (PowerManagerPlugin);
@@ -237,7 +238,14 @@ power_manager_plugin_new (XfcePanelPlugin *plugin)
power_manager_plugin->power_manager_button = power_manager_button_new (plugin);
gtk_container_add (GTK_CONTAINER (power_manager_plugin->ebox), power_manager_plugin->power_manager_button);
- power_manager_button_show(POWER_MANAGER_BUTTON(power_manager_plugin->power_manager_button));
+ power_manager_button_show (POWER_MANAGER_BUTTON (power_manager_plugin->power_manager_button));
+
+ /* disable the systray item when the plugin is started, allowing the user to
+ later manually enable it, e.g. for testing purposes. */
+ channel = xfconf_channel_get (XFPM_CHANNEL);
+ if (xfconf_channel_get_bool (channel, "/xfce4-power-manager/show-tray-icon", TRUE))
+ g_warning ("Xfce4-power-manager: The panel plugin is present, so the tray icon gets disabled.");
+ xfconf_channel_set_bool (channel, "/xfce4-power-manager/show-tray-icon", FALSE);
return power_manager_plugin;
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list