Branch: refs/heads/master Author: Colomban Wendling ban@herbesfolles.org Committer: Colomban Wendling ban@herbesfolles.org Date: Thu, 12 Oct 2023 21:45:30 UTC Commit: d10cfb503d30ee9bb7848f171dc857e2e90f0de5 https://github.com/geany/geany/commit/d10cfb503d30ee9bb7848f171dc857e2e90f0d...
Log Message: ----------- Position goto popup at the mouse when triggered with it
Recent changes made it always popup at the caret, which is almost OK as the caret is moved to the click location, but it is still better to actually popup at the pointer when a click triggered it so the position relative to the pointer is always the same.
Modified Paths: -------------- src/symbols.c
Modified: src/symbols.c 9 lines changed, 8 insertions(+), 1 deletions(-) =================================================================== @@ -1432,6 +1432,7 @@ static void show_goto_popup(GeanyDocument *doc, GPtrArray *tags, gboolean have_b GtkWidget *first = NULL; GtkWidget *menu; GtkSizeGroup *group = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); + GdkEvent *event; TMTag *tmtag; guint i; gchar **short_names, **file_names; @@ -1497,7 +1498,13 @@ static void show_goto_popup(GeanyDocument *doc, GPtrArray *tags, gboolean have_b if (first) /* always select the first item for better keyboard navigation */ g_signal_connect(menu, "realize", G_CALLBACK(gtk_menu_shell_select_item), first);
- show_menu_at_caret(GTK_MENU(menu), doc->editor->sci); + event = gtk_get_current_event(); + if (event && event->type == GDK_BUTTON_PRESS) + gtk_menu_popup_at_pointer(GTK_MENU(menu), event); + else + show_menu_at_caret(GTK_MENU(menu), doc->editor->sci); + if (event) + gdk_event_free(event);
g_object_unref(group); }
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).