How to focus child of non-modal popover (with autohide=false)?

I have a demo app with this widget layout:

GtkMenuButton
└GtkPopover
 └GtkScale

If the popover has autohide=true, clicking the button shows the popover and gives the scale focus:

If however the popover has autohide=false, then the focus remains on the button:

How do I focus the scale in this case? Calling grab_focus(), even after a delay, doesn’t seem to do anything.

Source code
#include <gtk/gtk.h>

void activate(GApplication *app, void *)
{
    GtkWidget *window = gtk_application_window_new(GTK_APPLICATION(app));
    
    GtkWidget *button = gtk_menu_button_new();
    gtk_window_set_child(GTK_WINDOW(window), button);
    
    GtkWidget *popover = gtk_popover_new();
    gtk_menu_button_set_popover(GTK_MENU_BUTTON(button), popover);
    
    GtkWidget *scale = gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL, 0, 100, 1);
    gtk_widget_set_size_request(scale, 200, -1);
    gtk_popover_set_child(GTK_POPOVER(popover), scale);
    gtk_popover_set_autohide(GTK_POPOVER(popover), FALSE);
    
    gtk_window_present(GTK_WINDOW(window));
}

int main(int argc, char **argv)
{
    GtkApplication *app = gtk_application_new("org.example.app", G_APPLICATION_DEFAULT_FLAGS);
    g_signal_connect(app, "activate", G_CALLBACK(activate), NULL);
    g_application_run(G_APPLICATION(app), argc, argv);
    g_object_unref(app);
}

The solution I found was to do either of the following on the popover’s show signal:

  • Run scale.grab_focus(). Note popover.grab_focus() doesn’t work. More generally, call grab_focus() on the first focusable child of the popover.

  • Run popover.child_focus(Gtk::DirectionType::TAB_FORWARD).

The first solution requires having to find the first focusable child which is inconvenient. The second avoids this, but is more of a hack, because the documentation for gtk_widget_child_focus() states

This function is used by custom widget implementations; if you’re writing an app, you’d use gtk_widget_grab_focus() to move the focus to a particular widget.

However, that is precisely what doesn’t work. I think this is a bug in GtkPopover which could be fixed by giving it a custom grab_focus override.