Blame SOURCES/evince-3.28.4-handle-clicks-in-forms.patch

56e94f
From 7c6c930f7fa164700d089d646dc8300340ca4600 Mon Sep 17 00:00:00 2001
56e94f
From: =?UTF-8?q?Nelson=20Ben=C3=ADtez=20Le=C3=B3n?= <nbenitezl@gmail.com>
56e94f
Date: Mon, 6 Apr 2020 14:38:53 -0400
56e94f
Subject: [PATCH] EvFormField: allow text entries to handle clicks
56e94f
56e94f
so the user can interact with the text entry for
56e94f
eg. placing text cursor in an arbitrary position
56e94f
56e94f
Fixes #1364
56e94f
---
56e94f
 libview/ev-view.c | 14 ++++++++++++++
56e94f
 1 file changed, 14 insertions(+)
56e94f
56e94f
diff --git a/libview/ev-view.c b/libview/ev-view.c
56e94f
index f73f0ce9..1ebcb584 100644
56e94f
--- a/libview/ev-view.c
56e94f
+++ b/libview/ev-view.c
56e94f
@@ -2497,6 +2497,14 @@ ev_view_form_field_text_focus_out (GtkWidget     *widget,
56e94f
 	return FALSE;
56e94f
 }
56e94f
 
56e94f
+static gboolean
56e94f
+ev_view_form_field_text_button_pressed (GtkWidget      *widget,
56e94f
+					GdkEventButton *event,
56e94f
+					gpointer        data)
56e94f
+{
56e94f
+	return GDK_EVENT_STOP;
56e94f
+}
56e94f
+
56e94f
 static GtkWidget *
56e94f
 ev_view_form_field_text_create_widget (EvView      *view,
56e94f
 				       EvFormField *field)
56e94f
@@ -2536,6 +2544,9 @@ ev_view_form_field_text_create_widget (EvView      *view,
56e94f
 			g_signal_connect_after (text, "activate",
56e94f
 						G_CALLBACK (ev_view_form_field_destroy),
56e94f
 						view);
56e94f
+			g_signal_connect_after (text, "button-press-event",
56e94f
+						G_CALLBACK (ev_view_form_field_text_button_pressed),
56e94f
+						NULL);
56e94f
 			break;
56e94f
 	        case EV_FORM_FIELD_TEXT_MULTILINE: {
56e94f
 			GtkTextBuffer *buffer;
56e94f
@@ -2554,6 +2565,9 @@ ev_view_form_field_text_create_widget (EvView      *view,
56e94f
 			g_signal_connect (buffer, "changed",
56e94f
 					  G_CALLBACK (ev_view_form_field_text_changed),
56e94f
 					  field);
56e94f
+			g_signal_connect_after (text, "button-press-event",
56e94f
+						G_CALLBACK (ev_view_form_field_text_button_pressed),
56e94f
+						NULL);
56e94f
 		}
56e94f
 			break;
56e94f
 	}			
56e94f
-- 
56e94f
2.31.1
56e94f