Branch: refs/heads/master Author: Jan Dolinar jan.dolinar@firma.seznam.cz Committer: Jan Dolinar jan.dolinar@firma.seznam.cz Date: Tue, 16 Aug 2022 12:24:31 UTC Commit: 85de03686c39993d11adab0ef87aaed2dd97b186 https://github.com/geany/geany/commit/85de03686c39993d11adab0ef87aaed2dd97b1...
Log Message: ----------- fix context menus on wayland (#3009)
Modified Paths: -------------- src/callbacks.c src/editor.c src/msgwindow.c src/notebook.c src/plugins.c src/prefs.c src/sidebar.c src/symbols.c src/vte.c
Modified: src/callbacks.c 4 lines changed, 4 insertions(+), 0 deletions(-) =================================================================== @@ -634,7 +634,11 @@ gboolean toolbar_popup_menu(GtkWidget *widget, GdkEventButton *event, gpointer u { if (event->button == 3) { +#if GTK_CHECK_VERSION(3,22,0) + gtk_menu_popup_at_pointer(GTK_MENU(ui_widgets.toolbar_menu), NULL); +#else gtk_menu_popup(GTK_MENU(ui_widgets.toolbar_menu), NULL, NULL, NULL, NULL, event->button, event->time); +#endif return TRUE; } return FALSE;
Modified: src/editor.c 5 lines changed, 4 insertions(+), 1 deletions(-) =================================================================== @@ -346,9 +346,12 @@ 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);
+#if GTK_CHECK_VERSION(3,22,0) + gtk_menu_popup_at_pointer(GTK_MENU(main_widgets.editor_menu), NULL); +#else gtk_menu_popup(GTK_MENU(main_widgets.editor_menu), NULL, NULL, NULL, NULL, event->button, event->time); - +#endif return TRUE; } return FALSE;
Modified: src/msgwindow.c 12 lines changed, 12 insertions(+), 0 deletions(-) =================================================================== @@ -1236,20 +1236,32 @@ static gboolean on_msgwin_button_press_event(GtkWidget *widget, GdkEventButton * { case MSG_STATUS: { +#if GTK_CHECK_VERSION(3,22,0) + gtk_menu_popup_at_pointer(GTK_MENU(msgwindow.popup_status_menu), NULL); +#else gtk_menu_popup(GTK_MENU(msgwindow.popup_status_menu), NULL, NULL, NULL, NULL, event->button, event->time); +#endif break; } case MSG_MESSAGE: { +#if GTK_CHECK_VERSION(3,22,0) + gtk_menu_popup_at_pointer(GTK_MENU(msgwindow.popup_msg_menu), NULL); +#else gtk_menu_popup(GTK_MENU(msgwindow.popup_msg_menu), NULL, NULL, NULL, NULL, event->button, event->time); +#endif break; } case MSG_COMPILER: { +#if GTK_CHECK_VERSION(3,22,0) + gtk_menu_popup_at_pointer(GTK_MENU(msgwindow.popup_compiler_menu), NULL); +#else gtk_menu_popup(GTK_MENU(msgwindow.popup_compiler_menu), NULL, NULL, NULL, NULL, event->button, event->time); +#endif break; } }
Modified: src/notebook.c 4 lines changed, 4 insertions(+), 0 deletions(-) =================================================================== @@ -508,7 +508,11 @@ static void show_tab_bar_popup_menu(GdkEventButton *event, GeanyDocument *doc) gtk_container_add(GTK_CONTAINER(menu), menu_item); g_signal_connect(menu_item, "activate", G_CALLBACK(on_close_all1_activate), NULL);
+#if GTK_CHECK_VERSION(3,22,0) + gtk_menu_popup_at_pointer(GTK_MENU(menu), NULL); +#else gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, event->button, event->time); +#endif }
Modified: src/plugins.c 4 lines changed, 4 insertions(+), 0 deletions(-) =================================================================== @@ -1642,8 +1642,12 @@ static gboolean pm_treeview_button_press_cb(GtkWidget *widget, GdkEventButton *e { if (event->button == 3) { +#if GTK_CHECK_VERSION(3,22,0) + gtk_menu_popup_at_pointer(GTK_MENU(pm_widgets.popup_menu), NULL); +#else gtk_menu_popup(GTK_MENU(pm_widgets.popup_menu), NULL, NULL, NULL, NULL, event->button, event->time); +#endif } return FALSE; }
Modified: src/prefs.c 4 lines changed, 4 insertions(+), 0 deletions(-) =================================================================== @@ -246,7 +246,11 @@ static void kb_show_popup_menu(KbData *kbdata, GtkWidget *widget, GdkEventButton event_time = gtk_get_current_event_time(); }
+#if GTK_CHECK_VERSION(3,22,0) + gtk_menu_popup_at_pointer(GTK_MENU(menu), NULL); +#else gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, button, event_time); +#endif }
Modified: src/sidebar.c 12 lines changed, 12 insertions(+), 0 deletions(-) =================================================================== @@ -145,8 +145,12 @@ on_default_tag_tree_button_press_event(GtkWidget *widget, GdkEventButton *event, { if (event->button == 3) { +#if GTK_CHECK_VERSION(3,22,0) + gtk_menu_popup_at_pointer(GTK_MENU(tv.popup_taglist), NULL); +#else gtk_menu_popup(GTK_MENU(tv.popup_taglist), NULL, NULL, NULL, NULL, event->button, event->time); +#endif return TRUE; } return FALSE; @@ -1488,13 +1492,21 @@ static gboolean sidebar_button_press_cb(GtkWidget *widget, GdkEventButton *event
/* update menu item sensitivity */ documents_menu_update(selection); +#if GTK_CHECK_VERSION(3,22,0) + gtk_menu_popup_at_pointer(GTK_MENU(openfiles_popup_menu), NULL); +#else gtk_menu_popup(GTK_MENU(openfiles_popup_menu), NULL, NULL, NULL, NULL, event->button, event->time); +#endif } else { +#if GTK_CHECK_VERSION(3,22,0) + gtk_menu_popup_at_pointer(GTK_MENU(tv.popup_taglist), NULL); +#else gtk_menu_popup(GTK_MENU(tv.popup_taglist), NULL, NULL, NULL, NULL, event->button, event->time); +#endif } handled = TRUE; }
Modified: src/symbols.c 4 lines changed, 4 insertions(+), 0 deletions(-) =================================================================== @@ -1536,8 +1536,12 @@ static void show_goto_popup(GeanyDocument *doc, GPtrArray *tags, gboolean have_b
g_object_set_data_full(G_OBJECT(menu), "geany-button-event", button_event, button_event ? (GDestroyNotify) gdk_event_free : NULL); +#if GTK_CHECK_VERSION(3,22,0) + gtk_menu_popup_at_pointer(GTK_MENU(menu), NULL); +#else gtk_menu_popup(GTK_MENU(menu), NULL, NULL, goto_popup_position_func, doc->editor->sci, button_event ? button_event->button : 0, gtk_get_current_event_time ()); +#endif }
Modified: src/vte.c 4 lines changed, 4 insertions(+), 0 deletions(-) =================================================================== @@ -526,7 +526,11 @@ static gboolean vte_button_pressed(GtkWidget *widget, GdkEventButton *event, gpo if (event->button == 3) { gtk_widget_grab_focus(vte_config.vte); +#if GTK_CHECK_VERSION(3,22,0) + gtk_menu_popup_at_pointer(GTK_MENU(vte_config.menu), NULL); +#else gtk_menu_popup(GTK_MENU(vte_config.menu), NULL, NULL, NULL, NULL, event->button, event->time); +#endif 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).