diff options
author | marino <marino@pkgsrc.org> | 2013-01-08 01:23:18 +0000 |
---|---|---|
committer | marino <marino@pkgsrc.org> | 2013-01-08 01:23:18 +0000 |
commit | 7cbb1513d1d9b39baeead4a32c62eee713e75207 (patch) | |
tree | 0503691e0f5039088f3adffd72583ef7664739f0 /x11/xfce4-terminal | |
parent | 2ed3ac77f3cfae9e4aa957d7230e9150ea8e50d1 (diff) | |
download | pkgsrc-7cbb1513d1d9b39baeead4a32c62eee713e75207.tar.gz |
x11/xfce4-terminal: PR#46926 PR#45448 Fix 100% CPU usage
Patch provided by Dave Tyson has multiple confirmations that it fixes
the issue of 100% CPU usage simply from opening terminal window.
Diffstat (limited to 'x11/xfce4-terminal')
-rw-r--r-- | x11/xfce4-terminal/Makefile | 4 | ||||
-rw-r--r-- | x11/xfce4-terminal/distinfo | 3 | ||||
-rw-r--r-- | x11/xfce4-terminal/patches/patch-terminal_terminal-screen.c | 78 |
3 files changed, 82 insertions, 3 deletions
diff --git a/x11/xfce4-terminal/Makefile b/x11/xfce4-terminal/Makefile index a2502c16bed..8167b7bd66f 100644 --- a/x11/xfce4-terminal/Makefile +++ b/x11/xfce4-terminal/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.27 2012/10/29 05:07:10 asau Exp $ +# $NetBSD: Makefile,v 1.28 2013/01/08 01:23:18 marino Exp $ .include "../../meta-pkgs/xfce4/Makefile.common" @@ -6,7 +6,7 @@ XFCE4_VERSION= 0.4.2 DISTNAME= Terminal-${XFCE4_VERSION} PKGNAME= xfce4-terminal-${XFCE4_VERSION} -PKGREVISION= 13 +PKGREVISION= 14 CATEGORIES= x11 COMMENT= Xfce terminal emulator diff --git a/x11/xfce4-terminal/distinfo b/x11/xfce4-terminal/distinfo index ab1a01999fe..ba9d679c269 100644 --- a/x11/xfce4-terminal/distinfo +++ b/x11/xfce4-terminal/distinfo @@ -1,5 +1,6 @@ -$NetBSD: distinfo,v 1.6 2009/11/29 22:16:34 snj Exp $ +$NetBSD: distinfo,v 1.7 2013/01/08 01:23:19 marino Exp $ SHA1 (Terminal-0.4.2.tar.bz2) = bf4510e331284d7f68ba193fe1d6f2e57b7815bb RMD160 (Terminal-0.4.2.tar.bz2) = 8e6364673d6b0d8eddfd59f3f82d3944fca45684 Size (Terminal-0.4.2.tar.bz2) = 1981158 bytes +SHA1 (patch-terminal_terminal-screen.c) = dcfa62798ea47e26ed65df031c09991f24d4fa7c diff --git a/x11/xfce4-terminal/patches/patch-terminal_terminal-screen.c b/x11/xfce4-terminal/patches/patch-terminal_terminal-screen.c new file mode 100644 index 00000000000..98868ba7c00 --- /dev/null +++ b/x11/xfce4-terminal/patches/patch-terminal_terminal-screen.c @@ -0,0 +1,78 @@ +$NetBSD: patch-terminal_terminal-screen.c,v 1.1 2013/01/08 01:23:19 marino Exp $ + +Fix for 100% CPU usage on XFce4 Terminal (Dave Tyson) +PR# pkg/45448 +PR# pkg/46926 + +--- terminal/terminal-screen.c.orig 2009-10-06 15:07:01.000000000 +0000 ++++ terminal/terminal-screen.c +@@ -87,6 +87,7 @@ static gboolean terminal_screen_get_ch + GError **error); + static gchar **terminal_screen_get_child_environment (TerminalScreen *screen); + static void terminal_screen_update_background (TerminalScreen *screen); ++static void terminal_screen_update_background_fast (TerminalScreen *screen); + static void terminal_screen_update_binding_backspace (TerminalScreen *screen); + static void terminal_screen_update_binding_delete (TerminalScreen *screen); + static void terminal_screen_update_colors (TerminalScreen *screen); +@@ -132,6 +133,8 @@ struct _TerminalScreen + GtkWidget *scrollbar; + GtkWidget *tab_label; + ++ gulong background_signal_id; ++ + GPid pid; + gchar *working_directory; + +@@ -231,7 +234,6 @@ terminal_screen_init (TerminalScreen *sc + "signal::context-menu", G_CALLBACK (terminal_screen_vte_get_context_menu), screen, + "signal::selection-changed", G_CALLBACK (terminal_screen_vte_selection_changed), screen, + "signal::window-title-changed", G_CALLBACK (terminal_screen_vte_window_title_changed), screen, +- "swapped-signal::size-allocate", G_CALLBACK (terminal_screen_timer_background), screen, + "swapped-signal::style-set", G_CALLBACK (terminal_screen_update_colors), screen, + NULL); + gtk_box_pack_start (GTK_BOX (screen), screen->terminal, TRUE, TRUE, 0); +@@ -573,6 +575,18 @@ terminal_screen_get_child_environment (T + + + static void ++terminal_screen_update_background_fast (TerminalScreen *screen) ++{ ++ if (G_UNLIKELY (screen->background_timer_id == 0)) ++ { ++ screen->background_timer_id = g_idle_add_full (G_PRIORITY_LOW, terminal_screen_timer_background, ++ screen, terminal_screen_timer_background_destroy); ++ } ++} ++ ++ ++ ++static void + terminal_screen_update_background (TerminalScreen *screen) + { + if (G_UNLIKELY (screen->background_timer_id != 0)) +@@ -1015,9 +1029,25 @@ terminal_screen_timer_background (gpoint + if (G_LIKELY (image != NULL)) + g_object_unref (G_OBJECT (image)); + g_object_unref (G_OBJECT (loader)); ++ ++ /* refresh background on size changes */ ++ if (screen->background_signal_id == 0) ++ { ++ screen->background_signal_id = ++ g_signal_connect_swapped (G_OBJECT (screen->terminal), "size-allocate", ++ G_CALLBACK (terminal_screen_update_background_fast), screen); ++ } + } + else + { ++ /* stop updating on size changes */ ++ if (screen->background_signal_id != 0) ++ { ++ g_signal_handler_disconnect (G_OBJECT (screen->terminal), screen->background_signal_id); ++ screen->background_signal_id = 0; ++ } ++ ++ /* WARNING: the causes a resize too! */ + vte_terminal_set_background_image (VTE_TERMINAL (screen->terminal), NULL); + } + |