After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 702078 - EvView should notify when the caret cursor has been moved
EvView should notify when the caret cursor has been moved
Status: RESOLVED FIXED
Product: evince
Classification: Core
Component: general
3.9.x
Other Linux
: Normal normal
: ---
Assigned To: Antía Puentes
Evince Maintainers
Depends on:
Blocks: 701732 701746
 
 
Reported: 2013-06-12 10:37 UTC by Carlos Garcia Campos
Modified: 2013-06-28 07:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Added 'cursor-moved' signal (1.46 KB, patch)
2013-06-26 18:10 UTC, Antía Puentes
needs-work Details | Review
Added 'cursor-moved' signal (1.73 KB, patch)
2013-06-27 18:15 UTC, Antía Puentes
committed Details | Review

Description Carlos Garcia Campos 2013-06-12 10:37:28 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).
Comment 1 Antía Puentes 2013-06-26 18:10:44 UTC
Created attachment 247849 [details] [review]
Added 'cursor-moved' signal
Comment 2 Carlos Garcia Campos 2013-06-27 15:49:09 UTC
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.
Comment 3 Antía Puentes 2013-06-27 18:15:17 UTC
Created attachment 247931 [details] [review]
Added 'cursor-moved' signal
Comment 4 Carlos Garcia Campos 2013-06-28 07:56:17 UTC
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.