tests/test-runner: Add (un)set_modal

Ends up calling gtk_window_(un)set_modal() in the client.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3870>
This commit is contained in:
Jonas Ådahl 2024-07-16 11:44:05 +02:00 committed by Marge Bot
parent 9628806b37
commit c079e2696d
2 changed files with 34 additions and 0 deletions

View File

@ -757,6 +757,38 @@ process_line (const char *line)
gtk_window_unmaximize (GTK_WINDOW (window));
}
else if (strcmp (argv[0], "set_modal") == 0)
{
GtkWidget *window;
if (argc != 2)
{
g_print ("usage: set_modal <id>\n");
goto out;
}
window = lookup_window (argv[1]);
if (!window)
goto out;
gtk_window_set_modal (GTK_WINDOW (window), TRUE);
}
else if (strcmp (argv[0], "unset_modal") == 0)
{
GtkWidget *window;
if (argc != 2)
{
g_print ("usage: unset_modal <id>\n");
goto out;
}
window = lookup_window (argv[1]);
if (!window)
goto out;
gtk_window_set_modal (GTK_WINDOW (window), FALSE);
}
else if (strcmp (argv[0], "fullscreen") == 0)
{
if (argc != 2)

View File

@ -1140,6 +1140,8 @@ test_case_do (TestCase *test,
strcmp (argv[0], "unmaximize") == 0 ||
strcmp (argv[0], "fullscreen") == 0 ||
strcmp (argv[0], "unfullscreen") == 0 ||
strcmp (argv[0], "set_modal") == 0 ||
strcmp (argv[0], "unset_modal") == 0 ||
strcmp (argv[0], "freeze") == 0 ||
strcmp (argv[0], "thaw") == 0 ||
strcmp (argv[0], "destroy") == 0)