From fedeb51f3116914bee5a2993c4a9d7eea390210a Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 13 Sep 2020 22:44:32 -0400 Subject: [PATCH] Drop support for GTK_TEST_TOUCHSCREEN This environment variable is undocumented, and you can just use GTK_DEBUG=touchscreen insead. --- gtk/gtkmain.c | 9 ++------- gtk/inspector/visual.c | 11 ----------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c index 8bb10a28ac..8a9a0b12e8 100644 --- a/gtk/gtkmain.c +++ b/gtk/gtkmain.c @@ -623,13 +623,8 @@ gtk_set_debug_flags (GtkDebugFlags flags) gboolean gtk_simulate_touchscreen (void) { - static int test_touchscreen; - - if (test_touchscreen == 0) - test_touchscreen = g_getenv ("GTK_TEST_TOUCHSCREEN") != NULL ? 1 : -1; - - return test_touchscreen > 0 || (gtk_get_debug_flags () & GTK_DEBUG_TOUCHSCREEN) != 0; - } + return (gtk_get_debug_flags () & GTK_DEBUG_TOUCHSCREEN) != 0; +} #ifdef G_PLATFORM_WIN32 #undef gtk_init_check diff --git a/gtk/inspector/visual.c b/gtk/inspector/visual.c index aa34b753b8..7a03df3781 100644 --- a/gtk/inspector/visual.c +++ b/gtk/inspector/visual.c @@ -919,17 +919,6 @@ init_touchscreen (GtkInspectorVisual *vis) gtk_switch_set_active (GTK_SWITCH (vis->touchscreen_switch), (gtk_get_debug_flags () & GTK_DEBUG_TOUCHSCREEN) != 0); g_signal_connect (vis->touchscreen_switch, "notify::active", G_CALLBACK (update_touchscreen), NULL); - - if (g_getenv ("GTK_TEST_TOUCHSCREEN") != 0) - { - GtkWidget *row; - - /* hardcoded, nothing we can do */ - gtk_switch_set_active (GTK_SWITCH (vis->touchscreen_switch), TRUE); - gtk_widget_set_sensitive (vis->touchscreen_switch, FALSE); - row = gtk_widget_get_ancestor (vis->touchscreen_switch, GTK_TYPE_LIST_BOX_ROW); - gtk_widget_set_tooltip_text (row, _("Setting is hardcoded by GTK_TEST_TOUCHSCREEN")); - } } static gboolean