Ignore GtkStatusIcon related deprecations
This is already tracked in #78.
This commit is contained in:
12
src/main.c
12
src/main.c
@@ -62,7 +62,9 @@ status_icon_popup_menu (GtkStatusIcon *_status_icon, guint button, guint activat
|
||||
gtk_widget_show_all (menu);
|
||||
}
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
gtk_menu_popup (GTK_MENU (menu), NULL, NULL, gtk_status_icon_position_menu, _status_icon, button, activate_time);
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -70,7 +72,9 @@ create_status_icon (void)
|
||||
{
|
||||
if (!status_icon_or_null)
|
||||
{
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
GtkStatusIcon *status_icon = gtk_status_icon_new_from_icon_name ("org.xfce.taskmanager");
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
g_signal_connect (status_icon, "activate", G_CALLBACK (status_icon_activated), NULL);
|
||||
g_signal_connect (status_icon, "popup-menu", G_CALLBACK (status_icon_popup_menu), NULL);
|
||||
status_icon_or_null = status_icon;
|
||||
@@ -80,7 +84,9 @@ create_status_icon (void)
|
||||
static gboolean
|
||||
status_icon_get_visible (void)
|
||||
{
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
return status_icon_or_null && gtk_status_icon_get_visible (status_icon_or_null);
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -91,11 +97,15 @@ show_hide_status_icon (void)
|
||||
if (show_status_icon)
|
||||
{
|
||||
create_status_icon ();
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
gtk_status_icon_set_visible (status_icon_or_null, TRUE);
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
}
|
||||
else if (status_icon_get_visible ())
|
||||
{
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
gtk_status_icon_set_visible (status_icon_or_null, FALSE);
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
}
|
||||
}
|
||||
|
||||
@@ -161,7 +171,9 @@ collect_data (void)
|
||||
"<b>Memory:</b> %s\n"
|
||||
"<b>Swap:</b> %s"),
|
||||
num_processes, cpu, memory_info, swap_info);
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
gtk_status_icon_set_tooltip_markup (GTK_STATUS_ICON (status_icon_or_null), tooltip);
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
}
|
||||
|
||||
xtm_task_manager_update_model (task_manager);
|
||||
|
||||
Reference in New Issue
Block a user