diff options
author | Jonas Ådahl <jadahl@gmail.com> | 2020-04-02 16:05:54 +0200 |
---|---|---|
committer | Jonas Ådahl <jadahl@gmail.com> | 2020-04-15 15:59:12 +0200 |
commit | b7ad1fb08637be9eecd1d59810a7949bfc6866de (patch) | |
tree | 6d5a496f0002889cbd3dfd85d3a3bf679bad1c57 | |
parent | d812cecc44dff4e49cfa1924558143c6f8fdf460 (diff) | |
download | mutter-b7ad1fb08637be9eecd1d59810a7949bfc6866de.tar.gz |
tests/test-client: Remove shadow from X11 test client CSS style
Gtk is quite buggy and "fluid" in how it handles the shadow margins for
windows under X11. The "size" of the window fluctuate between including and
excluding a shadow margin in a way that causes issues, as there are no
atomic update of any state going on.
In order to avoid running into those particular issues now, lets get rid
of shadows so the margins are always zero, when the client is using the
X11 backend.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1171
-rw-r--r-- | src/tests/test-client.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/tests/test-client.c b/src/tests/test-client.c index 2c19d9a36..8b37a4225 100644 --- a/src/tests/test-client.c +++ b/src/tests/test-client.c @@ -813,6 +813,32 @@ main(int argc, char **argv) gtk_init (NULL, NULL); + if (!wayland) + { + 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); + } + windows = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); event_source_quark = g_quark_from_static_string ("event-source"); |