In preferences of my gnome shell extension I have a keyboard shortcut editor. When editing a shortcut, it needs to catch all keys, including fn/media keys. On Gtk 3 I can achieve it using Gdk.Seat.grab() on the default seat. However, I can’t find any replacement for it in Gtk/Gdk 4, and the migration guide tells to stop using grabs. So how do I catch fn/media keys?
I wonder how Gnome Settings will be ported to Gtk 4 https://gitlab.gnome.org/GNOME/gnome-control-center/-/blob/master/panels/keyboard/cc-keyboard-shortcut-editor.c#L213