irc/xchat: limit icon blinking time
Andriy Gapon
avg at FreeBSD.org
Wed Jun 20 20:24:00 UTC 2012
I would like to propose the following patch for irc/xchat.
It should limit the time that xchat tray icon blinks/flashes upon a configured
event. It seems that such blinking puts non-negligible load on a system (via X
server). At the end of blinking the icon should freeze in "alerted" state.
--- src/fe-gtk/plugin-tray.c.orig 2012-06-20 08:17:03.960745335 +0300
+++ src/fe-gtk/plugin-tray.c 2012-06-20 08:50:21.961136476 +0300
@@ -42,9 +42,11 @@ typedef GdkPixbuf* TrayIcon;
#define ICON_HILIGHT pix_tray_hilight
#define ICON_FILE pix_tray_file
#define TIMEOUT 500
+#define FLASH_COUNT 252
static GtkStatusIcon *sticon;
static gint flash_tag;
+static gint flash_count;
static TrayStatus tray_status;
static xchat_plugin *ph;
@@ -317,6 +319,7 @@ tray_stop_flash (void)
}
tray_status = TS_NONE;
+ flash_count = 0;
}
static void
@@ -352,6 +355,11 @@ tray_timeout_cb (TrayIcon icon)
else
gtk_status_icon_set_from_pixbuf (sticon, ICON_NORMAL);
}
+
+ flash_count++;
+ if (flash_count == FLASH_COUNT)
+ return 0;
+
return 1;
}
--
Andriy Gapon
More information about the freebsd-gnome
mailing list