summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Gjengset <jon@thesquareplanet.com>2013-09-05 19:51:05 +0100
committerJon Gjengset <jon@thesquareplanet.com>2013-09-05 19:51:05 +0100
commit065c8aaa01f165a019c69bc54a12c1838475e2aa (patch)
treed01b3f3f9b930e702e15b2dc9839ae0e6775127d
parentAdd makefile (diff)
downloadmktrayicon-065c8aaa01f165a019c69bc54a12c1838475e2aa.tar.gz
mktrayicon-065c8aaa01f165a019c69bc54a12c1838475e2aa.tar.bz2
mktrayicon-065c8aaa01f165a019c69bc54a12c1838475e2aa.zip
Allow removal of tooltips
-rw-r--r--mktrayicon.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/mktrayicon.c b/mktrayicon.c
index d19f80a..76f056b 100644
--- a/mktrayicon.c
+++ b/mktrayicon.c
@@ -31,6 +31,12 @@ void tray_icon_on_menu(GtkStatusIcon *status_icon, guint button,
gboolean set_tooltip(gpointer data)
{
char *p = (char*)data;
+ if (*p == '\0') {
+ printf("Removing tooltip\n");
+ gtk_status_icon_set_has_tooltip(icon, FALSE);
+ return FALSE;
+ }
+
printf("Setting tooltip to '%s'\n", p);
gtk_status_icon_set_tooltip_text(icon, p);
return FALSE;
@@ -93,6 +99,9 @@ void *watch_fifo(void *argv)
/* only read from this if you *know* there are more arguments */
param = buf + 2;
+ if (len < 3) {
+ *param = '\0';
+ }
switch (*buf) {
case 'q':
@@ -116,7 +125,7 @@ void *watch_fifo(void *argv)
onclick = NULL;
}
- if (len < 3) {
+ if (*param == '\0') {
printf("Removing onclick handler\n");
break;
}
bgstack15