[vte] a11y: Use correct function to compare colours
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vte] a11y: Use correct function to compare colours
- Date: Sun, 6 Apr 2014 09:35:29 +0000 (UTC)
commit 883088e1fe82b77fba101d9ec02cf96f66c50e91
Author: Christian Persch <chpe gnome org>
Date: Fri Apr 4 10:45:47 2014 +0200
a11y: Use correct function to compare colours
Can't compare PangoColors with gdk_color_equal!
src/vteaccess.c | 17 +++++++++++++----
1 files changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/src/vteaccess.c b/src/vteaccess.c
index ad4de73..02224af 100644
--- a/src/vteaccess.c
+++ b/src/vteaccess.c
@@ -1455,6 +1455,15 @@ get_attribute_set (struct _VteCharAttributes attr)
return set;
}
+static gboolean
+_pango_color_equal(const PangoColor *a,
+ const PangoColor *b)
+{
+ return a->red == b->red &&
+ a->green == b->green &&
+ a->blue == b->blue;
+}
+
static AtkAttributeSet *
vte_terminal_accessible_get_run_attributes(AtkText *text, gint offset,
gint *start_offset, gint *end_offset)
@@ -1478,8 +1487,8 @@ vte_terminal_accessible_get_run_attributes(AtkText *text, gint offset,
cur_attr = g_array_index (priv->snapshot_attributes,
struct _VteCharAttributes,
i);
- if (!gdk_color_equal (&cur_attr.fore, &attr.fore) ||
- !gdk_color_equal (&cur_attr.back, &attr.back) ||
+ if (!_pango_color_equal (&cur_attr.fore, &attr.fore) ||
+ !_pango_color_equal (&cur_attr.back, &attr.back) ||
cur_attr.underline != attr.underline ||
cur_attr.strikethrough != attr.strikethrough) {
*start_offset = i + 1;
@@ -1491,8 +1500,8 @@ vte_terminal_accessible_get_run_attributes(AtkText *text, gint offset,
cur_attr = g_array_index (priv->snapshot_attributes,
struct _VteCharAttributes,
i);
- if (!gdk_color_equal (&cur_attr.fore, &attr.fore) ||
- !gdk_color_equal (&cur_attr.back, &attr.back) ||
+ if (!_pango_color_equal (&cur_attr.fore, &attr.fore) ||
+ !_pango_color_equal (&cur_attr.back, &attr.back) ||
cur_attr.underline != attr.underline ||
cur_attr.strikethrough != attr.strikethrough) {
*end_offset = i - 1;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]