[evince/BUG_no_previews_on_scroll] EvView: preview popups only triggered by motion events
- From: Nelson Ben <nbenitez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evince/BUG_no_previews_on_scroll] EvView: preview popups only triggered by motion events
- Date: Mon, 17 Jan 2022 01:10:47 +0000 (UTC)
commit 8adc7c3b4638242776e932fed6ee70124aed2c2f
Author: Nelson Benítez León <nbenitezl gmail com>
Date: Sun Jan 16 19:08:20 2022 -0400
EvView: preview popups only triggered by motion events
to avoid unwanted previews showing up in any of these
situations:
- when scrolling the view
- when pressing PageUp/PageDown or NextPage/PrevPage keys
- when changing to a page by clicking a bookmark or outline entry
we make sure to only show them when moving the mouse over them
(motion events).
Fixes issue #1666
libview/ev-view.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
---
diff --git a/libview/ev-view.c b/libview/ev-view.c
index 69c5904e6..455551901 100644
--- a/libview/ev-view.c
+++ b/libview/ev-view.c
@@ -2221,11 +2221,13 @@ ev_view_handle_cursor_over_xy (EvView *view, gint x, gint y)
EvLinkDest *dest;
EvLinkDestType type;
GtkWidget *popover, *spinner;
+ GdkEvent *event;
cairo_surface_t *page_surface = NULL;
guint link_dest_page;
EvPoint link_dest_doc;
GdkPoint link_dest_view;
gint device_scale = 1;
+ gboolean from_motion = FALSE;
ev_view_set_cursor (view, EV_VIEW_CURSOR_LINK);
@@ -2241,6 +2243,18 @@ ev_view_handle_cursor_over_xy (EvView *view, gint x, gint y)
if (!dest)
return;
+ event = gtk_get_current_event ();
+ if (event) {
+ if (event->type == GDK_MOTION_NOTIFY &&
+ gdk_event_get_window (event) == gtk_widget_get_window (GTK_WIDGET (view))) {
+ from_motion = TRUE;
+ }
+ gdk_event_free (event);
+ }
+ /* Show preview popups only for motion events - Issue #1666 */
+ if (!from_motion)
+ return;
+
type = ev_link_dest_get_dest_type (dest);
if (type == EV_LINK_DEST_TYPE_NAMED) {
dest = ev_document_links_find_link_dest (EV_DOCUMENT_LINKS (view->document),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]