[Xfce4-commits] <xfce4-taskmanager:master> Update status icon tooltip only if visible

Mike Massonnet noreply at xfce.org
Wed Jun 2 19:36:01 CEST 2010


Updating branch refs/heads/master
         to 568fc7f148d3ab824e49c4998c2aa6fed5f49199 (commit)
       from 46174f188ce8913647693841679b9cbe1612ac89 (commit)

commit 568fc7f148d3ab824e49c4998c2aa6fed5f49199
Author: Mike Massonnet <mmassonnet at xfce.org>
Date:   Wed Jun 2 19:34:36 2010 +0200

    Update status icon tooltip only if visible

 src/main.c |   31 +++++++++++++++++--------------
 1 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/src/main.c b/src/main.c
index 9fe8e5f..12f823f 100644
--- a/src/main.c
+++ b/src/main.c
@@ -56,23 +56,26 @@ init_timeout (void)
 	xtm_task_manager_get_swap_usage (task_manager, &swap_free, &swap_total);
 	xtm_process_window_show_swap_usage (XTM_PROCESS_WINDOW (window), (swap_total > 0));
 
+	if (gtk_status_icon_get_visible (status_icon))
+	{
 #if GTK_CHECK_VERSION (2,16,0)
-	g_snprintf (tooltip, 1024,
-			_("<b>Processes:</b> %u\n"
-			"<b>CPU:</b> %.0f%%\n"
-			"<b>Memory:</b> %.0f%%\n"
-			"<b>Swap:</b> %.0f%%"),
-			num_processes, cpu, memory, swap);
-	gtk_status_icon_set_tooltip_markup (GTK_STATUS_ICON (status_icon), tooltip);
+		g_snprintf (tooltip, 1024,
+				_("<b>Processes:</b> %u\n"
+				"<b>CPU:</b> %.0f%%\n"
+				"<b>Memory:</b> %.0f%%\n"
+				"<b>Swap:</b> %.0f%%"),
+				num_processes, cpu, memory, swap);
+		gtk_status_icon_set_tooltip_markup (GTK_STATUS_ICON (status_icon), tooltip);
 #else
-	g_snprintf (tooltip, 1024,
-			_("Processes: %u\n"
-			"CPU: %.0f%%\n"
-			"Memory: %.0f%%\n"
-			"Swap: %.0f%%"),
-			num_processes, cpu, memory, swap);
-	gtk_status_icon_set_tooltip (GTK_STATUS_ICON (status_icon), tooltip);
+		g_snprintf (tooltip, 1024,
+				_("Processes: %u\n"
+				"CPU: %.0f%%\n"
+				"Memory: %.0f%%\n"
+				"Swap: %.0f%%"),
+				num_processes, cpu, memory, swap);
+		gtk_status_icon_set_tooltip (GTK_STATUS_ICON (status_icon), tooltip);
 #endif
+	}
 
 	xtm_task_manager_update_model (task_manager);
 



More information about the Xfce4-commits mailing list