Permalink
Browse files

Pullup ticket #4005 - requested by marino

x11/xfce4-terminal: bug fix patch

Revisions pulled up:
- x11/xfce4-terminal/Makefile                                   1.28
- x11/xfce4-terminal/distinfo                                   1.7
- x11/xfce4-terminal/patches/patch-terminal_terminal-screen.c   1.1

---
   Module Name:	pkgsrc
   Committed By:	marino
   Date:		Tue Jan  8 01:23:19 UTC 2013

   Modified Files:
   	pkgsrc/x11/xfce4-terminal: Makefile distinfo
   Added Files:
   	pkgsrc/x11/xfce4-terminal/patches: patch-terminal_terminal-screen.c

   Log Message:
   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.
  • Loading branch information...
1 parent 5a5dcd7 commit fce5bcb97403b785bdd6dbf49d51e2556cb09416 tron committed Jan 9, 2013
View
4 x11/xfce4-terminal/Makefile
@@ -1,12 +1,12 @@
-# $NetBSD: Makefile,v 1.27 2012/10/29 05:07:10 asau Exp $
+# $NetBSD: Makefile,v 1.27.2.1 2013/01/09 10:13:38 tron Exp $
.include "../../meta-pkgs/xfce4/Makefile.common"
XFCE4_VERSION= 0.4.2
DISTNAME= Terminal-${XFCE4_VERSION}
PKGNAME= xfce4-terminal-${XFCE4_VERSION}
-PKGREVISION= 13
+PKGREVISION= 14
CATEGORIES= x11
COMMENT= Xfce terminal emulator
View
3 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.6.26.1 2013/01/09 10:13:38 tron 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
View
78 x11/xfce4-terminal/patches/patch-terminal_terminal-screen.c
@@ -0,0 +1,78 @@
+$NetBSD: patch-terminal_terminal-screen.c,v 1.1.2.2 2013/01/09 10:13:38 tron 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);
+ }
+

0 comments on commit fce5bcb

Please sign in to comment.