summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMart Raudsepp <leio@gentoo.org>2006-09-24 04:02:08 +0000
committerMart Raudsepp <leio@gentoo.org>2006-09-24 04:02:08 +0000
commitdad9e277ca8b623b28a23c3c69fd73f94c7f2406 (patch)
tree976e582470d8dfc66b278b9e21bf87abbefa52bc
parentAdd forgotten ChangeLog (diff)
downloadgnome-perf-dad9e277ca8b623b28a23c3c69fd73f94c7f2406.tar.gz
gnome-perf-dad9e277ca8b623b28a23c3c69fd73f94c7f2406.tar.bz2
gnome-perf-dad9e277ca8b623b28a23c3c69fd73f94c7f2406.zip
Don't poll/timeout for cursor blinking in VTE when it's not necessary (blinking cursor pref off, or window not focused).
-rw-r--r--x11-libs/vte/ChangeLog8
-rw-r--r--x11-libs/vte/Manifest16
-rw-r--r--x11-libs/vte/files/digest-vte-0.14.03
-rw-r--r--x11-libs/vte/files/vte-0.13.2-no-lazy-bindings.patch11
-rw-r--r--x11-libs/vte/files/vte-cursor-blink.patch342
-rw-r--r--x11-libs/vte/vte-0.14.0.ebuild56
6 files changed, 436 insertions, 0 deletions
diff --git a/x11-libs/vte/ChangeLog b/x11-libs/vte/ChangeLog
new file mode 100644
index 0000000..dc062bf
--- /dev/null
+++ b/x11-libs/vte/ChangeLog
@@ -0,0 +1,8 @@
+# ChangeLog for x11-libs/vte
+# Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2
+# $Header: $
+
+ 24 Sep 2006; Mart Raudsepp <leio@gentoo.org> ChangeLog:
+ Don't poll/timeout for cursor blinking when it's not necessary (blinking
+ cursor pref off, or window not focused).
+
diff --git a/x11-libs/vte/Manifest b/x11-libs/vte/Manifest
new file mode 100644
index 0000000..7dfea79
--- /dev/null
+++ b/x11-libs/vte/Manifest
@@ -0,0 +1,16 @@
+AUX vte-0.13.2-no-lazy-bindings.patch 356 RMD160 42555101f894ee6dea01cb792d4c631110f42150 SHA1 a21e7dd7e8aac7d7930f0501c303d53f6b7275d3 SHA256 7e666e1ea32cb99549218c77ffbc0ac73ed9d24c4885b02df676f6ecac458fce
+MD5 287d6f6a10538c544327294e2b36edc7 files/vte-0.13.2-no-lazy-bindings.patch 356
+RMD160 42555101f894ee6dea01cb792d4c631110f42150 files/vte-0.13.2-no-lazy-bindings.patch 356
+SHA256 7e666e1ea32cb99549218c77ffbc0ac73ed9d24c4885b02df676f6ecac458fce files/vte-0.13.2-no-lazy-bindings.patch 356
+AUX vte-cursor-blink.patch 10467 RMD160 23a9ec1e09269e616bc1384f12e732ba0665086f SHA1 8c2f3c3fcd8d750bd258e451faeef0ab60c72ac6 SHA256 3308323bc42f5ca490953bfd159d63a50e7dcddfaed7ddb038603c3b4bc592b2
+MD5 1dd7e18d8c5f1c755c281e3396d6bfec files/vte-cursor-blink.patch 10467
+RMD160 23a9ec1e09269e616bc1384f12e732ba0665086f files/vte-cursor-blink.patch 10467
+SHA256 3308323bc42f5ca490953bfd159d63a50e7dcddfaed7ddb038603c3b4bc592b2 files/vte-cursor-blink.patch 10467
+DIST vte-0.14.0.tar.bz2 1010026 RMD160 6193b01fcd1193a3ff64fea45c8294ca95747926 SHA1 d9db8360f79c59c7740e8ec3e727b25c86086206 SHA256 b807803603b3b0c8b57ffba4bd6c6bc4060ffcc3393571829427c1442c6bccf9
+EBUILD vte-0.14.0.ebuild 1377 RMD160 c5330f0a0626bccd25a1c9b171790588222ff9bd SHA1 8b791a1c87e65046d7d2f00b3d554b325760b79b SHA256 dce5923aec3a0df406a848b3999915c2f74c5d4c70488f1e2a4d87158c6bdebe
+MD5 12f3ac6d288d656fcfd83d88650e5d43 vte-0.14.0.ebuild 1377
+RMD160 c5330f0a0626bccd25a1c9b171790588222ff9bd vte-0.14.0.ebuild 1377
+SHA256 dce5923aec3a0df406a848b3999915c2f74c5d4c70488f1e2a4d87158c6bdebe vte-0.14.0.ebuild 1377
+MD5 4bd3837319cb63d5f0da1d0348211228 files/digest-vte-0.14.0 238
+RMD160 858bc713b029f5fd80de1d0d3de9d5f5cd23a6b6 files/digest-vte-0.14.0 238
+SHA256 98241dec3a1e5839f819d59de1905510b6b1f1179540c92bba103a5b5ec3c440 files/digest-vte-0.14.0 238
diff --git a/x11-libs/vte/files/digest-vte-0.14.0 b/x11-libs/vte/files/digest-vte-0.14.0
new file mode 100644
index 0000000..beeaeb1
--- /dev/null
+++ b/x11-libs/vte/files/digest-vte-0.14.0
@@ -0,0 +1,3 @@
+MD5 42c6929f2072f1373cf37942896bb332 vte-0.14.0.tar.bz2 1010026
+RMD160 6193b01fcd1193a3ff64fea45c8294ca95747926 vte-0.14.0.tar.bz2 1010026
+SHA256 b807803603b3b0c8b57ffba4bd6c6bc4060ffcc3393571829427c1442c6bccf9 vte-0.14.0.tar.bz2 1010026
diff --git a/x11-libs/vte/files/vte-0.13.2-no-lazy-bindings.patch b/x11-libs/vte/files/vte-0.13.2-no-lazy-bindings.patch
new file mode 100644
index 0000000..3eaa3bb
--- /dev/null
+++ b/x11-libs/vte/files/vte-0.13.2-no-lazy-bindings.patch
@@ -0,0 +1,11 @@
+--- gnome-pty-helper/Makefile.am 2006-06-13 21:36:27.000000000 -0500
++++ gnome-pty-helper/Makefile.am 2006-06-13 21:37:08.000000000 -0500
+@@ -1,7 +1,7 @@
+ libexec_PROGRAMS = gnome-pty-helper
+
+ AM_CFLAGS = $(GLIB_CFLAGS)
+-AM_LDFLAGS = $(LDFLAGS) $(GLIB_LIBS)
++AM_LDFLAGS = -Wl,-z,now $(LDFLAGS) $(GLIB_LIBS)
+
+ gnome_pty_helper_SOURCES = \
+ gnome-pty.h \
diff --git a/x11-libs/vte/files/vte-cursor-blink.patch b/x11-libs/vte/files/vte-cursor-blink.patch
new file mode 100644
index 0000000..ce61a26
--- /dev/null
+++ b/x11-libs/vte/files/vte-cursor-blink.patch
@@ -0,0 +1,342 @@
+From GNOME Bugzilla:
+
+http://bugzilla.gnome.org/show_bug.cgi?id=356552 - cursor timeout runs all the time
+http://bugzilla.gnome.org/attachment.cgi?id=72996
+
+Index: src/vte-private.h
+===================================================================
+RCS file: /cvs/gnome/vte/src/vte-private.h,v
+retrieving revision 1.13
+diff -u -p -r1.13 vte-private.h
+--- src/vte-private.h 24 Jul 2006 21:59:23 -0000 1.13
++++ src/vte-private.h 18 Sep 2006 18:42:34 -0000
+@@ -275,10 +275,11 @@ struct _VteTerminalPrivate {
+ long scrollback_lines;
+
+ /* Cursor blinking. */
+- int cursor_force_fg;
++ gboolean cursor_blink_state;
+ gboolean cursor_blinks;
+ gint cursor_blink_tag;
+ gint cursor_blink_timeout;
++ gint64 cursor_blink_time;
+ gboolean cursor_visible;
+
+ /* Input device options. */
+Index: src/vte.c
+===================================================================
+RCS file: /cvs/gnome/vte/src/vte.c,v
+retrieving revision 1.486
+diff -u -p -r1.486 vte.c
+--- src/vte.c 13 Sep 2006 21:58:26 -0000 1.486
++++ src/vte.c 18 Sep 2006 18:42:42 -0000
+@@ -495,41 +495,48 @@ static gboolean
+ vte_invalidate_cursor_periodic(gpointer data)
+ {
+ VteTerminal *terminal;
+- GtkWidget *widget;
+ GtkSettings *settings;
+- gint blink_cycle = 1000;
++ int blink_cycle = 1000;
++ int timeout = INT_MAX;
+
+ g_assert(VTE_IS_TERMINAL(data));
+- widget = GTK_WIDGET(data);
+- if (!GTK_WIDGET_REALIZED(widget)) {
+- return TRUE;
+- }
+- if (!GTK_WIDGET_HAS_FOCUS(widget)) {
+- return TRUE;
+- }
+
+- terminal = VTE_TERMINAL(widget);
+- if (terminal->pvt->cursor_blinks) {
+- _vte_invalidate_cursor_once(terminal, TRUE);
+- }
++ terminal = VTE_TERMINAL (data);
+
+- settings = gtk_widget_get_settings(GTK_WIDGET(data));
+- if (G_IS_OBJECT(settings)) {
+- g_object_get(G_OBJECT(settings), "gtk-cursor-blink-time",
+- &blink_cycle, NULL);
+- }
++ settings = gtk_widget_get_settings (GTK_WIDGET (data));
++
++ terminal->pvt->cursor_blink_state = !terminal->pvt->cursor_blink_state;
++ terminal->pvt->cursor_blink_time += terminal->pvt->cursor_blink_timeout;
++
++ _vte_invalidate_cursor_once(terminal, TRUE);
++
++ if (!GTK_IS_SETTINGS (settings))
++ return TRUE;
++
++ g_object_get (G_OBJECT (settings), "gtk-cursor-blink-timeout",
++ &timeout, NULL);
+
+- if (terminal->pvt->cursor_blink_timeout != blink_cycle) {
+- terminal->pvt->cursor_blink_tag = g_timeout_add_full(G_PRIORITY_LOW,
+- blink_cycle / 2,
+- vte_invalidate_cursor_periodic,
+- terminal,
+- NULL);
+- terminal->pvt->cursor_blink_timeout = blink_cycle;
++ /* only disable the blink if the cursor is currently shown.
++ * else, wait until next time.
++ */
++ if (terminal->pvt->cursor_blink_time / 1000 >= timeout &&
++ terminal->pvt->cursor_blink_state)
+ return FALSE;
+- } else {
++
++ g_object_get (G_OBJECT (settings), "gtk-cursor-blink-time",
++ &blink_cycle, NULL);
++ blink_cycle /= 2;
++
++ if (terminal->pvt->cursor_blink_timeout == blink_cycle)
+ return TRUE;
+- }
++
++ terminal->pvt->cursor_blink_timeout = blink_cycle;
++ terminal->pvt->cursor_blink_tag = g_timeout_add_full(G_PRIORITY_LOW,
++ terminal->pvt->cursor_blink_timeout,
++ vte_invalidate_cursor_periodic,
++ terminal,
++ NULL);
++ return FALSE;
+ }
+
+ /* Emit a "selection_changed" signal. */
+@@ -3755,6 +3762,36 @@ vte_terminal_style_changed(GtkWidget *wi
+ }
+ }
+
++static void
++add_cursor_timeout (VteTerminal *terminal)
++{
++ GtkSettings *settings;
++
++ /* Setup cursor blink */
++ settings = gtk_widget_get_settings(GTK_WIDGET(terminal));
++ if (G_IS_OBJECT(settings)) {
++ gint blink_cycle = 1000;
++ g_object_get(G_OBJECT(settings), "gtk-cursor-blink-time",
++ &blink_cycle, NULL);
++ terminal->pvt->cursor_blink_timeout = blink_cycle / 2;
++ }
++
++ terminal->pvt->cursor_blink_time = 0;
++ terminal->pvt->cursor_blink_tag = g_timeout_add_full(G_PRIORITY_LOW,
++ terminal->pvt->cursor_blink_timeout,
++ vte_invalidate_cursor_periodic,
++ terminal,
++ NULL);
++}
++
++static void
++remove_cursor_timeout (VteTerminal *terminal)
++{
++ g_source_remove (terminal->pvt->cursor_blink_tag);
++ terminal->pvt->cursor_blink_tag = VTE_INVALID_SOURCE;
++}
++
++
+ /* Read and handle a keypress event. */
+ static gint
+ vte_terminal_key_press(GtkWidget *widget, GdkEventKey *event)
+@@ -3815,10 +3852,11 @@ vte_terminal_key_press(GtkWidget *widget
+ }
+ }
+
+- /* Log the time of the last keypress. */
+- if (gettimeofday(&tv, &tz) == 0) {
+- terminal->pvt->last_keypress_time =
+- (tv.tv_sec * 1000) + (tv.tv_usec / 1000);
++ if (terminal->pvt->cursor_blink_tag != VTE_INVALID_SOURCE)
++ {
++ remove_cursor_timeout (terminal);
++ terminal->pvt->cursor_blink_state = TRUE;
++ add_cursor_timeout (terminal);
+ }
+
+ /* Determine if this is just a modifier key. */
+@@ -6057,16 +6095,20 @@ vte_terminal_focus_in(GtkWidget *widget,
+ if (gdk_event_get_state((GdkEvent*)event, &modifiers)) {
+ terminal->pvt->modifiers = modifiers;
+ }
++
+ /* We only have an IM context when we're realized, and there's not much
+ * point to painting the cursor if we don't have a window. */
+ if (GTK_WIDGET_REALIZED(widget)) {
++ terminal->pvt->cursor_blink_state = TRUE;
++
++ if (terminal->pvt->cursor_blinks &&
++ terminal->pvt->cursor_blink_tag == VTE_INVALID_SOURCE)
++ add_cursor_timeout (terminal);
++
+ gtk_im_context_focus_in(terminal->pvt->im_context);
+- /* Force the cursor to be the foreground color twice, in case
+- we're in blinking mode and the next scheduled redraw occurs
+- just after the one we're about to perform. */
+- terminal->pvt->cursor_force_fg = 2;
+ _vte_invalidate_cursor_once(terminal, FALSE);
+ }
++
+ return FALSE;
+ }
+
+@@ -6094,6 +6136,10 @@ vte_terminal_focus_out(GtkWidget *widget
+ gtk_im_context_focus_out(terminal->pvt->im_context);
+ _vte_invalidate_cursor_once(terminal, FALSE);
+ }
++
++ if (terminal->pvt->cursor_blink_tag != VTE_INVALID_SOURCE)
++ remove_cursor_timeout (terminal);
++
+ return FALSE;
+ }
+
+@@ -6770,6 +6816,7 @@ vte_terminal_init(VteTerminal *terminal,
+ (gpointer)terminal);
+ pvt->incoming = _vte_buffer_new();
+ pvt->pending = g_array_new(TRUE, TRUE, sizeof(gunichar));
++ pvt->cursor_blink_tag = VTE_INVALID_SOURCE;
+ pvt->coalesce_timeout = VTE_INVALID_SOURCE;
+ pvt->display_timeout = VTE_INVALID_SOURCE;
+ pvt->update_timeout = VTE_INVALID_SOURCE;
+@@ -6815,14 +6862,7 @@ vte_terminal_init(VteTerminal *terminal,
+
+ /* Cursor blinking. */
+ pvt->cursor_visible = TRUE;
+- pvt->cursor_blink_timeout = 1000;
+-
+- /* Input options. */
+- if (gettimeofday(&tv, &tz) == 0) {
+- pvt->last_keypress_time = (tv.tv_sec * 1000) + (tv.tv_usec / 1000);
+- } else {
+- pvt->last_keypress_time = 0;
+- }
++ pvt->cursor_blink_timeout = 500;
+
+ /* Matching data. */
+ pvt->match_regexes = g_array_new(FALSE, TRUE,
+@@ -7108,11 +7148,11 @@ vte_terminal_unrealize(GtkWidget *widget
+ }
+
+ /* Remove the blink timeout function. */
+- if (terminal->pvt->cursor_blink_tag != 0) {
++ if (terminal->pvt->cursor_blink_tag != VTE_INVALID_SOURCE) {
+ g_source_remove(terminal->pvt->cursor_blink_tag);
+- terminal->pvt->cursor_blink_tag = 0;
++ terminal->pvt->cursor_blink_tag = VTE_INVALID_SOURCE;
+ }
+- terminal->pvt->cursor_force_fg = 0;
++ terminal->pvt->cursor_blink_state = FALSE;
+
+ /* Cancel any pending background updates. */
+ if (terminal->pvt->bg_update_tag != VTE_INVALID_SOURCE) {
+@@ -7378,9 +7418,7 @@ vte_terminal_realize(GtkWidget *widget)
+ GdkWindowAttr attributes;
+ GdkPixmap *bitmap;
+ GdkColor black = {0,0,0}, color;
+- GtkSettings *settings;
+ int attributes_mask = 0, i;
+- gint blink_cycle = 1000;
+ VteBg *bg;
+
+ #ifdef VTE_DEBUG
+@@ -7474,18 +7512,6 @@ vte_terminal_realize(GtkWidget *widget)
+ vte_terminal_set_color_internal(terminal, i, &color);
+ }
+
+- /* Setup cursor blink */
+- settings = gtk_widget_get_settings(GTK_WIDGET(terminal));
+- if (G_IS_OBJECT(settings)) {
+- g_object_get(G_OBJECT(settings), "gtk-cursor-blink-time",
+- &blink_cycle, NULL);
+- }
+- terminal->pvt->cursor_blink_tag = g_timeout_add_full(G_PRIORITY_LOW,
+- blink_cycle / 2,
+- vte_invalidate_cursor_periodic,
+- terminal,
+- NULL);
+-
+ /* Set up input method support. FIXME: do we need to handle the
+ * "retrieve-surrounding" and "delete-surrounding" events? */
+ if (terminal->pvt->im_context != NULL) {
+@@ -8839,46 +8865,6 @@ vte_terminal_draw_cells_with_attributes(
+ g_free(cells);
+ }
+
+-static gboolean
+-vte_terminal_get_blink_state(VteTerminal *terminal)
+-{
+- struct timezone tz;
+- struct timeval tv;
+- gint blink_cycle = 1000;
+- GtkSettings *settings;
+- time_t daytime;
+- gboolean blink;
+- GtkWidget *widget;
+-
+- /* Determine if blinking text should be shown. */
+- if (terminal->pvt->cursor_blinks) {
+- if (gettimeofday(&tv, &tz) == 0) {
+- widget = GTK_WIDGET(terminal);
+- settings = gtk_widget_get_settings(widget);
+- if (G_IS_OBJECT(settings)) {
+- g_object_get(G_OBJECT(settings),
+- "gtk-cursor-blink-time",
+- &blink_cycle, NULL);
+- }
+- daytime = (tv.tv_sec * 1000) + (tv.tv_usec / 1000);
+- if (daytime >= terminal->pvt->last_keypress_time) {
+- daytime -= terminal->pvt->last_keypress_time;
+- }
+- daytime = daytime % blink_cycle;
+- blink = daytime < (blink_cycle / 2);
+- } else {
+- blink = TRUE;
+- }
+- } else {
+- blink = TRUE;
+- }
+- if (terminal->pvt->cursor_force_fg > 0) {
+- terminal->pvt->cursor_force_fg--;
+- blink = TRUE;
+- }
+- return blink;
+-}
+-
+ /* Paint the contents of a given row at the given location. Take advantage
+ * of multiple-draw APIs by finding runs of characters with identical
+ * attributes and bundling them together. */
+@@ -9190,7 +9176,7 @@ vte_terminal_paint(GtkWidget *widget, Gd
+ if (GTK_WIDGET_HAS_FOCUS(GTK_WIDGET(terminal))) {
+ selected = vte_cell_is_selected(terminal, col, drow,
+ NULL);
+- blink = vte_terminal_get_blink_state(terminal) ^
++ blink = terminal->pvt->cursor_blink_state ^
+ terminal->pvt->screen->reverse_mode;
+ vte_terminal_determine_colors(terminal, cell,
+ blink,
+@@ -10514,7 +10500,20 @@ void
+ vte_terminal_set_cursor_blinks(VteTerminal *terminal, gboolean blink)
+ {
+ g_return_if_fail(VTE_IS_TERMINAL(terminal));
++
++ if (terminal->pvt->cursor_blinks == blink)
++ return;
++
+ terminal->pvt->cursor_blinks = blink;
++
++ if (!GTK_WIDGET_REALIZED (terminal) ||
++ !GTK_WIDGET_HAS_FOCUS (GTK_WIDGET (terminal)))
++ return;
++
++ if (blink)
++ add_cursor_timeout (terminal);
++ else
++ remove_cursor_timeout (terminal);
+ }
+
+ /**
diff --git a/x11-libs/vte/vte-0.14.0.ebuild b/x11-libs/vte/vte-0.14.0.ebuild
new file mode 100644
index 0000000..6184a1b
--- /dev/null
+++ b/x11-libs/vte/vte-0.14.0.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/x11-libs/vte/vte-0.14.0.ebuild,v 1.1 2006/09/07 04:15:07 dang Exp $
+
+inherit eutils gnome2 autotools
+
+DESCRIPTION="Xft powered terminal widget"
+HOMEPAGE="http://www.gnome.org/"
+
+LICENSE="LGPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE="debug doc python opengl"
+
+RDEPEND=">=dev-libs/glib-2.9
+ >=x11-libs/gtk+-2.6
+ >=x11-libs/pango-1.1
+ >=media-libs/freetype-2.0.2
+ media-libs/fontconfig
+ sys-libs/ncurses
+ python? (
+ >=dev-python/pygtk-2.4
+ >=dev-lang/python-2.2
+ )
+ opengl? (
+ virtual/opengl
+ virtual/glu
+ )
+ || ( x11-libs/libX11 virtual/x11 )
+ virtual/xft"
+
+DEPEND="${RDEPEND}
+ doc? ( >=dev-util/gtk-doc-1.0 )
+ >=dev-util/intltool-0.35
+ >=dev-util/pkgconfig-0.9
+ sys-devel/gettext"
+
+DOCS="AUTHORS ChangeLog HACKING NEWS README"
+
+pkg_setup() {
+ G2CONF="$(use_enable debug debugging) $(use_enable python) \
+ $(use_with opengl glX) --with-xft2 --with-pangox"
+}
+
+src_unpack() {
+ gnome2_src_unpack
+
+ # Don't have a cursor blinking timeout when blinking is disabled or when the window does not have focus.
+ # That is, don't poll when we don't need to.
+ epatch "${FILESDIR}/vte-cursor-blink.patch"
+
+ epatch ${FILESDIR}/${PN}-0.13.2-no-lazy-bindings.patch
+
+ cd ${S}/gnome-pty-helper
+ eautomake
+}