Commit 98b25bb0 authored by Sean Davis's avatar Sean Davis 🕶

Make mode-whitelist work with systray

parent d3191bf0
Pipeline #1229 passed with stages
in 4 minutes and 30 seconds
......@@ -840,19 +840,19 @@ sn_config_add_known_item (SnConfig *config,
void
gboolean
sn_config_add_known_legacy_item (SnConfig *config,
const gchar *name)
{
GList *li;
gchar *name_copy;
g_return_if_fail (XFCE_IS_SN_CONFIG (config));
g_return_val_if_fail (XFCE_IS_SN_CONFIG (config), TRUE);
/* check if item is already known */
for(li = config->known_legacy_items; li != NULL; li = li->next)
if (g_strcmp0 (li->data, name) == 0)
return;
return g_hash_table_contains (config->hidden_legacy_items, name);
config->known_legacy_items = g_list_prepend (config->known_legacy_items, g_strdup (name));
......@@ -865,6 +865,8 @@ sn_config_add_known_legacy_item (SnConfig *config,
g_object_notify (G_OBJECT (config), "known-legacy-items");
g_signal_emit (G_OBJECT (config), sn_config_signals[LEGACY_ITEM_LIST_CHANGED], 0);
return config->mode_whitelist;
}
......
......@@ -86,7 +86,7 @@ void sn_config_add_known_item (SnConfig
GList *sn_config_get_known_legacy_items (SnConfig *config);
GList *sn_config_get_hidden_legacy_items (SnConfig *config);
void sn_config_add_known_legacy_item (SnConfig *config,
gboolean sn_config_add_known_legacy_item (SnConfig *config,
const gchar *name);
void sn_config_swap_known_items (SnConfig *config,
......
......@@ -210,11 +210,13 @@ sn_plugin_item_added (SnPlugin *plugin,
gtk_widget_show (button);
}
void
gboolean
sn_plugin_legacy_item_added (SnPlugin *plugin,
const gchar *name)
{
sn_config_add_known_legacy_item (plugin->config, name);
return sn_config_add_known_legacy_item (plugin->config, name);
}
......
......@@ -78,7 +78,7 @@ GType sn_plugin_get_type (void) G_GNUC_CON
void sn_plugin_register_type (XfcePanelTypeModule *panel_type_module);
void sn_plugin_legacy_item_added (SnPlugin *plugin,
gboolean sn_plugin_legacy_item_added (SnPlugin *plugin,
const gchar *name);
G_END_DECLS
......
......@@ -342,7 +342,12 @@ systray_plugin_names_get_hidden (SnPlugin *plugin,
{
/* add the new name */
plugin->names_ordered = g_slist_prepend (plugin->names_ordered, g_strdup (name));
sn_plugin_legacy_item_added (plugin, name);
if (sn_plugin_legacy_item_added (plugin, name))
{
g_hash_table_replace (plugin->names_hidden, g_strdup (name), NULL);
return TRUE;
}
/* do not hide the icon */
return FALSE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment