From owner-freebsd-gnome@FreeBSD.ORG Sat Jan 28 20:39:29 2006 Return-Path: X-Original-To: gnome@FreeBSD.org Delivered-To: freebsd-gnome@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D063E16A45D; Sat, 28 Jan 2006 20:39:28 +0000 (GMT) (envelope-from stijn@pcwin002.win.tue.nl) Received: from pastinakel.tue.nl (pastinakel.tue.nl [131.155.2.7]) by mx1.FreeBSD.org (Postfix) with ESMTP id B9E7F43D49; Sat, 28 Jan 2006 20:39:27 +0000 (GMT) (envelope-from stijn@pcwin002.win.tue.nl) Received: from localhost (localhost [127.0.0.1]) by pastinakel.tue.nl (Postfix) with ESMTP id 9344314BBD8; Sat, 28 Jan 2006 21:39:26 +0100 (CET) Received: from pastinakel.tue.nl ([127.0.0.1]) by localhost (pastinakel.tue.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 37258-09; Sat, 28 Jan 2006 21:39:26 +0100 (CET) Received: from umta.win.tue.nl (umta.win.tue.nl [131.155.71.100]) by pastinakel.tue.nl (Postfix) with ESMTP id F370414BBED; Sat, 28 Jan 2006 21:39:25 +0100 (CET) Received: from pcwin002.win.tue.nl (pcwin002 [131.155.71.72]) by umta.win.tue.nl (Postfix) with ESMTP id EFE6631401C; Sat, 28 Jan 2006 21:39:25 +0100 (CET) Received: by pcwin002.win.tue.nl (Postfix, from userid 1001) id EDB9D4124; Sat, 28 Jan 2006 21:39:25 +0100 (CET) To: FreeBSD-gnats-submit@freebsd.org From: Stijn Hoop X-send-pr-version: 3.113 X-GNATS-Notify: Message-Id: <20060128203925.EDB9D4124@pcwin002.win.tue.nl> Date: Sat, 28 Jan 2006 21:39:25 +0100 (CET) X-Virus-Scanned: amavisd-new at tue.nl Cc: gnome@FreeBSD.org Subject: [PATCH]: www/firefox uses 100% CPU when opening files sometimes X-BeenThere: freebsd-gnome@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Stijn Hoop List-Id: GNOME for FreeBSD -- porting and maintaining List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2006 20:39:30 -0000 >Submitter-Id: current-users >Originator: Stijn Hoop >Organization: >Confidential: no >Synopsis: [PATCH]: www/firefox uses 100% CPU when opening files sometimes >Severity: non-critical >Priority: low >Category: ports >Class: sw-bug >Release: FreeBSD 6.0-STABLE i386 >Environment: System: FreeBSD 6.0-STABLE #3: Thu Dec 8 09:24:38 CET 2005 >Description: - Firefox sometimes appears to stall for a few seconds, eating lots of CPU in the process. This is due to a Gecko bug apparently fixed in 1.8 but not present in FF 1.5. See mozilla's bugzilla bug 305970: https://bugzilla.mozilla.org/show_bug.cgi?id=305970 >How-To-Repeat: - Try to download lots of files? >Fix: - Add the patch below to the port and rebuild your firefox. Patch taken from Mozilla's bugzilla and made to apply to the 1.5 sources. --- widget/src/gtk2/nsWindow.cpp.orig Thu Aug 18 10:11:23 2005 +++ widget/src/gtk2/nsWindow.cpp Sat Jan 28 18:34:03 2006 @@ -148,9 +148,9 @@ GdkEventVisibility *event); static gboolean window_state_event_cb (GtkWidget *widget, GdkEventWindowState *event); -static void style_set_cb (GtkWidget *widget, - GtkStyle *previous_style, - gpointer data); +static void theme_changed_cb (GtkSettings *settings, + GParamSpec *pspec, + nsWindow *data); #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ @@ -372,6 +372,10 @@ mIsDestroyed = PR_TRUE; mCreated = PR_FALSE; + g_signal_handlers_disconnect_by_func(gtk_settings_get_default(), + (gpointer)G_CALLBACK(theme_changed_cb), + this); + // ungrab if required nsCOMPtr rollupWidget = do_QueryReferent(gRollupWindow); if (NS_STATIC_CAST(nsIWidget *, this) == rollupWidget.get()) { @@ -2434,8 +2438,16 @@ G_CALLBACK(delete_event_cb), NULL); g_signal_connect(G_OBJECT(mShell), "window_state_event", G_CALLBACK(window_state_event_cb), NULL); - g_signal_connect(G_OBJECT(mShell), "style_set", - G_CALLBACK(style_set_cb), NULL); + + g_signal_connect_after(gtk_settings_get_default(), + "notify::gtk-theme-name", + G_CALLBACK(theme_changed_cb), this); + g_signal_connect_after(gtk_settings_get_default(), + "notify::gtk-key-theme-name", + G_CALLBACK(theme_changed_cb), this); + g_signal_connect_after(gtk_settings_get_default(), + "notify::gtk-font-name", + G_CALLBACK(theme_changed_cb), this); } if (mContainer) { @@ -3916,11 +3928,9 @@ /* static */ void -style_set_cb (GtkWidget *widget, GtkStyle *previous_style, gpointer data) +theme_changed_cb (GtkSettings *settings, GParamSpec *pspec, nsWindow *data) { - nsWindow *window = get_window_for_gtk_widget(widget); - if (window) - window->ThemeChanged(); + data->ThemeChanged(); } //////////////////////////////////////////////////////////////////////