`no-css-cache`
: Bypass caching for CSS style properties
-`touchscreen`
-: Pretend the pointer is a touchscreen device
-
`snapshot`
: Include debug render nodes in the generated snapshots
* @GTK_DEBUG_SIZE_REQUEST: Information about size requests
* @GTK_DEBUG_NO_CSS_CACHE: Disable the style property cache
* @GTK_DEBUG_INTERACTIVE: Open the GTK inspector
- * @GTK_DEBUG_TOUCHSCREEN: Pretend the pointer is a touchscreen
* @GTK_DEBUG_ACTIONS: Information about actions and menu models
* @GTK_DEBUG_LAYOUT: Information from layout managers
* @GTK_DEBUG_SNAPSHOT: Include debug render nodes in the generated snapshots
GTK_DEBUG_SIZE_REQUEST = 1 << 8,
GTK_DEBUG_NO_CSS_CACHE = 1 << 9,
GTK_DEBUG_INTERACTIVE = 1 << 10,
- GTK_DEBUG_TOUCHSCREEN = 1 << 11,
GTK_DEBUG_ACTIONS = 1 << 12,
GTK_DEBUG_LAYOUT = 1 << 13,
GTK_DEBUG_SNAPSHOT = 1 << 14,
GdkDevice *source_device;
GdkInputSource source;
guint button = 0, state, i;
- gboolean retval, test_touchscreen = FALSE;
+ gboolean retval;
GdkEventType event_type;
source_device = gdk_event_get_device (event);
priv = gtk_gesture_single_get_instance_private (GTK_GESTURE_SINGLE (controller));
source = gdk_device_get_source (source_device);
- if (source != GDK_SOURCE_TOUCHSCREEN)
- test_touchscreen = gtk_simulate_touchscreen ();
-
event_type = gdk_event_get_event_type (event);
switch ((guint) event_type)
break;
case GDK_BUTTON_PRESS:
case GDK_BUTTON_RELEASE:
- if (priv->touch_only && !test_touchscreen && source != GDK_SOURCE_TOUCHSCREEN)
+ if (priv->touch_only && source != GDK_SOURCE_TOUCHSCREEN)
return FALSE;
button = gdk_button_event_get_button (event);
case GDK_MOTION_NOTIFY:
if (!gtk_gesture_handles_sequence (GTK_GESTURE (controller), sequence))
return FALSE;
- if (priv->touch_only && !test_touchscreen && source != GDK_SOURCE_TOUCHSCREEN)
+ if (priv->touch_only && source != GDK_SOURCE_TOUCHSCREEN)
return FALSE;
state = gdk_event_get_modifier_state (event);
gtk_set_display_debug_flags (gdk_display_get_default (), flags);
}
-gboolean
-gtk_simulate_touchscreen (void)
-{
- return (gtk_get_debug_flags () & GTK_DEBUG_TOUCHSCREEN) != 0;
-}
-
static const GdkDebugKey gtk_debug_keys[] = {
{ "keybindings", GTK_DEBUG_KEYBINDINGS, "Information about keyboard shortcuts" },
{ "modules", GTK_DEBUG_MODULES, "Information about modules and extensions" },
{ "builder-objects", GTK_DEBUG_BUILDER_OBJECTS, "Log unused GtkBuilder objects" },
{ "no-css-cache", GTK_DEBUG_NO_CSS_CACHE, "Disable style property cache" },
{ "interactive", GTK_DEBUG_INTERACTIVE, "Enable the GTK inspector", TRUE },
- { "touchscreen", GTK_DEBUG_TOUCHSCREEN, "Pretend the pointer is a touchscreen" },
{ "snapshot", GTK_DEBUG_SNAPSHOT, "Generate debug render nodes" },
{ "accessibility", GTK_DEBUG_A11Y, "Information about accessibility state changes" },
{ "iconfallback", GTK_DEBUG_ICONFALLBACK, "Information about icon fallback" },
void _gtk_load_dll_with_libgtk3_manifest (const char *dllname);
#endif
-gboolean gtk_simulate_touchscreen (void);
-
void gtk_set_display_debug_flags (GdkDisplay *display,
GtkDebugFlags flags);
GtkDebugFlags gtk_get_display_debug_flags (GdkDisplay *display);
have_selection = sel_start != sel_end;
source = gdk_event_get_device (event);
- is_touchscreen = gtk_simulate_touchscreen () ||
- gdk_device_get_source (source) == GDK_SOURCE_TOUCHSCREEN;
+ is_touchscreen = gdk_device_get_source (source) == GDK_SOURCE_TOUCHSCREEN;
priv->text_handles_enabled = is_touchscreen;
gtk_text_set_positions (self, pos, bound);
/* Update touch handles' position */
- if (gtk_simulate_touchscreen () ||
- input_source == GDK_SOURCE_TOUCHSCREEN)
+ if (input_source == GDK_SOURCE_TOUCHSCREEN)
{
priv->text_handles_enabled = TRUE;
gtk_text_update_handles (self);
gtk_text_view_reset_blink_time (text_view);
device = gdk_event_get_device ((GdkEvent *) event);
- is_touchscreen = gtk_simulate_touchscreen () ||
- gdk_device_get_source (device) == GDK_SOURCE_TOUCHSCREEN;
+ is_touchscreen = gdk_device_get_source (device) == GDK_SOURCE_TOUCHSCREEN;
if (n_press == 1)
{
device = gdk_event_get_device (event);
- is_touchscreen = gtk_simulate_touchscreen () ||
- gdk_device_get_source (device) == GDK_SOURCE_TOUCHSCREEN;
+ is_touchscreen = gdk_device_get_source (device) == GDK_SOURCE_TOUCHSCREEN;
get_iter_from_gesture (text_view, text_view->priv->drag_gesture,
&cursor, NULL, NULL);
event = gtk_gesture_get_last_event (GTK_GESTURE (gesture), sequence);
device = gdk_event_get_device (event);
- is_touchscreen = gtk_simulate_touchscreen () ||
- gdk_device_get_source (device) == GDK_SOURCE_TOUCHSCREEN;
+ is_touchscreen = gdk_device_get_source (device) == GDK_SOURCE_TOUCHSCREEN;
if ((is_touchscreen || clicked_in_selection) &&
!gtk_drag_check_threshold_double (GTK_WIDGET (text_view), 0, 0, offset_x, offset_y))
GtkWidget *focus_switch;
GtkWidget *a11y_switch;
- GtkWidget *misc_box;
- GtkWidget *touchscreen_switch;
-
GtkInspectorOverlay *fps_overlay;
GtkInspectorOverlay *updates_overlay;
GtkInspectorOverlay *layout_overlay;
G_CALLBACK (slowdown_entry_activated), vis);
}
-static void
-update_touchscreen (GtkSwitch *sw)
-{
- GtkDebugFlags flags;
-
- flags = gtk_get_debug_flags ();
-
- if (gtk_switch_get_active (sw))
- flags |= GTK_DEBUG_TOUCHSCREEN;
- else
- flags &= ~GTK_DEBUG_TOUCHSCREEN;
-
- gtk_set_debug_flags (flags);
-}
-
-static void
-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);
-}
-
static gboolean
keynav_failed (GtkWidget *widget, GtkDirectionType direction, GtkInspectorVisual *vis)
{
if (direction == GTK_DIR_DOWN &&
widget == vis->visual_box)
next = vis->debug_box;
- else if (direction == GTK_DIR_DOWN &&
- widget == vis->debug_box)
- next = vis->misc_box;
else if (direction == GTK_DIR_UP &&
widget == vis->debug_box)
next = vis->visual_box;
- else if (direction == GTK_DIR_UP &&
- widget == vis->misc_box)
- next = vis->debug_box;
else
next = NULL;
GtkSwitch *sw = GTK_SWITCH (vis->focus_switch);
gtk_switch_set_active (sw, !gtk_switch_get_active (sw));
}
- else if (gtk_widget_is_ancestor (vis->touchscreen_switch, GTK_WIDGET (row)))
- {
- GtkSwitch *sw = GTK_SWITCH (vis->touchscreen_switch);
- gtk_switch_set_active (sw, !gtk_switch_get_active (sw));
- }
else if (gtk_widget_is_ancestor (vis->a11y_switch, GTK_WIDGET (row)))
{
GtkSwitch *sw = GTK_SWITCH (vis->a11y_switch);
g_signal_connect (vis->visual_box, "keynav-failed", G_CALLBACK (keynav_failed), vis);
g_signal_connect (vis->debug_box, "keynav-failed", G_CALLBACK (keynav_failed), vis);
- g_signal_connect (vis->misc_box, "keynav-failed", G_CALLBACK (keynav_failed), vis);
g_signal_connect (vis->visual_box, "row-activated", G_CALLBACK (row_activated), vis);
g_signal_connect (vis->debug_box, "row-activated", G_CALLBACK (row_activated), vis);
- g_signal_connect (vis->misc_box, "row-activated", G_CALLBACK (row_activated), vis);
}
static void
gtk_widget_class_bind_template_child (widget_class, GtkInspectorVisual, animation_switch);
gtk_widget_class_bind_template_child (widget_class, GtkInspectorVisual, slowdown_adjustment);
gtk_widget_class_bind_template_child (widget_class, GtkInspectorVisual, slowdown_entry);
- gtk_widget_class_bind_template_child (widget_class, GtkInspectorVisual, touchscreen_switch);
gtk_widget_class_bind_template_child (widget_class, GtkInspectorVisual, visual_box);
gtk_widget_class_bind_template_child (widget_class, GtkInspectorVisual, debug_box);
gtk_widget_class_bind_template_child (widget_class, GtkInspectorVisual, font_button);
- gtk_widget_class_bind_template_child (widget_class, GtkInspectorVisual, misc_box);
gtk_widget_class_bind_template_child (widget_class, GtkInspectorVisual, font_scale_entry);
gtk_widget_class_bind_template_child (widget_class, GtkInspectorVisual, font_scale_adjustment);
gtk_widget_class_bind_template_child (widget_class, GtkInspectorVisual, fps_switch);
init_scale (vis);
init_animation (vis);
init_slowdown (vis);
- init_touchscreen (vis);
init_gl (vis);
}
</child>
</object>
</child>
- <child>
- <object class="GtkListBox" id="misc_box">
- <property name="selection-mode">none</property>
- <property name="halign">center</property>
- <style>
- <class name="rich-list"/>
- <class name="boxed-list"/>
- </style>
- <child>
- <object class="GtkListBoxRow">
- <child>
- <object class="GtkBox">
- <property name="spacing">40</property>
- <child>
- <object class="GtkLabel" id="touchscreen_label">
- <property name="label" translatable="yes">Simulate Touchscreen</property>
- <property name="halign">start</property>
- <property name="valign">baseline</property>
- <property name="xalign">0.0</property>
- </object>
- </child>
- <child>
- <object class="GtkSwitch" id="touchscreen_switch">
- <property name="halign">end</property>
- <property name="valign">center</property>
- <property name="hexpand">1</property>
- </object>
- </child>
- </object>
- </child>
- </object>
- </child>
- </object>
- </child>
<child>
<object class="GtkListBox" id="inspector_box">
<property name="selection-mode">none</property>
<widgets>
<widget name="visual_box"/>
<widget name="debug_box"/>
- <widget name="misc_box"/>
<widget name="inspector_box"/>
</widgets>
</object>