tests/test-client: Add "resize" command

The "resize" command resizes a window.

https://bugzilla.gnome.org/show_bug.cgi?id=790207
This commit is contained in:
Jonas Ådahl 2018-02-06 15:40:19 +08:00
parent 1266c20d4c
commit c8a4e37e0c

View File

@ -239,6 +239,22 @@ process_line (const char *line)
gtk_window_present (GTK_WINDOW (window)); gtk_window_present (GTK_WINDOW (window));
} }
else if (strcmp (argv[0], "resize") == 0)
{
if (argc != 4)
{
g_print ("usage: resize <id> <width> <height>");
goto out;
}
GtkWidget *window = lookup_window (argv[1]);
if (!window)
goto out;
int width = atoi (argv[2]);
int height = atoi (argv[3]);
gtk_window_resize (GTK_WINDOW (window), width, height);
}
else if (strcmp (argv[0], "raise") == 0) else if (strcmp (argv[0], "raise") == 0)
{ {
if (argc != 2) if (argc != 2)