diff --git a/pidgin/prefs/pidginnetworkprefs.h b/pidgin/prefs/pidginnetworkprefs.h
--- a/pidgin/prefs/pidginnetworkprefs.h
+++ b/pidgin/prefs/pidginnetworkprefs.h
@@ -30,7 +30,7 @@
 #include <glib.h>
 
 #include <gtk/gtk.h>
-#include <handy.h>
+#include <adwaita.h>
 
 G_BEGIN_DECLS
 
@@ -44,7 +44,7 @@ G_BEGIN_DECLS
  */
 #define PIDGIN_TYPE_NETWORK_PREFS (pidgin_network_prefs_get_type())
 G_DECLARE_FINAL_TYPE(PidginNetworkPrefs, pidgin_network_prefs,
-                     PIDGIN, NETWORK_PREFS, HdyPreferencesPage)
+                     PIDGIN, NETWORK_PREFS, AdwPreferencesPage)
 
 /**
  * pidgin_network_prefs_new:
# HG changeset patch
# Node ID 44ddb503b0ce
# Parent  d61ba20b3d24
diff --git a/pidgin/prefs/pidginnetworkprefs.c b/pidgin/prefs/pidginnetworkprefs.c
--- a/pidgin/prefs/pidginnetworkprefs.c
+++ b/pidgin/prefs/pidginnetworkprefs.c
@@ -24,14 +24,14 @@
 
 #include <purple.h>
 
-#include <handy.h>
+#include <adwaita.h>
 #include <nice.h>
 
 #include "pidginnetworkprefs.h"
 #include "pidginprefsinternal.h"
 
 struct _PidginNetworkPrefs {
-	HdyPreferencesPage parent;
+	AdwPreferencesPage parent;
 
 	GtkWidget *stun_server;
 	GtkWidget *auto_ip;
@@ -50,16 +50,16 @@ struct _PidginNetworkPrefs {
 };
 
 G_DEFINE_TYPE(PidginNetworkPrefs, pidgin_network_prefs,
-              HDY_TYPE_PREFERENCES_PAGE)
+              ADW_TYPE_PREFERENCES_PAGE)
 
 /******************************************************************************
  * Helpers
  *****************************************************************************/
 static void
-network_ip_changed(GtkEntry *entry, gpointer data)
+network_ip_changed(GtkEditable *editable, gpointer data)
 {
-	const gchar *text = gtk_entry_get_text(entry);
-	GtkStyleContext *context = gtk_widget_get_style_context(GTK_WIDGET(entry));
+	const gchar *text = gtk_editable_get_text(GTK_EDITABLE(editable));
+	GtkStyleContext *context = gtk_widget_get_style_context(GTK_WIDGET(editable));
 
 	if (text && *text) {
 		if (g_hostname_is_ip_address(text)) {
@@ -78,28 +78,26 @@ network_ip_changed(GtkEntry *entry, gpoi
 	}
 }
 
-static gboolean
-network_stun_server_changed_cb(GtkWidget *widget,
-                               GdkEventFocus *event, gpointer data)
+static void
+network_stun_server_changed_cb(G_GNUC_UNUSED GtkEventControllerFocus *focus,
+                               gpointer data)
 {
-	GtkEntry *entry = GTK_ENTRY(widget);
+	GtkEditable *editable = data;
+
 	purple_prefs_set_string("/purple/network/stun_server",
-		gtk_entry_get_text(entry));
-	purple_network_set_stun_server(gtk_entry_get_text(entry));
-
-	return FALSE;
+	                        gtk_editable_get_text(editable));
+	purple_network_set_stun_server(gtk_editable_get_text(editable));
 }
 
-static gboolean
-network_turn_server_changed_cb(GtkWidget *widget,
-                               GdkEventFocus *event, gpointer data)
+static void
+network_turn_server_changed_cb(G_GNUC_UNUSED GtkEventControllerFocus *focus,
+                               gpointer data)
 {
-	GtkEntry *entry = GTK_ENTRY(widget);
+	GtkEditable *editable = data;
+
 	purple_prefs_set_string("/purple/network/turn_server",
-		gtk_entry_get_text(entry));
-	purple_network_set_turn_server(gtk_entry_get_text(entry));
-
-	return FALSE;
+	                        gtk_editable_get_text(editable));
+	purple_network_set_turn_server(gtk_editable_get_text(editable));
 }
 
 static void
@@ -201,14 +199,14 @@ pidgin_network_prefs_init(PidginNetworkP
 
 	gtk_widget_init_template(GTK_WIDGET(prefs));
 
-	gtk_entry_set_text(GTK_ENTRY(prefs->stun_server),
-			purple_prefs_get_string("/purple/network/stun_server"));
+	gtk_editable_set_text(GTK_EDITABLE(prefs->stun_server),
+	                      purple_prefs_get_string("/purple/network/stun_server"));
 
 	pidgin_prefs_bind_checkbox("/purple/network/auto_ip", prefs->auto_ip);
 	auto_ip_button_clicked_cb(prefs->auto_ip, NULL); /* Update label */
 
-	gtk_entry_set_text(GTK_ENTRY(prefs->public_ip),
-			purple_network_get_public_ip());
+	gtk_editable_set_text(GTK_EDITABLE(prefs->public_ip),
+	                      purple_network_get_public_ip());
 
 	ip_css = gtk_css_provider_new();
 	gtk_css_provider_load_from_resource(ip_css,
@@ -238,8 +236,8 @@ pidgin_network_prefs_init(PidginNetworkP
 			prefs->ports_range_end);
 
 	/* TURN server */
-	gtk_entry_set_text(GTK_ENTRY(prefs->turn_server),
-			purple_prefs_get_string("/purple/network/turn_server"));
+	gtk_editable_set_text(GTK_EDITABLE(prefs->turn_server),
+	                      purple_prefs_get_string("/purple/network/turn_server"));
 
 	pidgin_prefs_bind_spin_button("/purple/network/turn_port",
 			prefs->turn_port_udp);
diff --git a/pidgin/resources/Prefs/network.ui b/pidgin/resources/Prefs/network.ui
--- a/pidgin/resources/Prefs/network.ui
+++ b/pidgin/resources/Prefs/network.ui
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.38.2 
-
+<!--
 Pidgin - Internet Messenger
 Copyright (C) Pidgin Developers <devel@pidgin.im>
 
@@ -16,10 +15,10 @@ GNU General Public License for more deta
 
 You should have received a copy of the GNU General Public License
 along with this program; if not, see <https://www.gnu.org/licenses/>.
-
 -->
 <interface>
-  <requires lib="gtk+" version="3.22"/>
+  <requires lib="gtk" version="4.0"/>
+  <requires lib="Adw" version="1.0"/>
   <!-- interface-license-type gplv2 -->
   <!-- interface-name Pidgin -->
   <!-- interface-description Internet Messenger -->
@@ -44,434 +43,232 @@ along with this program; if not, see <ht
     <property name="step-increment">1</property>
     <property name="page-increment">10</property>
   </object>
-  <template class="PidginNetworkPrefs" parent="HdyPreferencesPage">
-    <property name="visible">True</property>
-    <property name="can-focus">False</property>
+  <template class="PidginNetworkPrefs" parent="AdwPreferencesPage">
     <child>
-      <object class="HdyPreferencesGroup">
-        <property name="visible">True</property>
-        <property name="can-focus">False</property>
+      <object class="AdwPreferencesGroup">
         <property name="title" translatable="yes">IP Address</property>
         <child>
           <object class="GtkBox">
-            <property name="visible">True</property>
-            <property name="can-focus">False</property>
             <property name="margin-start">12</property>
             <property name="orientation">vertical</property>
             <property name="spacing">6</property>
             <child>
               <object class="GtkBox">
-                <property name="visible">True</property>
-                <property name="can-focus">False</property>
                 <property name="spacing">6</property>
                 <child>
                   <object class="GtkLabel" id="label8">
-                    <property name="visible">True</property>
-                    <property name="can-focus">False</property>
                     <property name="label" translatable="yes">ST_UN server:</property>
-                    <property name="use-underline">True</property>
+                    <property name="use-underline">1</property>
                     <property name="mnemonic-widget">stun_server</property>
                   </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
-                    <property name="position">0</property>
-                  </packing>
                 </child>
                 <child>
                   <object class="GtkEntry" id="stun_server">
-                    <property name="visible">True</property>
-                    <property name="can-focus">True</property>
+                    <property name="halign">fill</property>
+                    <property name="hexpand">1</property>
+                    <property name="focusable">1</property>
                     <property name="placeholder-text" translatable="yes">Example: stunserver.org</property>
                     <property name="input-purpose">url</property>
-                    <signal name="focus-out-event" handler="network_stun_server_changed_cb" swapped="no"/>
+                    <child>
+                      <object class="GtkEventControllerFocus">
+                        <signal name="leave" handler="network_stun_server_changed_cb" object="stun_server" swapped="no"/>
+                      </object>
+                    </child>
                   </object>
-                  <packing>
-                    <property name="expand">True</property>
-                    <property name="fill">True</property>
-                    <property name="position">1</property>
-                  </packing>
                 </child>
               </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">0</property>
-              </packing>
             </child>
             <child>
               <object class="GtkCheckButton" id="auto_ip">
                 <property name="label" translatable="yes">Use _automatically detected IP address</property>
-                <property name="visible">True</property>
-                <property name="can-focus">True</property>
-                <property name="receives-default">False</property>
-                <property name="use-underline">True</property>
-                <property name="draw-indicator">True</property>
+                <property name="focusable">1</property>
+                <property name="use-underline">1</property>
                 <signal name="toggled" handler="auto_ip_button_clicked_cb" after="yes" swapped="no"/>
               </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">1</property>
-              </packing>
             </child>
             <child>
               <object class="GtkBox" id="public_ip_hbox">
-                <property name="visible">True</property>
-                <property name="can-focus">False</property>
                 <property name="spacing">6</property>
                 <child>
                   <object class="GtkLabel" id="label9">
-                    <property name="visible">True</property>
-                    <property name="can-focus">False</property>
                     <property name="label" translatable="yes">Public _IP:</property>
-                    <property name="use-underline">True</property>
+                    <property name="use-underline">1</property>
                     <property name="mnemonic-widget">public_ip</property>
                     <property name="xalign">0</property>
                   </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
-                    <property name="position">0</property>
-                  </packing>
                 </child>
                 <child>
                   <object class="GtkEntry" id="public_ip">
-                    <property name="visible">True</property>
-                    <property name="can-focus">True</property>
+                    <property name="focusable">1</property>
                     <signal name="changed" handler="network_ip_changed" swapped="no"/>
                   </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
-                    <property name="position">1</property>
-                  </packing>
                 </child>
               </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">2</property>
-              </packing>
             </child>
           </object>
         </child>
       </object>
-      <packing>
-        <property name="expand">False</property>
-        <property name="fill">True</property>
-        <property name="position">0</property>
-      </packing>
     </child>
     <child>
-      <object class="HdyPreferencesGroup">
-        <property name="visible">True</property>
-        <property name="can-focus">False</property>
+      <object class="AdwPreferencesGroup">
         <property name="title" translatable="yes">Ports</property>
         <child>
           <object class="GtkBox">
-            <property name="visible">True</property>
-            <property name="can-focus">False</property>
             <property name="margin-start">12</property>
             <property name="orientation">vertical</property>
             <property name="spacing">6</property>
             <child>
               <object class="GtkCheckButton" id="map_ports">
                 <property name="label" translatable="yes">_Enable automatic router port forwarding</property>
-                <property name="visible">True</property>
-                <property name="can-focus">True</property>
-                <property name="receives-default">False</property>
-                <property name="use-underline">True</property>
-                <property name="draw-indicator">True</property>
+                <property name="focusable">1</property>
+                <property name="use-underline">1</property>
               </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">0</property>
-              </packing>
             </child>
             <child>
               <object class="GtkBox">
-                <property name="visible">True</property>
-                <property name="can-focus">False</property>
                 <property name="spacing">6</property>
                 <child>
                   <object class="GtkCheckButton" id="ports_range_use">
                     <property name="label" translatable="yes">_Manually specify range of ports to listen on:</property>
-                    <property name="visible">True</property>
-                    <property name="can-focus">True</property>
-                    <property name="receives-default">False</property>
-                    <property name="use-underline">True</property>
-                    <property name="draw-indicator">True</property>
+                    <property name="focusable">1</property>
+                    <property name="use-underline">1</property>
                   </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
-                    <property name="position">0</property>
-                  </packing>
                 </child>
                 <child>
                   <object class="GtkBox" id="ports_range_hbox">
-                    <property name="visible">True</property>
-                    <property name="can-focus">False</property>
                     <property name="spacing">6</property>
                     <child>
                       <object class="GtkLabel">
-                        <property name="visible">True</property>
-                        <property name="can-focus">False</property>
                         <property name="label" translatable="yes">_Start:</property>
-                        <property name="use-underline">True</property>
+                        <property name="use-underline">1</property>
                       </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">True</property>
-                        <property name="position">0</property>
-                      </packing>
                     </child>
                     <child>
                       <object class="GtkSpinButton" id="ports_range_start">
-                        <property name="visible">True</property>
-                        <property name="can-focus">True</property>
+                        <property name="focusable">1</property>
                         <property name="text" translatable="yes">0</property>
                         <property name="adjustment">ports_range_start.adjustment</property>
-                        <property name="numeric">True</property>
+                        <property name="numeric">1</property>
                       </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">True</property>
-                        <property name="position">1</property>
-                      </packing>
                     </child>
                     <child>
                       <object class="GtkLabel">
-                        <property name="visible">True</property>
-                        <property name="can-focus">False</property>
                         <property name="label" translatable="yes">_End:</property>
-                        <property name="use-underline">True</property>
+                        <property name="use-underline">1</property>
                         <property name="mnemonic-widget">ports_range_end</property>
                       </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">True</property>
-                        <property name="position">2</property>
-                      </packing>
                     </child>
                     <child>
                       <object class="GtkSpinButton" id="ports_range_end">
-                        <property name="visible">True</property>
-                        <property name="can-focus">True</property>
+                        <property name="focusable">1</property>
                         <property name="text" translatable="yes">0</property>
                         <property name="adjustment">ports_range_end.adjustment</property>
-                        <property name="numeric">True</property>
+                        <property name="numeric">1</property>
                       </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">True</property>
-                        <property name="position">3</property>
-                      </packing>
                     </child>
                   </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
-                    <property name="position">1</property>
-                  </packing>
                 </child>
               </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">1</property>
-              </packing>
             </child>
           </object>
         </child>
       </object>
-      <packing>
-        <property name="expand">False</property>
-        <property name="fill">True</property>
-        <property name="position">1</property>
-      </packing>
     </child>
     <child>
-      <object class="HdyPreferencesGroup">
-        <property name="visible">True</property>
-        <property name="can-focus">False</property>
+      <object class="AdwPreferencesGroup">
         <property name="title" translatable="yes">Relay Server (TURN)</property>
         <child>
           <object class="GtkBox">
-            <property name="visible">True</property>
-            <property name="can-focus">False</property>
             <property name="margin-start">12</property>
             <property name="orientation">vertical</property>
             <property name="spacing">6</property>
             <child>
               <object class="GtkBox">
-                <property name="visible">True</property>
-                <property name="can-focus">False</property>
                 <property name="spacing">6</property>
                 <child>
                   <object class="GtkLabel" id="label10">
-                    <property name="visible">True</property>
-                    <property name="can-focus">False</property>
                     <property name="label" translatable="yes">_TURN server:</property>
-                    <property name="use-underline">True</property>
+                    <property name="use-underline">1</property>
                     <property name="mnemonic-widget">turn_server</property>
                     <property name="xalign">0</property>
                   </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
-                    <property name="position">0</property>
-                  </packing>
                 </child>
                 <child>
                   <object class="GtkEntry" id="turn_server">
-                    <property name="visible">True</property>
-                    <property name="can-focus">True</property>
-                    <signal name="focus-out-event" handler="network_turn_server_changed_cb" swapped="no"/>
+                    <property name="focusable">1</property>
+                    <child>
+                      <object class="GtkEventControllerFocus">
+                        <signal name="leave" handler="network_turn_server_changed_cb" swapped="no"/>
+                      </object>
+                    </child>
                   </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
-                    <property name="position">1</property>
-                  </packing>
                 </child>
                 <child>
                   <object class="GtkLabel">
-                    <property name="visible">True</property>
-                    <property name="can-focus">False</property>
                     <property name="label" translatable="yes">_UDP Port:</property>
-                    <property name="use-underline">True</property>
+                    <property name="use-underline">1</property>
                     <property name="mnemonic-widget">turn_port_udp</property>
                   </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
-                    <property name="position">2</property>
-                  </packing>
                 </child>
                 <child>
                   <object class="GtkSpinButton" id="turn_port_udp">
-                    <property name="visible">True</property>
-                    <property name="can-focus">True</property>
+                    <property name="focusable">1</property>
                     <property name="adjustment">turn_port_udp.adjustment</property>
-                    <property name="numeric">True</property>
+                    <property name="numeric">1</property>
                   </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
-                    <property name="position">3</property>
-                  </packing>
                 </child>
                 <child>
                   <object class="GtkLabel">
-                    <property name="visible">True</property>
-                    <property name="can-focus">False</property>
                     <property name="label" translatable="yes">T_CP Port:</property>
-                    <property name="use-underline">True</property>
+                    <property name="use-underline">1</property>
                     <property name="mnemonic-widget">turn_port_tcp</property>
                   </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
-                    <property name="position">4</property>
-                  </packing>
                 </child>
                 <child>
                   <object class="GtkSpinButton" id="turn_port_tcp">
-                    <property name="visible">True</property>
-                    <property name="can-focus">True</property>
+                    <property name="focusable">1</property>
                     <property name="adjustment">turn_port_tcp.adjustment</property>
-                    <property name="numeric">True</property>
+                    <property name="numeric">1</property>
                   </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
-                    <property name="position">5</property>
-                  </packing>
                 </child>
               </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">0</property>
-              </packing>
             </child>
             <child>
               <object class="GtkBox">
-                <property name="visible">True</property>
-                <property name="can-focus">False</property>
                 <property name="spacing">6</property>
                 <child>
                   <object class="GtkLabel" id="label11">
-                    <property name="visible">True</property>
-                    <property name="can-focus">False</property>
                     <property name="label" translatable="yes">Use_rname:</property>
-                    <property name="use-underline">True</property>
+                    <property name="use-underline">1</property>
                     <property name="mnemonic-widget">turn_username</property>
                     <property name="xalign">0</property>
                   </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
-                    <property name="position">0</property>
-                  </packing>
                 </child>
                 <child>
                   <object class="GtkEntry" id="turn_username">
-                    <property name="visible">True</property>
-                    <property name="can-focus">True</property>
+                    <property name="focusable">1</property>
                   </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
-                    <property name="position">1</property>
-                  </packing>
                 </child>
                 <child>
                   <object class="GtkLabel">
-                    <property name="visible">True</property>
-                    <property name="can-focus">False</property>
                     <property name="label" translatable="yes">Pass_word:</property>
-                    <property name="use-underline">True</property>
+                    <property name="use-underline">1</property>
                     <property name="mnemonic-widget">turn_password</property>
                   </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
-                    <property name="position">2</property>
-                  </packing>
                 </child>
                 <child>
                   <object class="GtkEntry" id="turn_password">
-                    <property name="visible">True</property>
-                    <property name="can-focus">True</property>
-                    <property name="visibility">False</property>
+                    <property name="focusable">1</property>
+                    <property name="visibility">0</property>
                     <property name="invisible-char">●</property>
                     <property name="input-purpose">password</property>
                   </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
-                    <property name="position">3</property>
-                  </packing>
                 </child>
               </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">1</property>
-              </packing>
             </child>
           </object>
         </child>
       </object>
-      <packing>
-        <property name="expand">False</property>
-        <property name="fill">True</property>
-        <property name="position">2</property>
-      </packing>
     </child>
   </template>
   <object class="GtkSizeGroup" id="sg">
