[gnome-todo] edit-panel: Work around textview-on-listbox focus issue



commit 09cf76df6e3e6005c2879e91f9935815933123e8
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Sun May 3 08:42:03 2020 -0300

    edit-panel: Work around textview-on-listbox focus issue
    
    We can be a bit more heavy handed and make sure the focus
    is on the text view after clicking.

 src/task-list-view/gtd-edit-pane.c  | 3 +++
 src/task-list-view/gtd-edit-pane.ui | 1 +
 2 files changed, 4 insertions(+)
---
diff --git a/src/task-list-view/gtd-edit-pane.c b/src/task-list-view/gtd-edit-pane.c
index fe0c71f..cac2f29 100644
--- a/src/task-list-view/gtd-edit-pane.c
+++ b/src/task-list-view/gtd-edit-pane.c
@@ -284,6 +284,9 @@ on_hyperlink_clicked_cb (GtkGestureClick *gesture,
   text_view = GTK_TEXT_VIEW (gtk_event_controller_get_widget (GTK_EVENT_CONTROLLER (gesture)));
   buffer = gtk_text_view_get_buffer (text_view);
 
+  /* Ensure focus */
+  gtk_widget_grab_focus (GTK_WIDGET (text_view));
+
   /* We shouldn't follow a link if the user has selected something */
   if (gtk_text_buffer_get_has_selection (buffer))
     return;
diff --git a/src/task-list-view/gtd-edit-pane.ui b/src/task-list-view/gtd-edit-pane.ui
index 2f636af..3b7e0b8 100644
--- a/src/task-list-view/gtd-edit-pane.ui
+++ b/src/task-list-view/gtd-edit-pane.ui
@@ -108,6 +108,7 @@
             </child>
             <child>
               <object class="GtkEventControllerMotion">
+                <property name="propagation-phase">capture</property>
                 <signal name="motion" handler="on_hyperlink_hover_cb" object="GtdEditPane" swapped="no"/>
               </object>
             </child>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]