GNOME Bugzilla – Bug 702078
EvView should notify when the caret cursor has been moved
Last modified: 2013-06-28 07:56:35 UTC
This is needed by EvViewAccessible to emit the ATK signals. We could use a read only property cursor-position (similar to what GtkEntry and GtkLabel does). But maybe it's a bit confusing because the offset we keep is per page, not global to the ev-view, so maybe it's better to add a signal caret-cursor-moved and add API to get the caret position (page + offset).
Created attachment 247849 [details] [review] Added 'cursor-moved' signal
Review of attachment 247849 [details] [review]: Thanks ::: libview/ev-view.c @@ +5069,3 @@ + /* Notify the caret cursor movement */ + g_signal_emit (view, signals[SIGNAL_CURSOR_MOVED], 0, view->cursor_page, view->cursor_offset); The comment is a bit redundant since we are emitting a signal called cursor-moved. I think it would be better to emit the signal after ensure_rectangle_is_visible, to make sure there's a match between caret page and cursor values and what is visible in the screen. We should also emit the signal when moving the caret with the mouse.
Created attachment 247931 [details] [review] Added 'cursor-moved' signal
Review of attachment 247931 [details] [review]: Move the signal emission to position_caret_cursor_for_event and pushed it to git master. Thanks! ::: libview/ev-view.c @@ +4090,3 @@ view->cursor_page = page; + g_signal_emit (view, signals[SIGNAL_CURSOR_MOVED], 0, view->cursor_page, view->cursor_offset); We can't emit the signal here, note that position_caret_cursor_at_location is also used when moving between lines with the keyboard.