scrolledwindow: Show scrollbars on tablet devices
authorCarlos Garnacho <carlosg@gnome.org>
Mon, 13 Apr 2015 13:29:57 +0000 (15:29 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Mon, 13 Apr 2015 15:27:04 +0000 (17:27 +0200)
The code managing scrollbars visibility was too pervasively checking for
mouse devices, leaving pen/eraser/cursor devices with no scrollbars at
all. Relax these checks a bit, and actually toggle full-width scrollbars
on pen/eraser devices, so it is an easier target.

https://bugzilla.gnome.org/show_bug.cgi?id=747608

gtk/gtkscrolledwindow.c

index b3e66b14aaffe501a5e352e425448bad651dfb3b..031d19881afe56d9789197a616bd3171ed77d8fb 100644 (file)
@@ -1125,8 +1125,8 @@ captured_event_cb (GtkWidget *widget,
   source_device = gdk_event_get_source_device (event);
   input_source = gdk_device_get_source (source_device);
 
-  if (input_source != GDK_SOURCE_MOUSE &&
-      input_source != GDK_SOURCE_TOUCHPAD)
+  if (input_source == GDK_SOURCE_KEYBOARD ||
+      input_source == GDK_SOURCE_TOUCHSCREEN)
     return GDK_EVENT_PROPAGATE;
 
   event_widget = gtk_get_event_widget (event);
@@ -1147,7 +1147,9 @@ captured_event_cb (GtkWidget *widget,
           indicator_set_over (&priv->hindicator, FALSE);
           indicator_set_over (&priv->vindicator, FALSE);
         }
-      else if (strstr (gdk_device_get_name (source_device), "TrackPoint") ||
+      else if (input_source == GDK_SOURCE_PEN ||
+               input_source == GDK_SOURCE_ERASER ||
+               strstr (gdk_device_get_name (source_device), "TrackPoint") ||
                strstr (gdk_device_get_name (source_device), "DualPoint Stick"))
         {
           indicator_set_over (&priv->hindicator, TRUE);