Disable auto scrolling in GtkScrolledWindow when grab_focus() in children

My GtkScrolledWindow has bunch of children widgets wrapped in GtkBox. When I do grab_focus() in one of them, scrolled window tries to scroll automatically to make it more visible. I would love to disable this behaviour. I see there are some workarounds in Gtk 3, but they seem to be gone in Gtk 4.

I will write “I will read gtk 3 to gtk 4 migration document before raising questions” many times I feel :smiley:

It is covered here Gtk – 4.0: Migrating from GTK 3.x to GTK 4

The feature to automatically keep the focus widget scrolled into view with gtk_container_set_focus_vadjustment() has been removed together with GtkContainer, and is provided by scrollable widgets instead. In the common case that the scrollable is a GtkViewport, use GtkViewport:scroll-to-focus.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.