Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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...
commit 10b05393936c1d8f26f0532dc938e06f69ccf978 1 parent a6b8083
authored
4  x11/xfce4-terminal/Makefile
... ...
@@ -1,4 +1,4 @@
1  
-# $NetBSD: Makefile,v 1.27 2012/10/29 05:07:10 asau Exp $
  1
+# $NetBSD: Makefile,v 1.28 2013/01/08 01:23:18 marino Exp $
2 2
 
3 3
 .include "../../meta-pkgs/xfce4/Makefile.common"
4 4
 
@@ -6,7 +6,7 @@ XFCE4_VERSION=	0.4.2
6 6
 
7 7
 DISTNAME=	Terminal-${XFCE4_VERSION}
8 8
 PKGNAME=	xfce4-terminal-${XFCE4_VERSION}
9  
-PKGREVISION=	13
  9
+PKGREVISION=	14
10 10
 CATEGORIES=	x11
11 11
 COMMENT=	Xfce terminal emulator
12 12
 
3  x11/xfce4-terminal/distinfo
... ...
@@ -1,5 +1,6 @@
1  
-$NetBSD: distinfo,v 1.6 2009/11/29 22:16:34 snj Exp $
  1
+$NetBSD: distinfo,v 1.7 2013/01/08 01:23:19 marino Exp $
2 2
 
3 3
 SHA1 (Terminal-0.4.2.tar.bz2) = bf4510e331284d7f68ba193fe1d6f2e57b7815bb
4 4
 RMD160 (Terminal-0.4.2.tar.bz2) = 8e6364673d6b0d8eddfd59f3f82d3944fca45684
5 5
 Size (Terminal-0.4.2.tar.bz2) = 1981158 bytes
  6
+SHA1 (patch-terminal_terminal-screen.c) = dcfa62798ea47e26ed65df031c09991f24d4fa7c
78  x11/xfce4-terminal/patches/patch-terminal_terminal-screen.c
... ...
@@ -0,0 +1,78 @@
  1
+$NetBSD: patch-terminal_terminal-screen.c,v 1.1 2013/01/08 01:23:19 marino Exp $
  2
+
  3
+Fix for 100% CPU usage on XFce4 Terminal (Dave Tyson)
  4
+PR# pkg/45448
  5
+PR# pkg/46926
  6
+
  7
+--- terminal/terminal-screen.c.orig	2009-10-06 15:07:01.000000000 +0000
  8
++++ terminal/terminal-screen.c
  9
+@@ -87,6 +87,7 @@ static gboolean   terminal_screen_get_ch
  10
+                                                                  GError               **error);
  11
+ static gchar    **terminal_screen_get_child_environment         (TerminalScreen        *screen);
  12
+ static void       terminal_screen_update_background             (TerminalScreen        *screen);
  13
++static void       terminal_screen_update_background_fast        (TerminalScreen        *screen);
  14
+ static void       terminal_screen_update_binding_backspace      (TerminalScreen        *screen);
  15
+ static void       terminal_screen_update_binding_delete         (TerminalScreen        *screen);
  16
+ static void       terminal_screen_update_colors                 (TerminalScreen        *screen);
  17
+@@ -132,6 +133,8 @@ struct _TerminalScreen
  18
+   GtkWidget           *scrollbar;
  19
+   GtkWidget           *tab_label;
  20
+ 
  21
++  gulong              background_signal_id;
  22
++
  23
+   GPid                 pid;
  24
+   gchar               *working_directory;
  25
+ 
  26
+@@ -231,7 +234,6 @@ terminal_screen_init (TerminalScreen *sc
  27
+                     "signal::context-menu", G_CALLBACK (terminal_screen_vte_get_context_menu), screen,
  28
+                     "signal::selection-changed", G_CALLBACK (terminal_screen_vte_selection_changed), screen,
  29
+                     "signal::window-title-changed", G_CALLBACK (terminal_screen_vte_window_title_changed), screen,
  30
+-                    "swapped-signal::size-allocate", G_CALLBACK (terminal_screen_timer_background), screen,
  31
+                     "swapped-signal::style-set", G_CALLBACK (terminal_screen_update_colors), screen,
  32
+                     NULL);
  33
+   gtk_box_pack_start (GTK_BOX (screen), screen->terminal, TRUE, TRUE, 0);
  34
+@@ -573,6 +575,18 @@ terminal_screen_get_child_environment (T
  35
+ 
  36
+ 
  37
+ static void
  38
++terminal_screen_update_background_fast (TerminalScreen *screen)
  39
++{
  40
++  if (G_UNLIKELY (screen->background_timer_id == 0))
  41
++    {
  42
++      screen->background_timer_id = g_idle_add_full (G_PRIORITY_LOW, terminal_screen_timer_background,
  43
++                                                     screen, terminal_screen_timer_background_destroy);
  44
++    }
  45
++}
  46
++
  47
++
  48
++
  49
++static void
  50
+ terminal_screen_update_background (TerminalScreen *screen)
  51
+ {
  52
+   if (G_UNLIKELY (screen->background_timer_id != 0))
  53
+@@ -1015,9 +1029,25 @@ terminal_screen_timer_background (gpoint
  54
+       if (G_LIKELY (image != NULL))
  55
+         g_object_unref (G_OBJECT (image));
  56
+       g_object_unref (G_OBJECT (loader));
  57
++      
  58
++            /* refresh background on size changes */
  59
++            if (screen->background_signal_id == 0)
  60
++              {
  61
++                screen->background_signal_id =
  62
++                   g_signal_connect_swapped (G_OBJECT (screen->terminal), "size-allocate",
  63
++                                             G_CALLBACK (terminal_screen_update_background_fast), screen);
  64
++              }
  65
+     }
  66
+   else
  67
+     {
  68
++          /* stop updating on size changes */
  69
++          if (screen->background_signal_id != 0)
  70
++            {
  71
++              g_signal_handler_disconnect (G_OBJECT (screen->terminal), screen->background_signal_id);
  72
++              screen->background_signal_id = 0;
  73
++            }
  74
++    
  75
++          /* WARNING: the causes a resize too! */
  76
+       vte_terminal_set_background_image (VTE_TERMINAL (screen->terminal), NULL);
  77
+     }
  78
+ 

0 notes on commit 10b0539

Please sign in to comment.
Something went wrong with that request. Please try again.