How to center GtkWindows in gtk4?

Whatever API your platform uses. On Windows, for instance, you would need to get the HANDLE out of the GdkSurface of the top level GtkWindow, and then use the native Windows API to move it. The same thing would apply to X11 (XID), or macOS (NSView).