Just been testing xfce (very recent pkgsrc) on NetBSD 6_STABLE. The terminal application xfce4-terminal uses 100% CPU. There is a pr about this (45448) dating from over a year ago for the current version of xfce4-terminal-0.4.2 I tested the proposed fix and it seems to work fine. Could someone look at this pr, commit the fix and close the pr. I have enclosed a patch file which applies cleanly. The distinfo file needs a line for the patch: SHA1 (patch-terminal-screen.c) = 68145bdec7ae2af9faf6474e667ae76a856df6ac Cheers, Dave -- ===================================================================== Phone: 07805784357 Open Source O/S: http://www.netbsd.org Caving: http://www.wirralcavinggroup.org.uk ===================================================================== |
--- terminal/terminal-screen.c.orig 2009-10-06 16:07:01.000000000 +0100 +++ terminal/terminal-screen.c 2012-12-20 00:00:40.000000000 +0000 @@ -87,6 +87,7 @@ 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 @@ GtkWidget *scrollbar; GtkWidget *tab_label; + gulong background_signal_id; + GPid pid; gchar *working_directory; @@ -231,7 +234,6 @@ "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 @@ 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 @@ 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); }