[balsa/wip/gtk4: 271/351] mime-widget-text: Grab the focus when realized
- From: Peter Bloomfield <peterb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [balsa/wip/gtk4: 271/351] mime-widget-text: Grab the focus when realized
- Date: Wed, 23 May 2018 21:39:45 +0000 (UTC)
commit d92011cb2d14dfd48e7fbaa63b66a76c5eb1e31c
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date: Wed Apr 4 10:54:21 2018 -0400
mime-widget-text: Grab the focus when realized
The first time we click in a text part, the text widget grabs the
focus, and that leads the container that holds it to scroll to
its focus child, namely the text widget. That moves the text
under the pointer, so the click is received somewhere other than
was intended. Grabbing the focus on realization seems to avert
the scrolling.
src/balsa-mime-widget-text.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/balsa-mime-widget-text.c b/src/balsa-mime-widget-text.c
index 4a68617..07cf08b 100644
--- a/src/balsa-mime-widget-text.c
+++ b/src/balsa-mime-widget-text.c
@@ -498,6 +498,16 @@ fix_text_widget(GtkWidget *widget, gpointer data)
}
gtk_widget_set_cursor(widget, url_cursor_normal);
+ /*
+ * The first time we click in a text part, the text widget grabs the
+ * focus, and that leads the container that holds it to scroll to
+ * its focus child, namely the text widget. That moves the text
+ * under the pointer, so the click is received somewhere other than
+ * was intended. Grabbing the focus on realization seems to avert
+ * the scrolling.
+ */
+ gtk_widget_grab_focus(widget);
+
return FALSE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]