[evince] ev-view-accessible: Initialize private fields
- From: Germán Poo-Caamaño <gpoo src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evince] ev-view-accessible: Initialize private fields
- Date: Tue, 1 Oct 2019 14:47:36 +0000 (UTC)
commit 8e13d1ce309f08bb450d5fc1e73818a61a3156a6
Author: Samuel Thibault <samuel thibault ens-lyon org>
Date: Fri Aug 30 15:25:46 2019 +0200
ev-view-accessible: Initialize private fields
Otherwise the default zero initialization will make
ev_view_accessible_set_page_range think that we already have page range
0-0 set.
Fixes GNOME/orca#54
libview/ev-view-accessible.c | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
---
diff --git a/libview/ev-view-accessible.c b/libview/ev-view-accessible.c
index 0f104c8c..f7e48db8 100644
--- a/libview/ev-view-accessible.c
+++ b/libview/ev-view-accessible.c
@@ -122,6 +122,8 @@ static void
ev_view_accessible_initialize (AtkObject *obj,
gpointer data)
{
+ EvViewAccessiblePrivate *priv;
+
if (ATK_OBJECT_CLASS (ev_view_accessible_parent_class)->initialize != NULL)
ATK_OBJECT_CLASS (ev_view_accessible_parent_class)->initialize (obj, data);
@@ -129,6 +131,11 @@ ev_view_accessible_initialize (AtkObject *obj,
atk_object_set_name (obj, _("Document View"));
atk_object_set_role (obj, ATK_ROLE_DOCUMENT_FRAME);
+
+ priv = EV_VIEW_ACCESSIBLE (obj)->priv;
+ priv->previous_cursor_page = -1;
+ priv->start_page = 0;
+ priv->end_page = -1;
}
gint
@@ -326,12 +333,15 @@ ev_view_accessible_cursor_moved (EvView *view,
EvPageAccessible *page_accessible = NULL;
if (priv->previous_cursor_page != page) {
- AtkObject *previous_page = NULL;
AtkObject *current_page = NULL;
- previous_page = g_ptr_array_index (priv->children,
- priv->previous_cursor_page);
- atk_object_notify_state_change (previous_page, ATK_STATE_FOCUSED, FALSE);
+ if (priv->previous_cursor_page >= 0) {
+ AtkObject *previous_page = NULL;
+ previous_page = g_ptr_array_index (priv->children,
+ priv->previous_cursor_page);
+ atk_object_notify_state_change (previous_page, ATK_STATE_FOCUSED, FALSE);
+ }
+
priv->previous_cursor_page = page;
current_page = g_ptr_array_index (priv->children, page);
atk_object_notify_state_change (current_page, ATK_STATE_FOCUSED, TRUE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]