diff -urp webkitgtk-2.32.1.cmake/Source/WebCore/html/ColorInputType.cpp webkitgtk-2.32.1.gtk/Source/WebCore/html/ColorInputType.cpp
--- webkitgtk-2.32.1.cmake/Source/WebCore/html/ColorInputType.cpp	2021-02-26 03:57:12.000000000 -0600
+++ webkitgtk-2.32.1.gtk/Source/WebCore/html/ColorInputType.cpp	2021-05-27 15:48:31.746995219 -0500
@@ -39,6 +39,7 @@
 #include "Chrome.h"
 #include "Color.h"
 #include "ColorSerialization.h"
+#include "ElementIterator.h"
 #include "Event.h"
 #include "HTMLDataListElement.h"
 #include "HTMLDivElement.h"
diff -urp webkitgtk-2.32.1.cmake/Source/WebCore/platform/gtk/GtkUtilities.cpp webkitgtk-2.32.1.gtk/Source/WebCore/platform/gtk/GtkUtilities.cpp
--- webkitgtk-2.32.1.cmake/Source/WebCore/platform/gtk/GtkUtilities.cpp	2021-02-26 03:57:13.000000000 -0600
+++ webkitgtk-2.32.1.gtk/Source/WebCore/platform/gtk/GtkUtilities.cpp	2021-05-27 15:48:31.746995219 -0500
@@ -191,20 +191,4 @@ GdkDragAction dragOperationToSingleGdkDr
     return static_cast<GdkDragAction>(0);
 }
 
-void monitorWorkArea(GdkMonitor* monitor, GdkRectangle* area)
-{
-#if USE(GTK4)
-#if PLATFORM(X11)
-    if (GDK_IS_X11_MONITOR(monitor)) {
-        gdk_x11_monitor_get_workarea(monitor, area);
-        return;
-    }
-#endif
-
-    gdk_monitor_get_geometry(monitor, area);
-#else
-    gdk_monitor_get_workarea(monitor, area);
-#endif
-}
-
 } // namespace WebCore
diff -urp webkitgtk-2.32.1.cmake/Source/WebCore/platform/gtk/GtkUtilities.h webkitgtk-2.32.1.gtk/Source/WebCore/platform/gtk/GtkUtilities.h
--- webkitgtk-2.32.1.cmake/Source/WebCore/platform/gtk/GtkUtilities.h	2021-02-26 03:57:13.000000000 -0600
+++ webkitgtk-2.32.1.gtk/Source/WebCore/platform/gtk/GtkUtilities.h	2021-05-27 15:48:31.746995219 -0500
@@ -55,6 +55,4 @@ WEBCORE_EXPORT OptionSet<DragOperation>
 WEBCORE_EXPORT GdkDragAction dragOperationToGdkDragActions(OptionSet<DragOperation>);
 WEBCORE_EXPORT GdkDragAction dragOperationToSingleGdkDragAction(OptionSet<DragOperation>);
 
-void monitorWorkArea(GdkMonitor*, GdkRectangle*);
-
 } // namespace WebCore
diff -urp webkitgtk-2.32.1.cmake/Source/WebCore/platform/gtk/PlatformScreenGtk.cpp webkitgtk-2.32.1.gtk/Source/WebCore/platform/gtk/PlatformScreenGtk.cpp
--- webkitgtk-2.32.1.cmake/Source/WebCore/platform/gtk/PlatformScreenGtk.cpp	2021-02-26 03:57:13.000000000 -0600
+++ webkitgtk-2.32.1.gtk/Source/WebCore/platform/gtk/PlatformScreenGtk.cpp	2021-05-27 15:48:31.746995219 -0500
@@ -93,43 +93,21 @@ bool screenHasInvertedColors()
 double screenDPI()
 {
     static const double defaultDpi = 96;
-#if !USE(GTK4)
     GdkScreen* screen = gdk_screen_get_default();
-    if (screen) {
-        double dpi = gdk_screen_get_resolution(screen);
-        if (dpi != -1)
-            return dpi;
-    }
-#endif
+    if (!screen)
+        return defaultDpi;
 
-    static GtkSettings* gtkSettings = gtk_settings_get_default();
-    if (gtkSettings) {
-        int gtkXftDpi;
-        g_object_get(gtkSettings, "gtk-xft-dpi", &gtkXftDpi, nullptr);
-        return gtkXftDpi / 1024.0;
-    }
+    double dpi = gdk_screen_get_resolution(screen);
+    if (dpi != -1)
+        return dpi;
 
     static double cachedDpi = 0;
     if (cachedDpi)
         return cachedDpi;
 
     static const double millimetresPerInch = 25.4;
-
-    GdkDisplay* display = gdk_display_get_default();
-    if (!display)
-        return defaultDpi;
-#if USE(GTK4)
-    GdkMonitor* monitor = GDK_MONITOR(g_list_model_get_item(gdk_display_get_monitors(display), 0));
-#else
-    GdkMonitor* monitor = gdk_display_get_monitor(display, 0);
-#endif
-    if (!monitor)
-        return defaultDpi;
-
-    GdkRectangle geometry;
-    gdk_monitor_get_geometry(monitor, &geometry);
-    double diagonalInPixels = std::hypot(geometry.width, geometry.height);
-    double diagonalInInches = std::hypot(gdk_monitor_get_width_mm(monitor), gdk_monitor_get_height_mm(monitor)) / millimetresPerInch;
+    double diagonalInPixels = std::hypot(gdk_screen_get_width(screen), gdk_screen_get_height(screen));
+    double diagonalInInches = std::hypot(gdk_screen_get_width_mm(screen), gdk_screen_get_height_mm(screen)) / millimetresPerInch;
     cachedDpi = diagonalInPixels / diagonalInInches;
 
     return cachedDpi;
@@ -169,6 +147,7 @@ void setScreenDPIObserverHandler(Functio
     }
 }
 
+#if GTK_CHECK_VERSION(3,22,0)
 static GRefPtr<GdkMonitor> currentScreenMonitor()
 {
     GdkDisplay* display = gdk_display_get_default();
@@ -185,29 +164,47 @@ static GRefPtr<GdkMonitor> currentScreen
     return gdk_display_get_monitor_at_window(display, rootWindow);
 #endif
 }
+#endif
 
 
 FloatRect screenRect(Widget*)
 {
     GdkRectangle geometry;
 
-    auto monitor = currentScreenMonitor();
+#if GTK_CHECK_VERSION(3,22,0)
+    auto* monitor = getCurrentScreenMonitor();
     if (!monitor)
         return { };
 
-    gdk_monitor_get_geometry(monitor.get(), &geometry);
+    gdk_monitor_get_geometry(monitor, &geometry);
+#else
+    GdkScreen* screen = gdk_screen_get_default();
+    if (!screen)
+        return { };
+
+    gdk_screen_get_monitor_geometry(screen, 0, &geometry);
+#endif // !GTK_CHECK_VERSION(3, 22, 0)
 
     return FloatRect(geometry.x, geometry.y, geometry.width, geometry.height);
 }
 
 FloatRect screenAvailableRect(Widget*)
 {
-    auto monitor = currentScreenMonitor();
+    GdkRectangle workArea;
+
+#if GTK_CHECK_VERSION(3,22,0)
+    auto* monitor = getCurrentScreenMonitor();
     if (!monitor)
         return { };
 
-    GdkRectangle workArea;
-    monitorWorkArea(monitor.get(), &workArea);
+    gdk_monitor_get_workarea(monitor, &workArea);
+#else
+    GdkScreen* screen = gdk_screen_get_default();
+    if (!screen)
+        return FloatRect();
+
+    gdk_screen_get_monitor_workarea(screen, 0, &workArea);
+#endif // !GTK_CHECK_VERSION(3, 22, 0)
 
     return FloatRect(workArea.x, workArea.y, workArea.width, workArea.height);
 }
diff -urp webkitgtk-2.32.1.cmake/Source/WebKit/UIProcess/gtk/WebContextMenuProxyGtk.cpp webkitgtk-2.32.1.gtk/Source/WebKit/UIProcess/gtk/WebContextMenuProxyGtk.cpp
--- webkitgtk-2.32.1.cmake/Source/WebKit/UIProcess/gtk/WebContextMenuProxyGtk.cpp	2021-02-26 03:57:16.000000000 -0600
+++ webkitgtk-2.32.1.gtk/Source/WebKit/UIProcess/gtk/WebContextMenuProxyGtk.cpp	2021-05-27 15:48:31.746995219 -0500
@@ -95,24 +95,21 @@ static GtkWidget* createMenuWidget(GtkWi
     return widget;
 }
 
-static void popupMenuWidget(GtkWidget* widget, const GdkEvent* triggerEvent, const GdkRectangle& target)
+void WebContextMenuProxyGtk::menuPositionFunction(GtkMenu* menu, gint* x, gint* y, gboolean* pushIn, WebContextMenuProxyGtk* popupMenu)
 {
-    GUniquePtr<GdkEvent> keyEvent;
-    auto* window = gtk_widget_get_window(gtk_menu_get_attach_widget(GTK_MENU(widget)));
-    if (!triggerEvent) {
-        // When the context menu is requested using the keyboard, there is no
-        // triggerEvent: use a fake event for the “Menu” key being released.
-        keyEvent.reset(gdk_event_new(GDK_KEY_RELEASE));
-        gdk_event_set_device(keyEvent.get(), gdk_seat_get_keyboard(gdk_display_get_default_seat(gdk_window_get_display(window))));
-        auto* event = reinterpret_cast<GdkEventKey*>(keyEvent.get());
-        event->window = window;
-        // Take a ref of the GdkWindow when creating the GdkEvent, since the event will unref it on destroy.
-        g_object_ref(window);
-        event->time = GDK_CURRENT_TIME;
-        event->keyval = GDK_KEY_Menu;
-        triggerEvent = keyEvent.get();
-    };
-    gtk_menu_popup_at_rect(GTK_MENU(widget), window, &target, GDK_GRAVITY_SOUTH_WEST, GDK_GRAVITY_NORTH_WEST, triggerEvent);
+    GtkRequisition menuSize;
+    gtk_widget_get_preferred_size(GTK_WIDGET(menu), &menuSize, 0);
+
+    GdkScreen* screen = gtk_widget_get_screen(popupMenu->m_webView);
+    *x = popupMenu->m_popupPosition.x();
+    if ((*x + menuSize.width) >= gdk_screen_get_width(screen))
+        *x -= menuSize.width;
+
+    *y = popupMenu->m_popupPosition.y();
+    if ((*y + menuSize.height) >= gdk_screen_get_height(screen))
+        *y -= menuSize.height;
+
+    *pushIn = FALSE;
 }
 
 static inline void popdownMenuWidget(GtkWidget* widget)
@@ -270,8 +267,8 @@ void WebContextMenuProxyGtk::showContext
 
     NativeWebMouseEvent* mouseEvent = page()->currentlyProcessedMouseDownEvent();
     const GdkEvent* event = mouseEvent ? mouseEvent->nativeEvent() : nullptr;
-    const GdkRectangle rect = { m_context.menuLocation().x(), m_context.menuLocation().y(), 1, 1 };
-    popupMenuWidget(m_menu, event, rect);
+    m_popupPosition = convertWidgetPointToScreenPoint(m_webView, m_context.menuLocation());
+    gtk_menu_popup(GTK_MENU(m_menu), nullptr, nullptr, reinterpret_cast<GtkMenuPositionFunc>(menuPositionFunction), this, event ? event->button.button : 3, event ? event->button.time : GDK_CURRENT_TIME);
 }
 
 WebContextMenuProxyGtk::WebContextMenuProxyGtk(GtkWidget* webView, WebPageProxy& page, ContextMenuContextData&& context, const UserData& userData)
diff -urp webkitgtk-2.32.1.cmake/Source/WebKit/UIProcess/gtk/WebContextMenuProxyGtk.h webkitgtk-2.32.1.gtk/Source/WebKit/UIProcess/gtk/WebContextMenuProxyGtk.h
--- webkitgtk-2.32.1.cmake/Source/WebKit/UIProcess/gtk/WebContextMenuProxyGtk.h	2021-02-26 03:57:16.000000000 -0600
+++ webkitgtk-2.32.1.gtk/Source/WebKit/UIProcess/gtk/WebContextMenuProxyGtk.h	2021-05-27 15:48:31.746995219 -0500
@@ -62,9 +62,11 @@ private:
     GRefPtr<GMenu> buildMenu(const Vector<WebContextMenuItemGlib>&);
     void populate(const Vector<Ref<WebContextMenuItem>>&);
     Vector<WebContextMenuItemGlib> populateSubMenu(const WebContextMenuItemData&);
+    static void menuPositionFunction(GtkMenu*, gint*, gint*, gboolean*, WebContextMenuProxyGtk*);
 
     GtkWidget* m_webView;
     GtkWidget* m_menu;
+    WebCore::IntPoint m_popupPosition;
     HashMap<unsigned long, void*> m_signalHandlers;
     GRefPtr<GSimpleActionGroup> m_actionGroup { adoptGRef(g_simple_action_group_new()) };
 };
diff -urp webkitgtk-2.32.1.cmake/Source/WebKit/UIProcess/gtk/WebPopupMenuProxyGtk.cpp webkitgtk-2.32.1.gtk/Source/WebKit/UIProcess/gtk/WebPopupMenuProxyGtk.cpp
--- webkitgtk-2.32.1.cmake/Source/WebKit/UIProcess/gtk/WebPopupMenuProxyGtk.cpp	2021-02-26 03:57:16.000000000 -0600
+++ webkitgtk-2.32.1.gtk/Source/WebKit/UIProcess/gtk/WebPopupMenuProxyGtk.cpp	2021-05-27 15:48:31.746995219 -0500
@@ -313,14 +313,10 @@ void WebPopupMenuProxyGtk::showPopupMenu
     gtk_window_set_screen(GTK_WINDOW(m_popup), gtk_widget_get_screen(m_webView));
 #endif
 
-    auto* display = gtk_widget_get_display(m_webView);
-#if USE(GTK4)
-    auto* monitor = gdk_display_get_monitor_at_surface(display, gtk_native_get_surface(gtk_widget_get_native(m_webView)));
-#else
-    auto* monitor = gdk_display_get_monitor_at_window(display, gtk_widget_get_window(m_webView));
-#endif
+    auto display = gtk_widget_get_display(m_webView);
+    GdkScreen* screen = gdk_screen_get_default();
     GdkRectangle area;
-    monitorWorkArea(monitor, &area);
+    gdk_screen_get_monitor_workarea(screen, 0, &area);
     int width = std::min(rect.width(), area.width);
     size_t itemCount = std::min<size_t>(items.size(), (area.height / 3) / itemHeight);
 
diff -urp webkitgtk-2.32.1.cmake/Source/WTF/wtf/Platform.h webkitgtk-2.32.1.gtk/Source/WTF/wtf/Platform.h
--- webkitgtk-2.32.1.cmake/Source/WTF/wtf/Platform.h	2021-03-12 04:22:57.000000000 -0600
+++ webkitgtk-2.32.1.gtk/Source/WTF/wtf/Platform.h	2021-05-27 15:48:31.746995219 -0500
@@ -87,7 +87,7 @@
 #if USE(GTK4)
 #define GDK_VERSION_MIN_REQUIRED GDK_VERSION_4_0
 #else
-#define GDK_VERSION_MIN_REQUIRED GDK_VERSION_3_22
+#define GDK_VERSION_MIN_REQUIRED GDK_VERSION_3_20
 #endif
 #endif
 
diff -urp webkitgtk-2.32.1.cmake/Tools/MiniBrowser/gtk/BrowserDownloadsBar.c webkitgtk-2.32.1.gtk/Tools/MiniBrowser/gtk/BrowserDownloadsBar.c
--- webkitgtk-2.32.1.cmake/Tools/MiniBrowser/gtk/BrowserDownloadsBar.c	2021-02-26 03:57:17.000000000 -0600
+++ webkitgtk-2.32.1.gtk/Tools/MiniBrowser/gtk/BrowserDownloadsBar.c	2021-05-27 10:30:05.821817049 -0500
@@ -116,7 +116,7 @@ static void actionButtonClicked(GtkButto
         return;
     }
 
-    gtk_show_uri_on_window(GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(browserDownload))),
+    gtk_show_uri(gtk_widget_get_screen(GTK_WIDGET(browserDownload)),
                  webkit_download_get_destination(browserDownload->download),
                  gtk_get_current_event_time(), NULL);
     gtk_widget_destroy(GTK_WIDGET(browserDownload));
diff -urp webkitgtk-2.32.1.cmake/Tools/MiniBrowser/gtk/BrowserSearchBox.c webkitgtk-2.32.1.gtk/Tools/MiniBrowser/gtk/BrowserSearchBox.c
--- webkitgtk-2.32.1.cmake/Tools/MiniBrowser/gtk/BrowserSearchBox.c	2021-02-26 03:57:17.000000000 -0600
+++ webkitgtk-2.32.1.gtk/Tools/MiniBrowser/gtk/BrowserSearchBox.c	2021-06-02 10:17:12.637516188 -0500
@@ -34,7 +34,7 @@ struct _BrowserSearchBox {
     GtkWidget *prevButton;
     GtkWidget *nextButton;
     GActionGroup *actionGroup;
-    GMenu *optionsMenu;
+    GtkWidget *optionsMenu;
     GtkWidget *optionsPopover;
     GtkWidget *caseCheckButton;
     GtkWidget *begginigWordCheckButton;
@@ -65,23 +65,12 @@ static void doSearch(BrowserSearchBox *s
         gtk_entry_set_icon_from_icon_name(entry, GTK_ENTRY_ICON_SECONDARY, "edit-clear-symbolic");
 
     WebKitFindOptions options = WEBKIT_FIND_OPTIONS_WRAP_AROUND;
-    GAction *action = g_action_map_lookup_action(G_ACTION_MAP(searchBox->actionGroup), "case-sensitive");
-    GVariant *state = g_action_get_state(action);
-    if (!g_variant_get_boolean(state))
+    if (!gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(searchBox->caseCheckButton)))
         options |= WEBKIT_FIND_OPTIONS_CASE_INSENSITIVE;
-    g_variant_unref(state);
-
-    action = g_action_map_lookup_action(G_ACTION_MAP(searchBox->actionGroup), "beginning-word");
-    state = g_action_get_state(action);
-    if (g_variant_get_boolean(state))
+    if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(searchBox->begginigWordCheckButton)))
         options |= WEBKIT_FIND_OPTIONS_AT_WORD_STARTS;
-    g_variant_unref(state);
-
-    action = g_action_map_lookup_action(G_ACTION_MAP(searchBox->actionGroup), "capital-as-beginning-word");
-    state = g_action_get_state(action);
-    if (g_variant_get_boolean(state))
+    if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(searchBox->capitalAsBegginigWordCheckButton)))
         options |= WEBKIT_FIND_OPTIONS_TREAT_MEDIAL_CAPITAL_AS_WORD_START;
-    g_variant_unref(state);
 
 #if GTK_CHECK_VERSION(3, 98, 5)
     const gchar *text = gtk_editable_get_text(GTK_EDITABLE(entry));
@@ -103,23 +92,10 @@ static void searchPrevious(BrowserSearch
 
 static void searchEntryMenuIconPressedCallback(BrowserSearchBox *searchBox, GtkEntryIconPosition iconPosition, GdkEvent *event)
 {
-    if (iconPosition != GTK_ENTRY_ICON_PRIMARY)
-        return;
-
-#if GTK_CHECK_VERSION(3, 98, 5)
-    GtkWidget *popover = gtk_popover_menu_new_from_model(G_MENU_MODEL(searchBox->optionsMenu));
-    gtk_widget_set_parent(popover, GTK_WIDGET(searchBox));
-#else
-    GtkWidget *popover = gtk_popover_menu_new();
-    gtk_popover_bind_model(GTK_POPOVER(popover), G_MENU_MODEL(searchBox->optionsMenu), NULL);
-    gtk_popover_set_relative_to(GTK_POPOVER(popover), searchBox->entry);
-#endif
-    searchBox->optionsPopover = popover;
-    GdkRectangle rect;
-    gtk_entry_get_icon_area(GTK_ENTRY(searchBox->entry), GTK_ENTRY_ICON_PRIMARY, &rect);
-    gtk_popover_set_pointing_to(GTK_POPOVER(popover), &rect);
-    gtk_popover_set_position(GTK_POPOVER(popover), GTK_POS_BOTTOM);
-    gtk_popover_popup(GTK_POPOVER(popover));
+    if (iconPosition == GTK_ENTRY_ICON_PRIMARY) {
+        GdkEventButton *eventButton = (GdkEventButton *)event;
+        gtk_menu_popup(GTK_MENU(searchBox->optionsMenu), NULL, NULL, NULL, NULL, eventButton->button, eventButton->time);
+    }
 }
 
 static void searchEntryClearIconReleasedCallback(BrowserSearchBox *searchBox, GtkEntryIconPosition iconPosition)
@@ -154,10 +130,9 @@ static void searchNextButtonCallback(GSi
     searchNext(BROWSER_SEARCH_BOX(userData));
 }
 
-static void searchMenuCheckButtonToggledCallback(GSimpleAction *action, GVariant *state, gpointer userData)
+static void searchMenuCheckButtonToggledCallback(BrowserSearchBox *searchBox)
 {
-    g_simple_action_set_state(action, state);
-    doSearch(BROWSER_SEARCH_BOX(userData));
+    doSearch(searchBox);
 }
 
 static void findControllerFailedToFindTextCallback(BrowserSearchBox *searchBox)
@@ -173,9 +148,6 @@ static void findControllerFoundTextCallb
 static const GActionEntry actions[] = {
     { "next", searchNextButtonCallback, NULL, NULL, NULL, { 0 } },
     { "previous", searchPreviousButtonCallback, NULL, NULL, NULL, { 0 } },
-    { "case-sensitive", NULL, NULL, "false", searchMenuCheckButtonToggledCallback, { 0 } },
-    { "beginning-word", NULL, NULL, "false", searchMenuCheckButtonToggledCallback, { 0 } },
-    { "capital-as-beginning-word", NULL, NULL, "false", searchMenuCheckButtonToggledCallback, { 0 } }
 };
 
 static void browser_search_box_init(BrowserSearchBox *searchBox)
@@ -249,15 +221,24 @@ static void browser_search_box_init(Brow
     gtk_widget_show(searchBox->nextButton);
 #endif
 
-    searchBox->optionsMenu = g_menu_new();
-    g_menu_append(searchBox->optionsMenu, "Ca_se sensitive", "find.case-sensitive");
-    g_menu_append(searchBox->optionsMenu, "Only at the _beginning of words", "find.beginning-word");
-    g_menu_append(searchBox->optionsMenu, "Capital _always as beginning of word", "find.capital-as-beginning-word");
+    searchBox->optionsMenu = g_object_ref_sink(gtk_menu_new());
+    searchBox->caseCheckButton = gtk_check_menu_item_new_with_mnemonic("Ca_se sensitive");
+    gtk_container_add(GTK_CONTAINER(searchBox->optionsMenu), searchBox->caseCheckButton);
+
+    searchBox->begginigWordCheckButton = gtk_check_menu_item_new_with_mnemonic("Only at the _beginning of words");
+    gtk_container_add(GTK_CONTAINER(searchBox->optionsMenu), searchBox->begginigWordCheckButton);
+    searchBox->capitalAsBegginigWordCheckButton = gtk_check_menu_item_new_with_mnemonic("Capital _always as beginning of word");
+    gtk_container_add(GTK_CONTAINER(searchBox->optionsMenu), searchBox->capitalAsBegginigWordCheckButton);
 
     g_signal_connect_swapped(searchBox->entry, "icon-press", G_CALLBACK(searchEntryMenuIconPressedCallback), searchBox);
     g_signal_connect_swapped(searchBox->entry, "icon-release", G_CALLBACK(searchEntryClearIconReleasedCallback), searchBox);
     g_signal_connect_after(searchBox->entry, "changed", G_CALLBACK(searchEntryChangedCallback), searchBox);
     g_signal_connect_swapped(searchBox->entry, "activate", G_CALLBACK(searchEntryActivatedCallback), searchBox);
+    g_signal_connect_swapped(searchBox->caseCheckButton, "toggled", G_CALLBACK(searchMenuCheckButtonToggledCallback), searchBox);
+    g_signal_connect_swapped(searchBox->begginigWordCheckButton, "toggled", G_CALLBACK(searchMenuCheckButtonToggledCallback), searchBox);
+    g_signal_connect_swapped(searchBox->capitalAsBegginigWordCheckButton, "toggled", G_CALLBACK(searchMenuCheckButtonToggledCallback), searchBox);
+
+    gtk_widget_show_all(searchBox->optionsMenu);
 }
 
 static void browserSearchBoxFinalize(GObject *gObject)
diff -urp webkitgtk-2.32.1.cmake/Tools/MiniBrowser/gtk/BrowserWindow.c webkitgtk-2.32.1.gtk/Tools/MiniBrowser/gtk/BrowserWindow.c
--- webkitgtk-2.32.1.cmake/Tools/MiniBrowser/gtk/BrowserWindow.c	2021-02-26 03:57:17.000000000 -0600
+++ webkitgtk-2.32.1.gtk/Tools/MiniBrowser/gtk/BrowserWindow.c	2021-06-01 14:43:48.869139781 -0500
@@ -92,6 +92,11 @@ static void browserWindowSetStatusText(B
     browser_tab_set_status_text(window->activeTab, text);
 }
 
+static void resetStatusText(GtkWidget *widget, BrowserWindow *window)
+{
+    browserWindowSetStatusText(window, NULL);
+}
+
 static void activateUriEntryCallback(BrowserWindow *window)
 {
     browser_window_load_uri(window,
@@ -199,9 +204,15 @@ static void downloadStarted(WebKitWebCon
 #endif
 }
 
-static void browserWindowHistoryItemActivated(BrowserWindow *window, GVariant *parameter, GAction *action)
+static void browserWindowHistoryItemSelected(BrowserWindow *window, GtkMenuItem *menuItem)
+{
+    WebKitBackForwardListItem *item = g_object_get_data(G_OBJECT(menuItem), "back-forward-list-item");
+    browserWindowSetStatusText(window, item ? webkit_back_forward_list_item_get_uri(item) : NULL);
+}
+
+static void browserWindowHistoryItemActivated(BrowserWindow *window, GtkMenuItem *menuItem)
 {
-    WebKitBackForwardListItem *item = g_object_get_data(G_OBJECT(action), "back-forward-list-item");
+    WebKitBackForwardListItem *item = g_object_get_data(G_OBJECT(menuItem), "back-forward-list-item");
     if (!item)
         return;
 
@@ -209,15 +220,13 @@ static void browserWindowHistoryItemActi
     webkit_web_view_go_to_back_forward_list_item(webView, item);
 }
 
-static void browserWindowCreateBackForwardMenu(BrowserWindow *window, GList *list, gboolean isBack)
+static GtkWidget *browserWindowCreateBackForwardMenu(BrowserWindow *window, GList *list)
 {
     if (!list)
-        return;
+        return NULL;
 
-    static guint64 actionId = 0;
+    GtkWidget *menu = gtk_menu_new();
 
-    GSimpleActionGroup *actionGroup = g_simple_action_group_new();
-    GMenu *menu = g_menu_new();
     GList *listItem;
     for (listItem = list; listItem; listItem = g_list_next(listItem)) {
         WebKitBackForwardListItem *item = (WebKitBackForwardListItem *)listItem->data;
@@ -247,42 +256,19 @@ static void browserWindowCreateBackForwa
 #endif
 #undef MAX_TITLE
 
-        char *actionName = g_strdup_printf("action-%lu", ++actionId);
-        GSimpleAction *action = g_simple_action_new(actionName, NULL);
-        g_object_set_data_full(G_OBJECT(action), "back-forward-list-item", g_object_ref(item), g_object_unref);
-        g_signal_connect_swapped(action, "activate", G_CALLBACK(browserWindowHistoryItemActivated), window);
-        g_action_map_add_action(G_ACTION_MAP(actionGroup), G_ACTION(action));
-        g_object_unref(action);
-
-        char *detailedActionName = g_strdup_printf("%s.%s", isBack ? "bf-back" : "bf-forward", actionName);
-        GMenuItem *menuItem = g_menu_item_new(displayTitle, detailedActionName);
-        g_menu_append_item(menu, menuItem);
-        g_object_unref(menuItem);
+        GtkWidget *menuItem = gtk_menu_item_new_with_label(title);
+        g_object_set_data_full(G_OBJECT(menuItem), "back-forward-list-item", g_object_ref(item), g_object_unref);
+        g_signal_connect_swapped(menuItem, "select", G_CALLBACK(browserWindowHistoryItemSelected), window);
+        g_signal_connect_swapped(menuItem, "activate", G_CALLBACK(browserWindowHistoryItemActivated), window);
+
+        gtk_menu_shell_prepend(GTK_MENU_SHELL(menu), menuItem);
+        gtk_widget_show(menuItem);
 
         g_free(displayTitle);
-        g_free(detailedActionName);
-        g_free(actionName);
     }
 
-#if GTK_CHECK_VERSION(3, 98, 5)
-    GtkWidget *popover = gtk_popover_menu_new_from_model(G_MENU_MODEL(menu));
-#else
-    GtkWidget *popover = gtk_popover_menu_new();
-    gtk_popover_bind_model(GTK_POPOVER(popover), G_MENU_MODEL(menu), NULL);
-#endif
-    g_object_unref(menu);
-    gtk_widget_insert_action_group(popover, isBack ? "bf-back" : "bf-forward", G_ACTION_GROUP(actionGroup));
-    g_object_unref(actionGroup);
-
-    GtkWidget *button = isBack ? window->backItem : window->forwardItem;
-#if GTK_CHECK_VERSION(3, 98, 5)
-    g_object_set_data_full(G_OBJECT(button), "history-popover", popover, (GDestroyNotify)gtk_widget_unparent);
-    gtk_widget_set_parent(popover, button);
-#else
-    gtk_popover_set_relative_to(GTK_POPOVER(popover), button);
-    g_object_set_data(G_OBJECT(button), "history-popover", popover);
-#endif
-    gtk_popover_set_position(GTK_POPOVER(popover), GTK_POS_BOTTOM);
+    g_signal_connect(menu, "hide", G_CALLBACK(resetStatusText), window);
+    return menu;
 }
 
 static void browserWindowUpdateNavigationMenu(BrowserWindow *window, WebKitBackForwardList *backForwardlist)
@@ -294,43 +280,16 @@ static void browserWindowUpdateNavigatio
     g_simple_action_set_enabled(G_SIMPLE_ACTION(action), webkit_web_view_can_go_forward(webView));
 
     GList *list = g_list_reverse(webkit_back_forward_list_get_back_list_with_limit(backForwardlist, 10));
-    browserWindowCreateBackForwardMenu(window, list, TRUE);
+    gtk_menu_tool_button_set_menu(GTK_MENU_TOOL_BUTTON(window->backItem),
+        browserWindowCreateBackForwardMenu(window, list));
     g_list_free(list);
 
     list = webkit_back_forward_list_get_forward_list_with_limit(backForwardlist, 10);
-    browserWindowCreateBackForwardMenu(window, list, FALSE);
+    gtk_menu_tool_button_set_menu(GTK_MENU_TOOL_BUTTON(window->forwardItem),
+        browserWindowCreateBackForwardMenu(window, list));
     g_list_free(list);
 }
 
-#if GTK_CHECK_VERSION(3, 98, 5)
-static void navigationButtonPressed(GtkGestureClick *gesture, guint clickCount, double x, double y)
-{
-    GdkEventSequence *sequence = gtk_gesture_single_get_current_sequence(GTK_GESTURE_SINGLE(gesture));
-    gtk_gesture_set_sequence_state(GTK_GESTURE(gesture), sequence, GTK_EVENT_SEQUENCE_CLAIMED);
-
-    GtkWidget *button = gtk_event_controller_get_widget(GTK_EVENT_CONTROLLER(gesture));
-    GtkWidget *popover = g_object_get_data(G_OBJECT(button), "history-popover");
-    if (popover)
-        gtk_popover_popup(GTK_POPOVER(popover));
-}
-#else
-static gboolean navigationButtonPressCallback(GtkButton *button, GdkEvent *event, BrowserWindow *window)
-{
-    guint eventButton;
-    gdk_event_get_button(event, &eventButton);
-    if (eventButton != GDK_BUTTON_SECONDARY)
-        return GDK_EVENT_PROPAGATE;
-
-    GtkWidget *popover = g_object_get_data(G_OBJECT(button), "history-popover");
-    if (!popover)
-        return GDK_EVENT_PROPAGATE;
-
-    gtk_popover_popup(GTK_POPOVER(popover));
-
-    return GDK_EVENT_STOP;
-}
-#endif
-
 static void browserWindowTryCloseCurrentWebView(GSimpleAction *action, GVariant *parameter, gpointer userData)
 {
     BrowserWindow *window = BROWSER_WINDOW(userData);
@@ -506,12 +465,6 @@ static gboolean browserWindowCanZoomOut(
     return zoomLevel > minimumZoomLevel;
 }
 
-static gboolean browserWindowCanZoomDefault(BrowserWindow *window)
-{
-    WebKitWebView *webView = browser_tab_get_web_view(window->activeTab);
-    return webkit_web_view_get_zoom_level(webView) != 1.0;
-}
-
 static gboolean browserWindowZoomIn(BrowserWindow *window)
 {
     if (browserWindowCanZoomIn(window)) {
@@ -565,8 +518,6 @@ static void browserWindowUpdateZoomActio
     g_simple_action_set_enabled(G_SIMPLE_ACTION(action), browserWindowCanZoomIn(window));
     action = g_action_map_lookup_action(G_ACTION_MAP(window), "zoom-out");
     g_simple_action_set_enabled(G_SIMPLE_ACTION(action), browserWindowCanZoomOut(window));
-    action = g_action_map_lookup_action(G_ACTION_MAP(window), "zoom-default");
-    g_simple_action_set_enabled(G_SIMPLE_ACTION(action), browserWindowCanZoomDefault(window));
 }
 
 static void webViewZoomLevelChanged(GObject *object, GParamSpec *paramSpec, BrowserWindow *window)
@@ -622,8 +573,6 @@ static void webViewIsLoadingChanged(WebK
 #if GTK_CHECK_VERSION(3, 98, 5)
     gtk_button_set_icon_name(GTK_BUTTON(window->reloadOrStopButton), isLoading ? "process-stop-symbolic" : "view-refresh-symbolic");
 #else
-    GtkWidget *image = gtk_button_get_image(GTK_BUTTON(window->reloadOrStopButton));
-    g_object_set(image, "icon-name", isLoading ? "process-stop-symbolic" : "view-refresh-symbolic", NULL);
 #endif
 }
 
@@ -909,54 +858,17 @@ static void browserWindowDispose(GObject
     G_OBJECT_CLASS(browser_window_parent_class)->dispose(gObject);
 }
 
-typedef enum {
-    TOOLBAR_BUTTON_NORMAL,
-    TOOLBAR_BUTTON_TOGGLE,
-    TOOLBAR_BUTTON_MENU
-} ToolbarButtonType;
-
-static GtkWidget *addToolbarButton(GtkWidget *box, ToolbarButtonType type, const char *iconName, const char *actionName)
-{
-    GtkWidget *button;
-    switch (type) {
-    case TOOLBAR_BUTTON_NORMAL:
-#if GTK_CHECK_VERSION(3, 98, 5)
-        button = gtk_button_new_from_icon_name(iconName);
-#else
-        button = gtk_button_new_from_icon_name(iconName, GTK_ICON_SIZE_MENU);
-#endif
-        break;
-    case TOOLBAR_BUTTON_TOGGLE:
-        button = gtk_toggle_button_new();
-#if GTK_CHECK_VERSION(3, 98, 5)
-        gtk_button_set_icon_name(GTK_BUTTON(button), iconName);
-#else
-        gtk_button_set_image(GTK_BUTTON(button), gtk_image_new_from_icon_name(iconName, GTK_ICON_SIZE_MENU));
-#endif
-        break;
-    case TOOLBAR_BUTTON_MENU:
-        button = gtk_menu_button_new();
-#if GTK_CHECK_VERSION(3, 98, 5)
-        gtk_menu_button_set_icon_name(GTK_MENU_BUTTON(button), iconName);
-#else
-        gtk_button_set_image(GTK_BUTTON(button), gtk_image_new_from_icon_name(iconName, GTK_ICON_SIZE_MENU));
-#endif
-
-        break;
-    }
-
-    gtk_widget_set_focus_on_click(button, FALSE);
-    if (actionName)
-        gtk_actionable_set_action_name(GTK_ACTIONABLE(button), actionName);
-
-#if GTK_CHECK_VERSION(3, 98, 5)
-    gtk_box_append(GTK_BOX(box), button);
-#else
-    gtk_container_add(GTK_CONTAINER(box), button);
-    gtk_widget_show(button);
-#endif
-
-    return button;
+static GtkWidget *
+browserWindowSetupEditorToolbarItem(BrowserWindow* window, GtkWidget* toolbar, GType type, const char* label, const char* namedIcon, const char* actionName)
+{
+    GtkWidget *item = g_object_new(type, "icon-name", namedIcon, NULL);
+    if (type == GTK_TYPE_MENU_TOOL_BUTTON)
+        gtk_menu_tool_button_set_menu(GTK_MENU_TOOL_BUTTON(item), 0);
+    gtk_actionable_set_action_name(GTK_ACTIONABLE(item), actionName);
+    gtk_tool_button_set_label(GTK_TOOL_BUTTON(item), label);
+    gtk_toolbar_insert(GTK_TOOLBAR(toolbar), GTK_TOOL_ITEM(item), -1);
+    gtk_widget_show(item);
+    return item;
 }
 
 static const GActionEntry editActions[] = {
@@ -980,137 +892,91 @@ static const GActionEntry editActions[]
 
 static void browserWindowSetupEditorToolbar(BrowserWindow *window)
 {
-    GtkWidget *toolbar = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 4);
+    GtkWidget *toolbar = gtk_toolbar_new();
     window->editToolbar = toolbar;
-    gtk_widget_set_margin_top(toolbar, 2);
-    gtk_widget_set_margin_bottom(toolbar, 2);
-    gtk_widget_set_margin_start(toolbar, 2);
-    gtk_widget_set_margin_end(toolbar, 2);
+    gtk_orientable_set_orientation(GTK_ORIENTABLE(toolbar), GTK_ORIENTATION_HORIZONTAL);
+    gtk_toolbar_set_style(GTK_TOOLBAR(toolbar), GTK_TOOLBAR_BOTH_HORIZ);
 
     GSimpleActionGroup *actionGroup = g_simple_action_group_new();
     window->editActionGroup = G_ACTION_GROUP(actionGroup);
     g_action_map_add_action_entries(G_ACTION_MAP(actionGroup), editActions, G_N_ELEMENTS(editActions), window);
     gtk_widget_insert_action_group(toolbar, "edit", G_ACTION_GROUP(actionGroup));
 
-    GtkWidget *groupBox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
-#if GTK_CHECK_VERSION(3, 98, 5)
-    gtk_widget_add_css_class(groupBox, "linked");
-#else
-    gtk_style_context_add_class(gtk_widget_get_style_context(groupBox), GTK_STYLE_CLASS_LINKED);
-#endif
-    addToolbarButton(groupBox, TOOLBAR_BUTTON_TOGGLE, "format-text-bold-symbolic", "edit.Bold");
-    addToolbarButton(groupBox, TOOLBAR_BUTTON_TOGGLE, "format-text-italic-symbolic", "edit.Italic");
-    addToolbarButton(groupBox, TOOLBAR_BUTTON_TOGGLE, "format-text-underline-symbolic", "edit.Underline");
-    addToolbarButton(groupBox, TOOLBAR_BUTTON_TOGGLE, "format-text-strikethrough-symbolic", "edit.Strikethrough");
-#if GTK_CHECK_VERSION(3, 98, 5)
-    gtk_box_append(GTK_BOX(toolbar), groupBox);
-#else
-    gtk_box_pack_start(GTK_BOX(toolbar), groupBox, FALSE, FALSE, 0);
-    gtk_widget_show(groupBox);
-#endif
+    browserWindowSetupEditorToolbarItem(window, toolbar, GTK_TYPE_TOGGLE_TOOL_BUTTON, "Bold", "format-text-bold", "edit.Bold");
+    browserWindowSetupEditorToolbarItem(window, toolbar, GTK_TYPE_TOGGLE_TOOL_BUTTON, "Italic", "format-text-italic", "edit.Italic");
+    browserWindowSetupEditorToolbarItem(window, toolbar, GTK_TYPE_TOGGLE_TOOL_BUTTON, "Underline", "format-text-underline", "edit.Underline");
+    browserWindowSetupEditorToolbarItem(window, toolbar, GTK_TYPE_TOGGLE_TOOL_BUTTON, "Strikethrough", "format-text-strikethrough", "edit.Strikethrough");
+
+    GtkToolItem *item = gtk_separator_tool_item_new();
+    gtk_toolbar_insert(GTK_TOOLBAR(toolbar), item, -1);
+    gtk_widget_show(GTK_WIDGET(item));
+
+    browserWindowSetupEditorToolbarItem(window, toolbar, GTK_TYPE_TOOL_BUTTON, WEBKIT_EDITING_COMMAND_CUT, "edit-cut", "edit.Cut");
+    browserWindowSetupEditorToolbarItem(window, toolbar, GTK_TYPE_TOOL_BUTTON, WEBKIT_EDITING_COMMAND_COPY, "edit-copy", "edit.Copy");
+    browserWindowSetupEditorToolbarItem(window, toolbar, GTK_TYPE_TOOL_BUTTON, WEBKIT_EDITING_COMMAND_PASTE, "edit-paste", "edit.Paste");
+
+    item = gtk_separator_tool_item_new();
+    gtk_toolbar_insert(GTK_TOOLBAR(toolbar), item, -1);
+    gtk_widget_show(GTK_WIDGET(item));
+
+    browserWindowSetupEditorToolbarItem(window, toolbar, GTK_TYPE_TOOL_BUTTON, WEBKIT_EDITING_COMMAND_UNDO, "edit-undo", "edit.Undo");
+    browserWindowSetupEditorToolbarItem(window, toolbar, GTK_TYPE_TOOL_BUTTON, WEBKIT_EDITING_COMMAND_REDO, "edit-redo", "edit.Redo");
+
+    item = gtk_separator_tool_item_new();
+    gtk_toolbar_insert(GTK_TOOLBAR(toolbar), item, -1);
+    gtk_widget_show(GTK_WIDGET(item));
+
+    item = gtk_radio_tool_button_new(NULL);
+    GSList *justifyRadioGroup = gtk_radio_tool_button_get_group(GTK_RADIO_TOOL_BUTTON(item));
+    gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(item), "format-justify-left");
+    gtk_actionable_set_action_name(GTK_ACTIONABLE(item), "edit.JustifyLeft");
+    gtk_tool_button_set_label(GTK_TOOL_BUTTON(item), "Justify Left");
+    gtk_toolbar_insert(GTK_TOOLBAR(toolbar), item, -1);
+    gtk_widget_show(GTK_WIDGET(item));
+
+    item = gtk_radio_tool_button_new(justifyRadioGroup);
+    justifyRadioGroup = gtk_radio_tool_button_get_group(GTK_RADIO_TOOL_BUTTON(item));
+    gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(item), "format-justify-center");
+    gtk_actionable_set_action_name(GTK_ACTIONABLE(item), "edit.JustifyCenter");
+    gtk_tool_button_set_label(GTK_TOOL_BUTTON(item), "Justify Center");
+    gtk_toolbar_insert(GTK_TOOLBAR(toolbar), item, -1);
+    gtk_widget_show(GTK_WIDGET(item));
+
+    item = gtk_radio_tool_button_new(justifyRadioGroup);
+    gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(item), "format-justify-right");
+    gtk_actionable_set_action_name(GTK_ACTIONABLE(item), "edit.JustifyRight");
+    gtk_tool_button_set_label(GTK_TOOL_BUTTON(item), "Justify Right");
+    gtk_toolbar_insert(GTK_TOOLBAR(toolbar), item, -1);
+    gtk_widget_show(GTK_WIDGET(item));
+
+    item = gtk_separator_tool_item_new();
+    gtk_toolbar_insert(GTK_TOOLBAR(toolbar), item, -1);
+    gtk_widget_show(GTK_WIDGET(item));
+
+    browserWindowSetupEditorToolbarItem(window, toolbar, GTK_TYPE_TOOL_BUTTON, "Indent", "format-indent-more", "edit.Indent");
+    browserWindowSetupEditorToolbarItem(window, toolbar, GTK_TYPE_TOOL_BUTTON, "Outdent", "format-indent-less", "edit.Outdent");
+
+    item = gtk_separator_tool_item_new();
+    gtk_toolbar_insert(GTK_TOOLBAR(toolbar), item, -1);
+    gtk_widget_show(GTK_WIDGET(item));
+
+    item = gtk_tool_button_new(NULL, NULL);
+    gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(item), "insert-image");
+    gtk_tool_button_set_label(GTK_TOOL_BUTTON(item), "Insert Image");
+    g_signal_connect(G_OBJECT(item), "clicked", G_CALLBACK(insertImageCommandCallback), window);
+    gtk_toolbar_insert(GTK_TOOLBAR(toolbar), item, -1);
+    gtk_widget_show(GTK_WIDGET(item));
+
+    item = gtk_tool_button_new(NULL, NULL);
+    gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(item), "insert-link");
+    gtk_tool_button_set_label(GTK_TOOL_BUTTON(item), "Insert Link");
+    g_signal_connect(G_OBJECT(item), "clicked", G_CALLBACK(insertLinkCommandCallback), window);
+    gtk_toolbar_insert(GTK_TOOLBAR(toolbar), item, -1);
+    gtk_widget_show(GTK_WIDGET(item));
 
-    groupBox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
-#if GTK_CHECK_VERSION(3, 98, 5)
-    gtk_widget_add_css_class(groupBox, "linked");
-#else
-    gtk_style_context_add_class(gtk_widget_get_style_context(groupBox), GTK_STYLE_CLASS_LINKED);
-#endif
-    addToolbarButton(groupBox, TOOLBAR_BUTTON_NORMAL, "edit-cut-symbolic", "edit.Cut");
-    addToolbarButton(groupBox, TOOLBAR_BUTTON_NORMAL, "edit-copy-symbolic", "edit.Copy");
-    addToolbarButton(groupBox, TOOLBAR_BUTTON_NORMAL, "edit-paste-symbolic", "edit.Paste");
-#if GTK_CHECK_VERSION(3, 98, 5)
-    gtk_box_append(GTK_BOX(toolbar), groupBox);
-#else
-    gtk_box_pack_start(GTK_BOX(toolbar), groupBox, FALSE, FALSE, 0);
-    gtk_widget_show(groupBox);
-#endif
-
-    groupBox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
-#if GTK_CHECK_VERSION(3, 98, 5)
-    gtk_widget_add_css_class(groupBox, "linked");
-#else
-    gtk_style_context_add_class(gtk_widget_get_style_context(groupBox), GTK_STYLE_CLASS_LINKED);
-#endif
-    addToolbarButton(groupBox, TOOLBAR_BUTTON_NORMAL, "edit-undo-symbolic", "edit.Undo");
-    addToolbarButton(groupBox, TOOLBAR_BUTTON_NORMAL, "edit-redo-symbolic", "edit.Redo");
-#if GTK_CHECK_VERSION(3, 98, 5)
-    gtk_box_append(GTK_BOX(toolbar), groupBox);
-#else
-    gtk_box_pack_start(GTK_BOX(toolbar), groupBox, FALSE, FALSE, 0);
-    gtk_widget_show(groupBox);
-#endif
-
-    groupBox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
-#if GTK_CHECK_VERSION(3, 98, 5)
-    gtk_widget_add_css_class(groupBox, "linked");
-#else
-    gtk_style_context_add_class(gtk_widget_get_style_context(groupBox), GTK_STYLE_CLASS_LINKED);
-#endif
-    addToolbarButton(groupBox, TOOLBAR_BUTTON_NORMAL, "format-justify-left-symbolic", "edit.JustifyLeft");
-    addToolbarButton(groupBox, TOOLBAR_BUTTON_NORMAL, "format-justify-center-symbolic", "edit.JustifyCenter");
-    addToolbarButton(groupBox, TOOLBAR_BUTTON_NORMAL, "format-justify-right-symbolic", "edit.JustifyRight");
-#if GTK_CHECK_VERSION(3, 98, 5)
-    gtk_box_append(GTK_BOX(toolbar), groupBox);
-#else
-    gtk_box_pack_start(GTK_BOX(toolbar), groupBox, FALSE, FALSE, 0);
-    gtk_widget_show(groupBox);
-#endif
-
-    groupBox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
-#if GTK_CHECK_VERSION(3, 98, 5)
-    gtk_widget_add_css_class(groupBox, "linked");
-#else
-    gtk_style_context_add_class(gtk_widget_get_style_context(groupBox), GTK_STYLE_CLASS_LINKED);
-#endif
-    addToolbarButton(groupBox, TOOLBAR_BUTTON_NORMAL, "format-indent-more-symbolic", "edit.Indent");
-    addToolbarButton(groupBox, TOOLBAR_BUTTON_NORMAL, "format-indent-less-symbolic", "edit.Outdent");
-#if GTK_CHECK_VERSION(3, 98, 5)
-    gtk_box_append(GTK_BOX(toolbar), groupBox);
-#else
-    gtk_box_pack_start(GTK_BOX(toolbar), groupBox, FALSE, FALSE, 0);
-    gtk_widget_show(groupBox);
-#endif
-
-    groupBox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
-#if GTK_CHECK_VERSION(3, 98, 5)
-    gtk_widget_add_css_class(groupBox, "linked");
-#else
-    gtk_style_context_add_class(gtk_widget_get_style_context(groupBox), GTK_STYLE_CLASS_LINKED);
-#endif
-    /* Not the best icons for these, but we don't have insert list icons in GTK. */
-    addToolbarButton(groupBox, TOOLBAR_BUTTON_NORMAL, "media-record-symbolic", "edit.InsertUnorderedList");
-    addToolbarButton(groupBox, TOOLBAR_BUTTON_NORMAL, "zoom-original-symbolic", "edit.InsertOrderedList");
-#if GTK_CHECK_VERSION(3, 98, 5)
-    gtk_box_append(GTK_BOX(toolbar), groupBox);
-#else
-    gtk_box_pack_start(GTK_BOX(toolbar), groupBox, FALSE, FALSE, 0);
-    gtk_widget_show(groupBox);
-#endif
-
-    groupBox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
-#if GTK_CHECK_VERSION(3, 98, 5)
-    gtk_widget_add_css_class(groupBox, "linked");
-#else
-    gtk_style_context_add_class(gtk_widget_get_style_context(groupBox), GTK_STYLE_CLASS_LINKED);
-#endif
-    GtkWidget *button = addToolbarButton(groupBox, TOOLBAR_BUTTON_NORMAL, "insert-image-symbolic", NULL);
-    g_signal_connect(button, "clicked", G_CALLBACK(insertImageCommandCallback), window);
-    button = addToolbarButton(groupBox, TOOLBAR_BUTTON_NORMAL, "insert-link-symbolic", NULL);
-    g_signal_connect(button, "clicked", G_CALLBACK(insertLinkCommandCallback), window);
-#if GTK_CHECK_VERSION(3, 98, 5)
-    gtk_box_append(GTK_BOX(toolbar), groupBox);
-#else
-    gtk_box_pack_start(GTK_BOX(toolbar), groupBox, FALSE, FALSE, 0);
-    gtk_widget_show(groupBox);
-#endif
-
-#if GTK_CHECK_VERSION(3, 98, 5)
-    gtk_box_insert_child_after(GTK_BOX(window->mainBox), toolbar, window->toolbar);
-#else
     gtk_box_pack_start(GTK_BOX(window->mainBox), toolbar, FALSE, FALSE, 0);
     gtk_box_reorder_child(GTK_BOX(window->mainBox), toolbar, 1);
     gtk_widget_show(toolbar);
-#endif
 }
 
 static void browserWindowSwitchTab(GtkNotebook *notebook, BrowserTab *tab, guint tabIndex, BrowserWindow *window)
@@ -1173,50 +1039,6 @@ static void browserWindowTabAddedOrRemov
     gtk_notebook_set_show_tabs(GTK_NOTEBOOK(window->notebook), gtk_notebook_get_n_pages(notebook) > 1);
 }
 
-static void browserWindowBuildPopoverMenu(BrowserWindow *window, GtkWidget *parent)
-{
-    GMenu *menu = g_menu_new();
-    GMenu *section = g_menu_new();
-    GMenuItem *item = g_menu_item_new("Zoom Out", "win.zoom-out");
-    g_menu_item_set_attribute(item, "verb-icon", "s", "zoom-out-symbolic");
-    g_menu_append_item(section, item);
-    g_object_unref(item);
-
-    item = g_menu_item_new("Zoom Original", "win.zoom-default");
-    g_menu_item_set_attribute(item, "verb-icon", "s", "zoom-original-symbolic");
-    g_menu_append_item(section, item);
-    g_object_unref(item);
-
-    item = g_menu_item_new("Zoom In", "win.zoom-in");
-    g_menu_item_set_attribute(item, "verb-icon", "s", "zoom-in-symbolic");
-    g_menu_append_item(section, item);
-    g_object_unref(item);
-
-    GMenuItem *sectionItem = g_menu_item_new_section(NULL, G_MENU_MODEL(section));
-    g_menu_item_set_attribute(sectionItem, "display-hint", "s", "horizontal-buttons");
-    g_menu_append_item(menu, sectionItem);
-    g_object_unref(sectionItem);
-    g_object_unref(section);
-
-    section = g_menu_new();
-    g_menu_insert(section, -1, "_New Private Window", "win.open-private-window");
-    g_menu_insert(section, -1, "_Print…", "win.print");
-    g_menu_insert(section, -1, "Prefere_nces…", "win.preferences");
-    g_menu_insert(section, -1, "_Quit", "win.quit");
-    g_menu_append_section(menu, NULL, G_MENU_MODEL(section));
-    g_object_unref(section);
-
-#if GTK_CHECK_VERSION(3, 98, 5)
-    GtkWidget *popover = gtk_popover_menu_new_from_model(G_MENU_MODEL(menu));
-#else
-    GtkWidget *popover = gtk_popover_menu_new();
-    gtk_popover_bind_model(GTK_POPOVER(popover), G_MENU_MODEL(menu), NULL);
-#endif
-    g_object_unref(menu);
-
-    gtk_menu_button_set_popover(GTK_MENU_BUTTON(parent), popover);
-}
-
 static const GActionEntry actions[] = {
     { "reload", reloadPage, NULL, NULL, NULL, { 0 } },
     { "reload-no-cache", reloadPageIgnoringCache, NULL, NULL, NULL, { 0 } },
@@ -1250,63 +1072,41 @@ static void browser_window_init(BrowserW
 
     g_action_map_add_action_entries(G_ACTION_MAP(window), actions, G_N_ELEMENTS(actions), window);
 
-    GtkWidget *toolbar = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 4);
+    GtkWidget *toolbar = gtk_toolbar_new();
     window->toolbar = toolbar;
-    gtk_widget_set_margin_top(toolbar, 2);
-    gtk_widget_set_margin_bottom(toolbar, 2);
-    gtk_widget_set_margin_start(toolbar, 2);
-    gtk_widget_set_margin_end(toolbar, 2);
+    gtk_orientable_set_orientation(GTK_ORIENTABLE(toolbar), GTK_ORIENTATION_HORIZONTAL);
+    gtk_toolbar_set_style(GTK_TOOLBAR(toolbar), GTK_TOOLBAR_BOTH_HORIZ);
 
-    GtkWidget *navigationBox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
-#if GTK_CHECK_VERSION(3, 98, 5)
-    gtk_widget_add_css_class(navigationBox, "linked");
-#else
-    gtk_style_context_add_class(gtk_widget_get_style_context(navigationBox), GTK_STYLE_CLASS_LINKED);
-#endif
-
-    window->backItem = addToolbarButton(navigationBox, TOOLBAR_BUTTON_NORMAL, "go-previous-symbolic", "win.go-back");
-    window->forwardItem = addToolbarButton(navigationBox, TOOLBAR_BUTTON_NORMAL, "go-next-symbolic", "win.go-forward");
-#if GTK_CHECK_VERSION(3, 98, 5)
-    GtkGesture *gesture = gtk_gesture_click_new();
-    gtk_gesture_single_set_button(GTK_GESTURE_SINGLE(gesture), GDK_BUTTON_SECONDARY);
-    g_signal_connect(gesture, "pressed", G_CALLBACK(navigationButtonPressed), NULL);
-    gtk_widget_add_controller(window->backItem, GTK_EVENT_CONTROLLER(gesture));
-
-    gesture = gtk_gesture_click_new();
-    gtk_gesture_single_set_button(GTK_GESTURE_SINGLE(gesture), GDK_BUTTON_SECONDARY);
-    g_signal_connect(gesture, "pressed", G_CALLBACK(navigationButtonPressed), NULL);
-    gtk_widget_add_controller(window->forwardItem, GTK_EVENT_CONTROLLER(gesture));
-#else
-    g_signal_connect(window->backItem, "button-press-event", G_CALLBACK(navigationButtonPressCallback), window);
-    g_signal_connect(window->forwardItem, "button-press-event", G_CALLBACK(navigationButtonPressCallback), window);
-#endif
-#if GTK_CHECK_VERSION(3, 98, 5)
-    gtk_box_append(GTK_BOX(toolbar), navigationBox);
-#else
-    gtk_box_pack_start(GTK_BOX(toolbar), navigationBox, FALSE, FALSE, 0);
-    gtk_widget_show(navigationBox);
-#endif
-
-    addToolbarButton(toolbar, TOOLBAR_BUTTON_NORMAL, "go-home-symbolic", "win.load-homepage");
-    addToolbarButton(toolbar, TOOLBAR_BUTTON_NORMAL, "tab-new-symbolic", "win.new-tab");
+    window->backItem = browserWindowSetupEditorToolbarItem(window, toolbar, GTK_TYPE_MENU_TOOL_BUTTON, "Back", "go-previous", "win.go-back");
+    window->forwardItem = browserWindowSetupEditorToolbarItem(window, toolbar, GTK_TYPE_MENU_TOOL_BUTTON, "Forward", "go-next", "win.go-forward");
+    browserWindowSetupEditorToolbarItem(window, toolbar, GTK_TYPE_TOOL_BUTTON, "Preferences", "preferences-system", "win.preferences");
+
+    browserWindowSetupEditorToolbarItem(window, toolbar, GTK_TYPE_TOOL_BUTTON, "Zoom Out", "zoom-out", "win.zoom-out");
+    browserWindowSetupEditorToolbarItem(window, toolbar, GTK_TYPE_TOOL_BUTTON, "Zoom In", "zoom-in", "win.zoom-in");
+
+    browserWindowSetupEditorToolbarItem(window, toolbar, GTK_TYPE_TOOL_BUTTON, "Find", "edit-find", "win.find");
+
+    GtkToolItem *item = gtk_tool_button_new(gtk_image_new_from_icon_name("tab-new", GTK_ICON_SIZE_SMALL_TOOLBAR), NULL);
+    gtk_actionable_set_action_name(GTK_ACTIONABLE(item), "win.new-tab");
+    gtk_tool_button_set_label(GTK_TOOL_BUTTON(item), "New Tab");
+    gtk_toolbar_insert(GTK_TOOLBAR(toolbar), item, -1);
+    gtk_widget_show_all(GTK_WIDGET(item));
+    browserWindowSetupEditorToolbarItem(window, toolbar, GTK_TYPE_TOOL_BUTTON, "Home", "go-home", "win.load-homepage");
 
+    item = gtk_tool_item_new();
+    gtk_tool_item_set_expand(item, TRUE);
     window->uriEntry = gtk_entry_new();
     gtk_widget_set_halign(window->uriEntry, GTK_ALIGN_FILL);
     gtk_widget_set_hexpand(window->uriEntry, TRUE);
     g_signal_connect_swapped(window->uriEntry, "activate", G_CALLBACK(activateUriEntryCallback), (gpointer)window);
     gtk_entry_set_icon_activatable(GTK_ENTRY(window->uriEntry), GTK_ENTRY_ICON_PRIMARY, FALSE);
     updateUriEntryIcon(window);
-#if GTK_CHECK_VERSION(3, 98, 5)
-    gtk_box_append(GTK_BOX(toolbar), window->uriEntry);
-#else
-    gtk_container_add(GTK_CONTAINER(toolbar), window->uriEntry);
+    gtk_container_add(GTK_CONTAINER(item), window->uriEntry);
     gtk_widget_show(window->uriEntry);
-#endif
+    gtk_toolbar_insert(GTK_TOOLBAR(toolbar), item, -1);
+    gtk_widget_show(GTK_WIDGET(item));
 
-    window->reloadOrStopButton = addToolbarButton(toolbar, TOOLBAR_BUTTON_NORMAL, "view-refresh-symbolic", "win.reload-stop");
-    addToolbarButton(toolbar, TOOLBAR_BUTTON_NORMAL, "edit-find-symbolic", "win.find");
-    GtkWidget *button = addToolbarButton(toolbar, TOOLBAR_BUTTON_MENU, "open-menu-symbolic", NULL);
-    browserWindowBuildPopoverMenu(window, button);
+    window->reloadOrStopButton = browserWindowSetupEditorToolbarItem(window, toolbar, GTK_TYPE_TOOL_BUTTON, "Reload", "view-refresh", "win-reload-stop");
 
     GtkWidget *vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
     window->mainBox = vbox;
diff -urp webkitgtk-2.32.1.cmake/Tools/MiniBrowser/gtk/CMakeLists.txt webkitgtk-2.32.1.gtk/Tools/MiniBrowser/gtk/CMakeLists.txt
--- webkitgtk-2.32.1.cmake/Tools/MiniBrowser/gtk/CMakeLists.txt	2021-05-25 23:41:14.766333581 -0500
+++ webkitgtk-2.32.1.gtk/Tools/MiniBrowser/gtk/CMakeLists.txt	2021-05-27 15:48:31.746995219 -0500
@@ -60,7 +60,7 @@ add_custom_command(
 if (USE_GTK4)
     set(MiniBrowser_PRIVATE_DEFINITIONS GDK_VERSION_MIN_REQUIRED=GDK_VERSION_4_0)
 else ()
-    set(MiniBrowser_PRIVATE_DEFINITIONS GDK_VERSION_MIN_REQUIRED=GDK_VERSION_3_22)
+    set(MiniBrowser_PRIVATE_DEFINITIONS GDK_VERSION_MIN_REQUIRED=GDK_VERSION_3_20)
 endif ()
 
 if (DEVELOPER_MODE)
