summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-01-05 11:15:33 -0500
committerMatthias Clasen <mclasen@redhat.com>2021-01-05 11:15:33 -0500
commit56af472cfc275adf6cd273db772ee7cafd9b284a (patch)
treea271a7c25897c35b389b61d6d1a9698608fe38a1
parentd1fcfa58b9319d8ec75b2fb99eba4ff90f0e801e (diff)
downloadgtk+-56af472cfc275adf6cd273db772ee7cafd9b284a.tar.gz
a11y: Only spew help once
Make GTK_A11Y=help only spew once, and avoid a warning when we do.
-rw-r--r--gtk/gtkatcontext.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/gtk/gtkatcontext.c b/gtk/gtkatcontext.c
index 5866a2f279..87aa892dc2 100644
--- a/gtk/gtkatcontext.c
+++ b/gtk/gtkatcontext.c
@@ -541,25 +541,27 @@ gtk_at_context_create (GtkAccessibleRole accessible_role,
gtk_a11y_env = g_getenv ("GTK_A11Y");
if (gtk_a11y_env == NULL)
gtk_a11y_env = "0";
- }
- /* Short-circuit disabling the accessibility support */
- if (g_ascii_strcasecmp (gtk_a11y_env, "none") == 0)
- return NULL;
-
- if (g_ascii_strcasecmp (gtk_a11y_env, "help") == 0)
- {
- g_print ("Supported arguments for GTK_A11Y environment variable:\n");
+ if (g_ascii_strcasecmp (gtk_a11y_env, "help") == 0)
+ {
+ g_print ("Supported arguments for GTK_A11Y environment variable:\n");
#if defined(GDK_WINDOWING_X11) || defined(GDK_WINDOWING_WAYLAND)
- g_print (" atspi - Use the AT-SPI accessibility backend\n");
+ g_print (" atspi - Use the AT-SPI accessibility backend\n");
#endif
- g_print (" test - Use the test accessibility backend\n");
- g_print (" none - Disable the accessibility backend\n");
- g_print (" help - Print this help\n\n");
- g_print ("Other arguments will cause a warning and be ignored.\n");
+ g_print (" test - Use the test accessibility backend\n");
+ g_print (" none - Disable the accessibility backend\n");
+ g_print (" help - Print this help\n\n");
+ g_print ("Other arguments will cause a warning and be ignored.\n");
+
+ gtk_a11y_env = "0";
+ }
}
+ /* Short-circuit disabling the accessibility support */
+ if (g_ascii_strcasecmp (gtk_a11y_env, "none") == 0)
+ return NULL;
+
GtkATContext *res = NULL;
for (guint i = 0; i < G_N_ELEMENTS (a11y_backends); i++)