[gtk/wip/carlosg/for-master: 1/3] gkt/textview: Set an iter position for event-less menu activation




commit 47d0b5ad0c20e0fbfc7de7d565adfb3f07f620a5
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Dec 8 14:45:16 2020 +0100

    gkt/textview: Set an iter position for event-less menu activation
    
    This went missing. Use the current insertion position as a reference.
    Fixes invoking the menu via keyboard.

 gtk/gtktextview.c | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c
index ce097cb586..5a4ad33e2a 100644
--- a/gtk/gtktextview.c
+++ b/gtk/gtktextview.c
@@ -8666,11 +8666,15 @@ gtk_text_view_do_popup (GtkTextView *text_view,
     }
   else
     {
+      GtkTextBuffer *buffer;
       GtkTextIter iter;
       GdkRectangle iter_location;
       GdkRectangle visible_rect;
       gboolean is_visible;
 
+      buffer = get_buffer (text_view);
+      gtk_text_buffer_get_iter_at_mark (buffer, &iter,
+                                        gtk_text_buffer_get_insert (buffer));
       gtk_text_view_get_iter_location (text_view, &iter, &iter_location);
       gtk_text_view_get_visible_rect (text_view, &visible_rect);
 


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