Drop support for GTK_TEST_TOUCHSCREEN

This environment variable is undocumented, and you can
just use GTK_DEBUG=touchscreen insead.
This commit is contained in:
Matthias Clasen 2020-09-13 22:44:32 -04:00
parent d2faa38eed
commit fedeb51f31
2 changed files with 2 additions and 18 deletions

View File

@ -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

View File

@ -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