--- a/pidgin/plugins/disco/gtkdisco.c Mon Aug 15 02:39:09 2022 -0500
+++ b/pidgin/plugins/disco/gtkdisco.c Mon Aug 15 23:43:18 2022 -0500
@@ -281,9 +281,11 @@
-service_click_cb(GtkTreeView *tree, GdkEventButton *event, gpointer user_data)
+service_click_cb(G_GNUC_UNUSED GtkGestureClick *click, + G_GNUC_UNUSED gint n_press, + gdouble x, gdouble y, gpointer data) - PidginDiscoDialog *dialog = user_data;
+ PidginDiscoDialog *dialog = data; XmppDiscoService *service;
@@ -292,13 +294,9 @@
- if (!gdk_event_triggers_context_menu((GdkEvent *)event)) {
/* Figure out what was clicked */
- if (!gtk_tree_view_get_path_at_pos(tree, event->x, event->y, &path,
+ if (!gtk_tree_view_get_path_at_pos(dialog->tree, (gint)x, (gint)y, &path, @@ -314,8 +312,7 @@
gtk_tree_view_convert_bin_window_to_widget_coords(dialog->tree,
rect.width = rect.height = 1;
@@ -428,11 +425,6 @@
pidgin_disco_list_set_in_progress(dialog->discolist, FALSE);
-static void close_button_cb(GtkButton *button, PidginDiscoDialog *dialog)
- gtk_widget_destroy(GTK_WIDGET(dialog));
disco_query_tooltip(GtkWidget *widget, int x, int y, gboolean keyboard_mode,
GtkTooltip *tooltip, gpointer data)
@@ -565,7 +557,7 @@
GtkWidget *dialog = dialogs->data;
- gtk_widget_destroy(dialog);
+ gtk_window_destroy(GTK_WINDOW(dialog)); /* destroy_win_cb removes the dialog from the list */
@@ -594,11 +586,8 @@
gtk_widget_class_bind_template_child(widget_class, PidginDiscoDialog,
- gtk_widget_class_bind_template_child(widget_class, PidginDiscoDialog,
gtk_widget_class_bind_template_callback(widget_class, destroy_win_cb);
- gtk_widget_class_bind_template_callback(widget_class, close_button_cb);
gtk_widget_class_bind_template_callback(widget_class,
dialog_select_account_cb);
gtk_widget_class_bind_template_callback(widget_class, row_activated_cb);
@@ -660,9 +649,6 @@
gtk_widget_insert_action_group(GTK_WIDGET(dialog), "disco",
G_ACTION_GROUP(action_group));
- gtk_popover_bind_model(GTK_POPOVER(dialog->popover), dialog->popover_menu,
/******************************************************************************
@@ -679,7 +665,7 @@
pidgin_disco_dialog_new(void)
PidginDiscoDialog *dialog = g_object_new(PIDGIN_TYPE_DISCO_DIALOG, NULL);
- gtk_widget_show_all(GTK_WIDGET(dialog));
+ gtk_widget_show(GTK_WIDGET(dialog)); --- a/pidgin/plugins/disco/gtkdisco.h Mon Aug 15 02:39:09 2022 -0500
+++ b/pidgin/plugins/disco/gtkdisco.h Mon Aug 15 23:43:18 2022 -0500
@@ -49,7 +49,6 @@
PidginDiscoList *discolist;
- GMenuModel *popover_menu;
--- a/pidgin/plugins/disco/resources/disco.ui Mon Aug 15 02:39:09 2022 -0500
+++ b/pidgin/plugins/disco/resources/disco.ui Mon Aug 15 23:43:18 2022 -0500
@@ -15,12 +15,11 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+along with this program; if not, see <https://www.gnu.org/licenses/>. - <requires lib="gtk+" version="3.18"/>
+ <requires lib="gtk" version="4.0"/> <requires lib="pidgin" version="3.0"/>
<!-- interface-license-type gplv2 -->
<!-- interface-name Pidgin -->
@@ -38,11 +37,6 @@
- <object class="GtkPopoverMenu" id="popover">
- <property name="can_focus">False</property>
- <property name="relative-to">tree</property>
- <property name="position">bottom</property>
<object class="PidginAccountStore" id="accounts"/>
<object class="PidginAccountFilterConnected" id="accounts_connected">
<property name="child_model">accounts</property>
@@ -64,192 +58,147 @@
<template class="PidginDiscoDialog" parent="GtkDialog">
- <property name="can_focus">False</property>
- <property name="title" translatable="yes">Service Discovery</property>
- <property name="role">service discovery</property>
- <property name="type_hint">dialog</property>
+ <property name="title" translatable="1">Service Discovery</property> <signal name="destroy" handler="destroy_win_cb" swapped="no"/>
- <child internal-child="vbox">
+ <child internal-child="content_area"> - <property name="can_focus">False</property>
+ <property name="vexpand">1</property> <property name="orientation">vertical</property>
- <property name="spacing">2</property>
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
+ <property name="spacing">6</property> + <object class="GtkLabel"> + <property name="label" translatable="1">_Account:</property> + <property name="use_underline">1</property> + <property name="xalign">0</property> - <object class="GtkBox">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="spacing">6</property>
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">_Account:</property>
- <property name="use_underline">True</property>
- <property name="xalign">0</property>
+ <object class="PidginAccountChooser" id="account_chooser"> + <property name="model">xmpp_accounts</property> + <property name="active">0</property> + <signal name="changed" handler="dialog_select_account_cb" object="PidginDiscoDialog" swapped="no"/> + <object class="GtkScrolledWindow"> + <property name="vexpand">1</property> + <property name="focusable">1</property> + <property name="hscrollbar_policy">always</property> + <property name="vscrollbar_policy">always</property> + <property name="min_content_height">250</property> + <property name="child"> + <object class="GtkTreeView" id="tree"> + <property name="focusable">1</property> + <property name="model">model</property> + <signal name="row-activated" handler="row_activated_cb" object="PidginDiscoDialog" swapped="no"/> + <signal name="row-expanded" handler="row_expanded_cb" object="PidginDiscoDialog" swapped="no"/> + <child internal-child="selection"> + <object class="GtkTreeSelection"> + <signal name="changed" handler="selection_changed_cb" swapped="no"/>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- <object class="PidginAccountChooser" id="account_chooser">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="model">xmpp_accounts</property>
- <property name="active">0</property>
- <signal name="changed" handler="dialog_select_account_cb" object="PidginDiscoDialog" swapped="no"/>
+ <object class="GtkGestureClick"> + <property name="button">3</property> + <signal name="pressed" handler="service_click_cb" object="PidginDiscoDialog" swapped="no"/>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
+ <object class="GtkPopoverMenu" id="popover"> + <property name="menu-model">popover_menu</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- <object class="GtkScrolledWindow">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">always</property>
- <property name="vscrollbar_policy">always</property>
- <property name="shadow_type">in</property>
- <property name="min_content_height">250</property>
- <object class="GtkTreeView" id="tree">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="model">model</property>
- <signal name="button-press-event" handler="service_click_cb" object="PidginDiscoDialog" swapped="no"/>
- <signal name="row-activated" handler="row_activated_cb" object="PidginDiscoDialog" swapped="no"/>
- <signal name="row-expanded" handler="row_expanded_cb" object="PidginDiscoDialog" swapped="no"/>
- <child internal-child="selection">
- <object class="GtkTreeSelection">
- <signal name="changed" handler="selection_changed_cb" swapped="no"/>
+ <object class="GtkTreeViewColumn"> + <property name="resizable">1</property> + <property name="title" translatable="1">Name</property> + <property name="reorderable">1</property> + <property name="sort_column_id">1</property> + <object class="GtkCellRendererPixbuf"/> + <attribute name="pixbuf">0</attribute> - <object class="GtkTreeViewColumn">
- <property name="resizable">True</property>
- <property name="title" translatable="yes">Name</property>
- <property name="reorderable">True</property>
- <property name="sort_column_id">1</property>
- <object class="GtkCellRendererPixbuf"/>
- <attribute name="pixbuf">0</attribute>
- <object class="GtkCellRendererText"/>
- <attribute name="text">1</attribute>
+ <object class="GtkCellRendererText"/> + <attribute name="text">1</attribute> + <object class="GtkTreeViewColumn"> + <property name="resizable">1</property> + <property name="title" translatable="1">Description</property> + <property name="reorderable">1</property> + <property name="sort_column_id">2</property> - <object class="GtkTreeViewColumn">
- <property name="resizable">True</property>
- <property name="title" translatable="yes">Description</property>
- <property name="reorderable">True</property>
- <property name="sort_column_id">2</property>
- <object class="GtkCellRendererText"/>
- <attribute name="text">2</attribute>
+ <object class="GtkCellRendererText"/> + <attribute name="text">2</attribute>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- <object class="GtkProgressBar" id="progress">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">1</property>
+ <object class="GtkProgressBar" id="progress"> + <property name="valign">center</property> <object class="GtkButton" id="stop_button">
- <property name="label" translatable="yes">_Stop</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_underline">True</property>
+ <property name="label" translatable="1">_Stop</property> + <property name="focusable">1</property> + <property name="receives_default">1</property> + <property name="use_underline">1</property> <property name="action-name">disco.stop</property>
<object class="GtkButton" id="browse_button">
- <property name="label" translatable="yes">_Browse</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_underline">True</property>
+ <property name="label" translatable="1">_Browse</property> + <property name="focusable">1</property> + <property name="receives_default">1</property> + <property name="use_underline">1</property> <property name="action-name">disco.browse</property>
<object class="GtkButton" id="register_button">
- <property name="label" translatable="yes">Register</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
+ <property name="label" translatable="1">Register</property> + <property name="focusable">1</property> + <property name="receives_default">1</property> <property name="action-name">disco.register</property>
<object class="GtkButton" id="add_button">
- <property name="label" translatable="yes">_Add</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_underline">True</property>
+ <property name="label" translatable="1">_Add</property> + <property name="focusable">1</property> + <property name="receives_default">1</property> + <property name="use_underline">1</property> <property name="action-name">disco.add</property>
<object class="GtkButton" id="close_button">
- <property name="label" translatable="yes">_Close</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_underline">True</property>
- <signal name="clicked" handler="close_button_cb" swapped="no"/>
+ <property name="label" translatable="1">_Close</property> + <property name="focusable">1</property> + <property name="receives_default">1</property> + <property name="use_underline">1</property> + <signal name="clicked" handler="gtk_window_destroy" object="PidginDiscoDialog" swapped="yes"/>