# HG changeset patch
# Node ID b9b21c186afc
# Parent  a6d54582751f
diff --git a/pidgin/gtkconv.c b/pidgin/gtkconv.c
--- a/pidgin/gtkconv.c
+++ b/pidgin/gtkconv.c
@@ -580,10 +580,8 @@ gtkconv_chat_popup_menu_cb(GtkWidget *wi
 	gtk_tree_model_get(GTK_TREE_MODEL(model), &iter, CHAT_USERS_NAME_COLUMN, &who, -1);
 	menu = create_chat_menu(PURPLE_CHAT_CONVERSATION(conv), who, gc, gtkconv);
 
-	popover_menu = gtk_popover_menu_new();
-	gtk_popover_bind_model(GTK_POPOVER(popover_menu), G_MENU_MODEL(menu),
-	                       NULL);
-	gtk_popover_set_relative_to(GTK_POPOVER(popover_menu), gtkconv->list);
+	popover_menu = gtk_popover_menu_new_from_model(G_MENU_MODEL(menu));
+	gtk_widget_set_parent(popover_menu, gtkconv->list);
 
 	gtk_popover_popup(GTK_POPOVER(popover_menu));
 
@@ -594,9 +592,10 @@ gtkconv_chat_popup_menu_cb(GtkWidget *wi
 
 
 static gint
-right_click_chat_cb(GtkWidget *widget, GdkEventButton *event,
-					PidginConversation *gtkconv)
+right_click_chat_cb(GtkGestureClick *click, gint n_press, gdouble x, gdouble y,
+                    gpointer data)
 {
+	PidginConversation *gtkconv = data;
 	PurpleConversation *conv = gtkconv->active_conv;
 	PurpleConnection *gc;
 	PurpleAccount *account;
@@ -605,15 +604,18 @@ right_click_chat_cb(GtkWidget *widget, G
 	GtkTreeModel *model;
 	GtkTreeViewColumn *column;
 	gchar *who;
-	int x, y;
+	GdkEvent *event = NULL;
+	guint button;
 
 	account = purple_conversation_get_account(conv);
 	gc      = purple_account_get_connection(account);
+	event = gtk_event_controller_get_current_event(GTK_EVENT_CONTROLLER(click));
+	button = gtk_gesture_single_get_current_button(GTK_GESTURE_SINGLE(click));
 
 	model = gtk_tree_view_get_model(GTK_TREE_VIEW(gtkconv->list));
 
-	gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(gtkconv->list),
-								  event->x, event->y, &path, &column, &x, &y);
+	gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(gtkconv->list), x, y,
+	                              &path, &column, NULL, NULL);
 
 	if (path == NULL)
 		return FALSE;
@@ -628,27 +630,26 @@ right_click_chat_cb(GtkWidget *widget, G
 	gtk_tree_model_get(GTK_TREE_MODEL(model), &iter, CHAT_USERS_NAME_COLUMN, &who, -1);
 
 	/* emit chat-nick-clicked signal */
-	if (event->type == GDK_BUTTON_PRESS) {
+	if (n_press == 1) {
 		gint plugin_return = GPOINTER_TO_INT(purple_signal_emit_return_1(
 					pidgin_conversations_get_handle(), "chat-nick-clicked",
-					conv, who, event->button));
+					conv, who, button));
 		if (plugin_return)
 			goto handled;
 	}
 
-	if (event->button == GDK_BUTTON_PRIMARY && event->type == GDK_2BUTTON_PRESS) {
+	if (button == GDK_BUTTON_PRIMARY && n_press == 2) {
 		chat_do_im(gtkconv, who);
-	} else if (gdk_event_triggers_context_menu((GdkEvent *)event)) {
-		GtkWidget *popover_menu = gtk_popover_menu_new();
+	} else if (gdk_event_triggers_context_menu(event)) {
+		GtkWidget *popover_menu = NULL;
 		GMenu *menu = create_chat_menu(PURPLE_CHAT_CONVERSATION(conv), who, gc,
 		                               gtkconv);
 
-		gtk_popover_bind_model(GTK_POPOVER(popover_menu), G_MENU_MODEL(menu),
-		                       NULL);
-		gtk_popover_set_relative_to(GTK_POPOVER(popover_menu), gtkconv->list);
+		popover_menu = gtk_popover_menu_new_from_model(G_MENU_MODEL(menu));
+		gtk_widget_set_parent(popover_menu, gtkconv->list);
 		gtk_popover_set_position(GTK_POPOVER(popover_menu), GTK_POS_BOTTOM);
 		gtk_popover_set_pointing_to(GTK_POPOVER(popover_menu),
-		                            &(const GdkRectangle){(int)event->x, (int)event->y, 1, 1});
+		                            &(const GdkRectangle){(int)x, (int)y, 1, 1});
 
 		gtk_popover_popup(GTK_POPOVER(popover_menu));
 	}
@@ -1469,6 +1470,7 @@ static void
 setup_chat_userlist(PidginConversation *gtkconv, GtkWidget *hpaned)
 {
 	GtkWidget *lbox, *list, *sw;
+	GtkGesture *click = NULL;
 	GtkListStore *ls;
 	GtkCellRenderer *rend;
 	GtkTreeViewColumn *col;
@@ -1505,8 +1507,10 @@ setup_chat_userlist(PidginConversation *
 	gtk_tree_view_column_set_sizing(col, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
 	gtk_tree_view_append_column(GTK_TREE_VIEW(list), col);
 
-	g_signal_connect(G_OBJECT(list), "button_press_event",
-					 G_CALLBACK(right_click_chat_cb), gtkconv);
+	click = gtk_gesture_click_new();
+	g_signal_connect(click, "pressed", G_CALLBACK(right_click_chat_cb), gtkconv);
+	gtk_widget_add_controller(list, GTK_EVENT_CONTROLLER(click));
+
 	g_signal_connect(G_OBJECT(list), "row-activated",
 					 G_CALLBACK(activate_list_cb), gtkconv);
 	g_signal_connect(G_OBJECT(list), "popup-menu",
diff --git a/pidgin/resources/Conversations/window.ui b/pidgin/resources/Conversations/window.ui
--- a/pidgin/resources/Conversations/window.ui
+++ b/pidgin/resources/Conversations/window.ui
@@ -39,7 +39,7 @@ along with this library; if not, see <ht
   <template class="PidginConversationWindow" parent="GtkApplicationWindow">
     <child>
       <object class="GtkEventControllerKey">
-        <property name="propagation-phase">GTK_PHASE_CAPTURE</property>
+        <property name="propagation-phase">capture</property>
         <signal name="key-pressed" handler="pidgin_conversation_window_key_pressed_cb"/>
       </object>
     </child>
@@ -60,9 +60,7 @@ along with this library; if not, see <ht
                 <property name="orientation">vertical</property>
                 <property name="spacing">6</property>
                 <child>
-                  <object class="PidginStatusBox">
-                    <property name="can-focus">False</property>
-                  </object>
+                  <object class="PidginStatusBox"/>
                 </child>
                 <child>
                   <object class="GtkScrolledWindow">
@@ -73,7 +71,7 @@ along with this library; if not, see <ht
                       <object class="GtkTreeView" id="view">
                         <property name="focusable">1</property>
                         <property name="model">model</property>
-                        <property name="headers-visible">False</property>
+                        <property name="headers-visible">0</property>
                         <property name="search-column">3</property>
                         <child internal-child="selection">
                           <object class="GtkTreeSelection" id="selection">
@@ -106,33 +104,26 @@ along with this library; if not, see <ht
             <child>
               <object class="GtkStack" id="stack">
                 <child>
-                  <object class="PidginNotificationList" id="notification_list">
-                    <property name="visible">True</property>
-                    <property name="can-focus">False</property>
-                    <property name="orientation">vertical</property>
-                    <child>
-                      <placeholder/>
-                    </child>
+                  <object class="GtkStackPage">
+                    <property name="name">__notifications__</property>
+                    <property name="child">
+                      <object class="PidginNotificationList" id="notification_list">
+                        <property name="orientation">vertical</property>
+                      </object>
+                    </property>
                   </object>
-                  <packing>
-                    <property name="name">__notifications__</property>
-                  </packing>
                 </child>
                 <child>
-                  <object class="AdwStatusPage">
-                    <property name="visible">True</property>
-                    <property name="can-focus">False</property>
-                    <property name="icon-name">mail-send-symbolic</property>
-                    <property name="title" translatable="yes">Conversations</property>
-                    <property name="description" translatable="yes">When you send a message to a friend or join a chat it will show up here!</property>
-                    <child>
-                      <placeholder/>
-                    </child>
+                  <object class="GtkStackPage">
+                    <property name="name">__conversations__</property>
+                    <property name="child">
+                      <object class="AdwStatusPage">
+                        <property name="icon-name">mail-send-symbolic</property>
+                        <property name="title" translatable="1">Conversations</property>
+                        <property name="description" translatable="1">When you send a message to a friend or join a chat it will show up here!</property>
+                      </object>
+                    </property>
                   </object>
-                  <packing>
-                    <property name="name">__conversations__</property>
-                    <property name="position">1</property>
-                  </packing>
                 </child>
               </object>
             </child>
