From 7b45de941b56b506e4b676cf05b5ba24d9524247 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Fri, 5 Jun 2020 00:07:48 +0200 Subject: [PATCH] tests/test-client: Disable shadow for Wayland client too The shadow was disabled for the X11 client as it was far to unreliable when comparing sizes. It seems that the Wayland backend has been somewhat unreliable as well, where some race condition causing incorrect sizes thus a flaky test. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1288 --- src/tests/test-client.c | 42 +++++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/src/tests/test-client.c b/src/tests/test-client.c index 134d9b465..81ce51ab6 100644 --- a/src/tests/test-client.c +++ b/src/tests/test-client.c @@ -858,6 +858,8 @@ int main(int argc, char **argv) { GOptionContext *context = g_option_context_new (NULL); + GdkScreen *screen; + GtkCssProvider *provider; GError *error = NULL; g_option_context_add_main_entries (context, options, NULL); @@ -876,31 +878,25 @@ main(int argc, char **argv) gtk_init (NULL, NULL); - if (!wayland) + screen = gdk_screen_get_default (); + provider = gtk_css_provider_new (); + static const char *no_decoration_css = + "decoration {" + " border-radius: 0 0 0 0;" + " border-width: 0;" + " box-shadow: 0 0 0 0 rgba(0, 0, 0, 0), 0 0 0 0 rgba(0, 0, 0, 0);" + " margin: 0px;" + "}"; + if (!gtk_css_provider_load_from_data (provider, + no_decoration_css, + strlen (no_decoration_css), + &error)) { - GdkScreen *screen; - GtkCssProvider *provider; - - screen = gdk_screen_get_default (); - provider = gtk_css_provider_new (); - static const char *no_decoration_css = - "decoration {" - " border-radius: 0 0 0 0;" - " border-width: 0;" - " box-shadow: 0 0 0 0 rgba(0, 0, 0, 0), 0 0 0 0 rgba(0, 0, 0, 0);" - " margin: 0px;" - "}"; - if (!gtk_css_provider_load_from_data (provider, - no_decoration_css, - strlen (no_decoration_css), - &error)) - { - g_printerr ("%s", error->message); - return 1; - } - gtk_style_context_add_provider_for_screen (screen, GTK_STYLE_PROVIDER (provider), - GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); + g_printerr ("%s", error->message); + return 1; } + gtk_style_context_add_provider_for_screen (screen, GTK_STYLE_PROVIDER (provider), + GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); windows = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);