Branch: refs/heads/master Author: Colomban Wendling ban@herbesfolles.org Committer: Colomban Wendling ban@herbesfolles.org Date: Thu, 12 Oct 2023 21:36:23 UTC Commit: 869606ee1427b3611d01ee37c4811942241bb320 https://github.com/geany/geany/commit/869606ee1427b3611d01ee37c4811942241bb3...
Log Message: ----------- Pass the event to gtk_menu_popup_at_pointer() when possible
It is slightly better to do so as it allows GTK so select the right pointer in some less common situations.
Modified Paths: -------------- src/callbacks.c src/editor.c src/msgwindow.c src/notebook.c src/plugins.c src/prefs.c src/sidebar.c src/vte.c
Modified: src/callbacks.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -634,7 +634,7 @@ gboolean toolbar_popup_menu(GtkWidget *widget, GdkEventButton *event, gpointer u { if (event->button == 3) { - gtk_menu_popup_at_pointer(GTK_MENU(ui_widgets.toolbar_menu), NULL); + gtk_menu_popup_at_pointer(GTK_MENU(ui_widgets.toolbar_menu), (GdkEvent *) event); return TRUE; } return FALSE;
Modified: src/editor.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -346,7 +346,7 @@ static gboolean on_editor_button_press_event(GtkWidget *widget, GdkEventButton * g_signal_emit_by_name(geany_object, "update-editor-menu", current_word, editor_info.click_pos, doc);
- gtk_menu_popup_at_pointer(GTK_MENU(main_widgets.editor_menu), NULL); + gtk_menu_popup_at_pointer(GTK_MENU(main_widgets.editor_menu), (GdkEvent *) event); return TRUE; } return FALSE;
Modified: src/msgwindow.c 6 lines changed, 3 insertions(+), 3 deletions(-) =================================================================== @@ -1236,17 +1236,17 @@ static gboolean on_msgwin_button_press_event(GtkWidget *widget, GdkEventButton * { case MSG_STATUS: { - gtk_menu_popup_at_pointer(GTK_MENU(msgwindow.popup_status_menu), NULL); + gtk_menu_popup_at_pointer(GTK_MENU(msgwindow.popup_status_menu), (GdkEvent *) event); break; } case MSG_MESSAGE: { - gtk_menu_popup_at_pointer(GTK_MENU(msgwindow.popup_msg_menu), NULL); + gtk_menu_popup_at_pointer(GTK_MENU(msgwindow.popup_msg_menu), (GdkEvent *) event); break; } case MSG_COMPILER: { - gtk_menu_popup_at_pointer(GTK_MENU(msgwindow.popup_compiler_menu), NULL); + gtk_menu_popup_at_pointer(GTK_MENU(msgwindow.popup_compiler_menu), (GdkEvent *) event); break; } }
Modified: src/notebook.c 8 lines changed, 4 insertions(+), 4 deletions(-) =================================================================== @@ -458,7 +458,7 @@ static void on_close_documents_right_activate(GtkMenuItem *menuitem, GeanyDocume }
-static void show_tab_bar_popup_menu(GeanyDocument *doc) +static void show_tab_bar_popup_menu(GdkEventButton *event, GeanyDocument *doc) { GtkWidget *menu_item; static GtkWidget *menu = NULL; @@ -512,7 +512,7 @@ static void show_tab_bar_popup_menu(GeanyDocument *doc) gtk_container_add(GTK_CONTAINER(menu), menu_item); g_signal_connect(menu_item, "activate", G_CALLBACK(on_close_all1_activate), NULL);
- gtk_menu_popup_at_pointer(GTK_MENU(menu), NULL); + gtk_menu_popup_at_pointer(GTK_MENU(menu), (GdkEvent *) event); }
@@ -541,7 +541,7 @@ static gboolean notebook_tab_bar_click_cb(GtkWidget *widget, GdkEventButton *eve * on a tab directly */ else if (event->button == 3) { - show_tab_bar_popup_menu(NULL); + show_tab_bar_popup_menu(event, NULL); return TRUE; } return FALSE; @@ -676,7 +676,7 @@ static gboolean notebook_tab_click(GtkWidget *widget, GdkEventButton *event, gpo /* right-click is first handled here if it happened on a notebook tab */ if (event->button == 3) { - show_tab_bar_popup_menu(doc); + show_tab_bar_popup_menu(event, doc); return TRUE; }
Modified: src/plugins.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -1642,7 +1642,7 @@ static gboolean pm_treeview_button_press_cb(GtkWidget *widget, GdkEventButton *e { if (event->button == 3) { - gtk_menu_popup_at_pointer(GTK_MENU(pm_widgets.popup_menu), NULL); + gtk_menu_popup_at_pointer(GTK_MENU(pm_widgets.popup_menu), (GdkEvent *) event); } return FALSE; }
Modified: src/prefs.c 8 lines changed, 4 insertions(+), 4 deletions(-) =================================================================== @@ -211,7 +211,7 @@ static void kb_tree_view_change_button_clicked_cb(GtkWidget *button, KbData *kbd }
-static void kb_show_popup_menu(KbData *kbdata, GtkWidget *widget) +static void kb_show_popup_menu(KbData *kbdata, GtkWidget *widget, GdkEventButton *event) { static GtkWidget *menu = NULL;
@@ -234,13 +234,13 @@ static void kb_show_popup_menu(KbData *kbdata, GtkWidget *widget) gtk_menu_attach_to_widget(GTK_MENU(menu), widget, NULL); }
- gtk_menu_popup_at_pointer(GTK_MENU(menu), NULL); + gtk_menu_popup_at_pointer(GTK_MENU(menu), (GdkEvent *) event); }
static gboolean kb_popup_menu_cb(GtkWidget *widget, KbData *kbdata) { - kb_show_popup_menu(kbdata, widget); + kb_show_popup_menu(kbdata, widget, NULL); return TRUE; }
@@ -250,7 +250,7 @@ static gboolean kb_tree_view_button_press_event_cb(GtkWidget *widget, GdkEventBu { if (event->button == 3 && event->type == GDK_BUTTON_PRESS) { - kb_show_popup_menu(kbdata, widget); + kb_show_popup_menu(kbdata, widget, event); return TRUE; } else if (event->type == GDK_2BUTTON_PRESS)
Modified: src/sidebar.c 6 lines changed, 3 insertions(+), 3 deletions(-) =================================================================== @@ -145,7 +145,7 @@ on_default_tag_tree_button_press_event(GtkWidget *widget, GdkEventButton *event, { if (event->button == 3) { - gtk_menu_popup_at_pointer(GTK_MENU(tv.popup_taglist), NULL); + gtk_menu_popup_at_pointer(GTK_MENU(tv.popup_taglist), (GdkEvent *) event); return TRUE; } return FALSE; @@ -1513,11 +1513,11 @@ static gboolean sidebar_button_press_cb(GtkWidget *widget, GdkEventButton *event
/* update menu item sensitivity */ documents_menu_update(selection); - gtk_menu_popup_at_pointer(GTK_MENU(openfiles_popup_menu), NULL); + gtk_menu_popup_at_pointer(GTK_MENU(openfiles_popup_menu), (GdkEvent *) event); } else { - gtk_menu_popup_at_pointer(GTK_MENU(tv.popup_taglist), NULL); + gtk_menu_popup_at_pointer(GTK_MENU(tv.popup_taglist), (GdkEvent *) event); } handled = TRUE; }
Modified: src/vte.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -526,7 +526,7 @@ static gboolean vte_button_pressed(GtkWidget *widget, GdkEventButton *event, gpo if (event->button == 3) { gtk_widget_grab_focus(vte_config.vte); - gtk_menu_popup_at_pointer(GTK_MENU(vte_config.menu), NULL); + gtk_menu_popup_at_pointer(GTK_MENU(vte_config.menu), (GdkEvent *) event); return TRUE; } else if (event->button == 2)
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).