From c25fa19208a8ccdc4c490458a98b9857821156fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Wed, 1 Apr 2020 15:19:21 +0200 Subject: [PATCH] tests/test-client: Add commands to maximize/unmaximize https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1171 --- src/tests/test-client.c | 28 ++++++++++++++++++++++++++++ src/tests/test-runner.c | 2 ++ 2 files changed, 30 insertions(+) diff --git a/src/tests/test-client.c b/src/tests/test-client.c index 83a5ce485..3bb2a9a02 100644 --- a/src/tests/test-client.c +++ b/src/tests/test-client.c @@ -690,6 +690,34 @@ process_line (const char *line) gtk_window_deiconify (GTK_WINDOW (window)); } + else if (strcmp (argv[0], "maximize") == 0) + { + if (argc != 2) + { + g_print ("usage: maximize "); + goto out; + } + + GtkWidget *window = lookup_window (argv[1]); + if (!window) + goto out; + + gtk_window_maximize (GTK_WINDOW (window)); + } + else if (strcmp (argv[0], "unmaximize") == 0) + { + if (argc != 2) + { + g_print ("usage: unmaximize "); + goto out; + } + + GtkWidget *window = lookup_window (argv[1]); + if (!window) + goto out; + + gtk_window_unmaximize (GTK_WINDOW (window)); + } else { g_print ("Unknown command %s", argv[0]); diff --git a/src/tests/test-runner.c b/src/tests/test-runner.c index 950556233..cd47addb4 100644 --- a/src/tests/test-runner.c +++ b/src/tests/test-runner.c @@ -510,6 +510,8 @@ test_case_do (TestCase *test, strcmp (argv[0], "lower") == 0 || strcmp (argv[0], "minimize") == 0 || strcmp (argv[0], "unminimize") == 0 || + strcmp (argv[0], "maximize") == 0 || + strcmp (argv[0], "unmaximize") == 0 || strcmp (argv[0], "destroy") == 0) { if (argc != 2)