From owner-freebsd-gnome@FreeBSD.ORG Wed Jun 20 20:24:00 2012 Return-Path: Delivered-To: gnome@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D681106564A for ; Wed, 20 Jun 2012 20:24:00 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 6C4558FC1E for ; Wed, 20 Jun 2012 20:23:59 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id XAA29709 for ; Wed, 20 Jun 2012 23:23:58 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1ShRRV-000FI5-St for gnome@FreeBSD.org; Wed, 20 Jun 2012 23:23:58 +0300 Message-ID: <4FE2315C.50706@FreeBSD.org> Date: Wed, 20 Jun 2012 23:23:56 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120613 Thunderbird/13.0 MIME-Version: 1.0 To: gnome@FreeBSD.org X-Enigmail-Version: 1.4.2 Content-Type: text/plain; charset=X-VIET-VPS Content-Transfer-Encoding: 7bit Cc: Subject: irc/xchat: limit icon blinking time X-BeenThere: freebsd-gnome@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GNOME for FreeBSD -- porting and maintaining List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2012 20:24:00 -0000 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