Reimplement interactive tests without gtk_main()
gtk_main() is gone in GTK 4, but the tests in the tests/interactive/
directory currently rely on it.
GTK 4 removes the
gtk_main_*
family of APIs. The recommended replacement isGtkApplication
, but you can also iterate the GLib main loop directly, usingGMainContext
APIs. The replacement forgtk_events_pending()
isg_main_context_pending()
, the replacement forgtk_main_iteration()
isg_main_context_iteration()
.In GTK 4, you can use this replacement that will iterate the default main loop until all windows have been closed:
while (g_list_model_get_n_items (gtk_window_get_toplevels ()) > 0) g_main_context_iteration (NULL, TRUE);
In order to port to GTK 4, we must either solve this issue soon or disable the interactive tests and fix this later.