[gtk/wip/carlosg/more-device-api-cleanup: 6/7] gdk: Drop gdk_device_get_device_type()




commit ca763b4c82abdbfefeccc82d1dcebb84c3efb6fa
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu Jul 30 17:46:49 2020 +0200

    gdk: Drop gdk_device_get_device_type()
    
    There is no longer a hierarchy of devices, or none that is seen
    on the outside.

 docs/reference/gdk/gdk4-sections.txt |  1 -
 gdk/broadway/gdkdisplay-broadway.c   |  5 ---
 gdk/gdkdevice.c                      | 82 ++----------------------------------
 gdk/gdkdevice.h                      | 20 ---------
 gdk/gdkdeviceprivate.h               |  1 -
 gdk/gdkdisplay.c                     |  7 +--
 gdk/gdksurface.c                     |  2 -
 gdk/macos/gdkmacosseat.c             |  2 -
 gdk/wayland/gdkdevice-wayland.c      | 12 ------
 gdk/win32/gdkdevicemanager-win32.c   | 13 +++---
 testsuite/gdk/seat.c                 |  4 --
 11 files changed, 10 insertions(+), 139 deletions(-)
---
diff --git a/docs/reference/gdk/gdk4-sections.txt b/docs/reference/gdk/gdk4-sections.txt
index 2727123fc5..e25321cc23 100644
--- a/docs/reference/gdk/gdk4-sections.txt
+++ b/docs/reference/gdk/gdk4-sections.txt
@@ -352,7 +352,6 @@ gdk_device_get_name
 gdk_device_get_vendor_id
 gdk_device_get_product_id
 gdk_device_get_source
-gdk_device_get_device_type
 gdk_device_get_display
 gdk_device_get_has_cursor
 gdk_device_get_seat
diff --git a/gdk/broadway/gdkdisplay-broadway.c b/gdk/broadway/gdkdisplay-broadway.c
index 5b406e3e15..3f881426eb 100644
--- a/gdk/broadway/gdkdisplay-broadway.c
+++ b/gdk/broadway/gdkdisplay-broadway.c
@@ -119,7 +119,6 @@ create_core_pointer (GdkDisplay *display)
 {
   return g_object_new (GDK_TYPE_BROADWAY_DEVICE,
                        "name", "Core Pointer",
-                       "type", GDK_DEVICE_TYPE_LOGICAL,
                        "source", GDK_SOURCE_MOUSE,
                        "has-cursor", TRUE,
                        "display", display,
@@ -131,7 +130,6 @@ create_core_keyboard (GdkDisplay *display)
 {
   return g_object_new (GDK_TYPE_BROADWAY_DEVICE,
                        "name", "Core Keyboard",
-                       "type", GDK_DEVICE_TYPE_LOGICAL,
                        "source", GDK_SOURCE_KEYBOARD,
                        "has-cursor", FALSE,
                        "display", display,
@@ -143,7 +141,6 @@ create_pointer (GdkDisplay *display)
 {
   return g_object_new (GDK_TYPE_BROADWAY_DEVICE,
                        "name", "Pointer",
-                       "type", GDK_DEVICE_TYPE_PHYSICAL,
                        "source", GDK_SOURCE_MOUSE,
                        "has-cursor", TRUE,
                        "display", display,
@@ -155,7 +152,6 @@ create_keyboard (GdkDisplay *display)
 {
   return g_object_new (GDK_TYPE_BROADWAY_DEVICE,
                        "name", "Keyboard",
-                       "type", GDK_DEVICE_TYPE_PHYSICAL,
                        "source", GDK_SOURCE_KEYBOARD,
                        "has-cursor", FALSE,
                        "display", display,
@@ -167,7 +163,6 @@ create_touchscreen (GdkDisplay *display)
 {
   return g_object_new (GDK_TYPE_BROADWAY_DEVICE,
                        "name", "Touchscreen",
-                       "type", GDK_DEVICE_TYPE_PHYSICAL,
                        "source", GDK_SOURCE_TOUCHSCREEN,
                        "has-cursor", FALSE,
                        "display", display,
diff --git a/gdk/gdkdevice.c b/gdk/gdkdevice.c
index dabefc992d..3dbc4ec2c4 100644
--- a/gdk/gdkdevice.c
+++ b/gdk/gdkdevice.c
@@ -86,7 +86,6 @@ enum {
   PROP_0,
   PROP_DISPLAY,
   PROP_NAME,
-  PROP_TYPE,
   PROP_SOURCE,
   PROP_HAS_CURSOR,
   PROP_N_AXES,
@@ -140,19 +139,6 @@ gdk_device_class_init (GdkDeviceClass *klass)
                            NULL,
                            G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
                            G_PARAM_STATIC_STRINGS);
-  /**
-   * GdkDevice:type:
-   *
-   * Device role in the device manager.
-   */
-  device_props[PROP_TYPE] =
-      g_param_spec_enum ("type",
-                         P_("Device type"),
-                         P_("Device role in the device manager"),
-                         GDK_TYPE_DEVICE_TYPE,
-                         GDK_DEVICE_TYPE_LOGICAL,
-                         G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
-                         G_PARAM_STATIC_STRINGS);
 
   /**
    * GdkDevice:source:
@@ -171,8 +157,7 @@ gdk_device_class_init (GdkDeviceClass *klass)
   /**
    * GdkDevice:has-cursor:
    *
-   * Whether the device is represented by a cursor on the screen. Devices of type
-   * %GDK_DEVICE_TYPE_LOGICAL will have %TRUE here.
+   * Whether the device is represented by a cursor on the screen.
    */
   device_props[PROP_HAS_CURSOR] =
       g_param_spec_boolean ("has-cursor",
@@ -368,15 +353,14 @@ gdk_device_dispose (GObject *object)
   GdkDevice *device = GDK_DEVICE (object);
   GdkDevice *associated = device->associated;
 
-  if (associated && device->type == GDK_DEVICE_TYPE_PHYSICAL)
+  if (associated)
     _gdk_device_remove_physical_device (associated, device);
 
   if (associated)
     {
       device->associated = NULL;
 
-      if (device->type == GDK_DEVICE_TYPE_LOGICAL &&
-          associated->associated == device)
+      if (associated->associated == device)
         _gdk_device_set_associated_device (associated, NULL);
 
       g_object_unref (associated);
@@ -405,9 +389,6 @@ gdk_device_set_property (GObject      *object,
 
       device->name = g_value_dup_string (value);
       break;
-    case PROP_TYPE:
-      device->type = g_value_get_enum (value);
-      break;
     case PROP_SOURCE:
       device->source = g_value_get_enum (value);
       break;
@@ -448,9 +429,6 @@ gdk_device_get_property (GObject    *object,
     case PROP_NAME:
       g_value_set_string (value, device->name);
       break;
-    case PROP_TYPE:
-      g_value_set_enum (value, device->type);
-      break;
     case PROP_SOURCE:
       g_value_set_enum (value, device->source);
       break;
@@ -514,8 +492,6 @@ gdk_device_get_position (GdkDevice *device,
 {
   g_return_if_fail (GDK_IS_DEVICE (device));
   g_return_if_fail (device->source != GDK_SOURCE_KEYBOARD);
-  g_return_if_fail (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_PHYSICAL ||
-                    gdk_display_device_is_grabbed (gdk_device_get_display (device), device));
 
   _gdk_device_query_state (device, NULL, NULL, x, y, NULL);
 }
@@ -532,10 +508,6 @@ gdk_device_get_position (GdkDevice *device,
  * double precision. Returns %NULL if the surface tree under @device is not known to GDK (for example,
  * belongs to another application).
  *
- * As a physical device coordinates are those of its logical pointer, this
- * function may not be called on devices of type %GDK_DEVICE_TYPE_PHYSICAL,
- * unless there is an ongoing grab on them, see gdk_seat_grab().
- *
  * Returns: (nullable) (transfer none): the #GdkSurface under the
  *   device position, or %NULL.
  **/
@@ -549,8 +521,6 @@ gdk_device_get_surface_at_position (GdkDevice *device,
 
   g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
   g_return_val_if_fail (device->source != GDK_SOURCE_KEYBOARD, NULL);
-  g_return_val_if_fail (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_PHYSICAL ||
-                        gdk_display_device_is_grabbed (gdk_device_get_display (device), device), NULL);
 
   surface = _gdk_device_surface_at_position (device, &tmp_x, &tmp_y, NULL);
 
@@ -652,18 +622,6 @@ gdk_device_get_display (GdkDevice *device)
   return device->display;
 }
 
-static void
-_gdk_device_set_device_type (GdkDevice     *device,
-                             GdkDeviceType  type)
-{
-  if (device->type != type)
-    {
-      device->type = type;
-
-      g_object_notify_by_pspec (G_OBJECT (device), device_props[PROP_TYPE]);
-    }
-}
-
 void
 _gdk_device_set_associated_device (GdkDevice *device,
                                    GdkDevice *associated)
@@ -682,14 +640,6 @@ _gdk_device_set_associated_device (GdkDevice *device,
 
   if (associated)
     device->associated = g_object_ref (associated);
-
-  if (device->type != GDK_DEVICE_TYPE_LOGICAL)
-    {
-      if (device->associated)
-        _gdk_device_set_device_type (device, GDK_DEVICE_TYPE_PHYSICAL);
-      else
-        _gdk_device_set_device_type (device, GDK_DEVICE_TYPE_FLOATING);
-    }
 }
 
 /**
@@ -706,7 +656,6 @@ GList *
 gdk_device_list_physical_devices (GdkDevice *device)
 {
   g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
-  g_return_val_if_fail (gdk_device_get_device_type (device) == GDK_DEVICE_TYPE_LOGICAL, NULL);
 
   return g_list_copy (device->physical_devices);
 }
@@ -715,9 +664,6 @@ void
 _gdk_device_add_physical_device (GdkDevice *device,
                                  GdkDevice *physical)
 {
-  g_return_if_fail (gdk_device_get_device_type (device) == GDK_DEVICE_TYPE_LOGICAL);
-  g_return_if_fail (gdk_device_get_device_type (physical) != GDK_DEVICE_TYPE_LOGICAL);
-
   if (!g_list_find (device->physical_devices, physical))
     device->physical_devices = g_list_prepend (device->physical_devices, physical);
 }
@@ -728,9 +674,6 @@ _gdk_device_remove_physical_device (GdkDevice *device,
 {
   GList *elem;
 
-  g_return_if_fail (gdk_device_get_device_type (device) == GDK_DEVICE_TYPE_LOGICAL);
-  g_return_if_fail (gdk_device_get_device_type (physical) != GDK_DEVICE_TYPE_LOGICAL);
-
   elem = g_list_find (device->physical_devices, physical);
   if (elem == NULL)
     return;
@@ -738,22 +681,6 @@ _gdk_device_remove_physical_device (GdkDevice *device,
   device->physical_devices = g_list_delete_link (device->physical_devices, elem);
 }
 
-/**
- * gdk_device_get_device_type:
- * @device: a #GdkDevice
- *
- * Returns the device type for @device.
- *
- * Returns: the #GdkDeviceType for @device.
- **/
-GdkDeviceType
-gdk_device_get_device_type (GdkDevice *device)
-{
-  g_return_val_if_fail (GDK_IS_DEVICE (device), GDK_DEVICE_TYPE_LOGICAL);
-
-  return device->type;
-}
-
 /**
  * gdk_device_get_n_axes:
  * @device: a pointer #GdkDevice
@@ -1225,7 +1152,6 @@ const char *
 gdk_device_get_vendor_id (GdkDevice *device)
 {
   g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
-  g_return_val_if_fail (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_LOGICAL, NULL);
 
   return device->vendor_id;
 }
@@ -1244,7 +1170,6 @@ const char *
 gdk_device_get_product_id (GdkDevice *device)
 {
   g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
-  g_return_val_if_fail (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_LOGICAL, NULL);
 
   return device->product_id;
 }
@@ -1285,7 +1210,6 @@ gdk_device_update_tool (GdkDevice     *device,
                         GdkDeviceTool *tool)
 {
   g_return_if_fail (GDK_IS_DEVICE (device));
-  g_return_if_fail (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_LOGICAL);
 
   if (g_set_object (&device->last_tool, tool))
     {
diff --git a/gdk/gdkdevice.h b/gdk/gdkdevice.h
index 1c7d390868..9501041aa7 100644
--- a/gdk/gdkdevice.h
+++ b/gdk/gdkdevice.h
@@ -62,23 +62,6 @@ typedef enum
   GDK_SOURCE_TABLET_PAD
 } GdkInputSource;
 
-/**
- * GdkDeviceType:
- * @GDK_DEVICE_TYPE_LOGICAL: Device is a logical device. There will
- *   be an associated focus indicator on the screen.
- * @GDK_DEVICE_TYPE_PHYSICAL: Device is a physical device.
- * @GDK_DEVICE_TYPE_FLOATING: Device is a physical device, currently
- *   not attached to any seat.
- *
- * Indicates the device type.
- */
-typedef enum {
-  GDK_DEVICE_TYPE_LOGICAL,
-  GDK_DEVICE_TYPE_PHYSICAL,
-  GDK_DEVICE_TYPE_FLOATING
-} GdkDeviceType;
-
-
 /**
  * GdkTimeCoord:
  * @time: The timestamp for this event.
@@ -114,9 +97,6 @@ GdkSurface * gdk_device_get_surface_at_position (GdkDevice *device,
 GDK_AVAILABLE_IN_ALL
 GdkDisplay * gdk_device_get_display (GdkDevice      *device);
 
-GDK_AVAILABLE_IN_ALL
-GdkDeviceType gdk_device_get_device_type (GdkDevice *device);
-
 GDK_AVAILABLE_IN_ALL
 const char *gdk_device_get_vendor_id       (GdkDevice *device);
 GDK_AVAILABLE_IN_ALL
diff --git a/gdk/gdkdeviceprivate.h b/gdk/gdkdeviceprivate.h
index 1c802be7e4..c2d49fe068 100644
--- a/gdk/gdkdeviceprivate.h
+++ b/gdk/gdkdeviceprivate.h
@@ -39,7 +39,6 @@ struct _GdkDevice
   char *name;
   GdkInputSource source;
   gboolean has_cursor;
-  GdkDeviceType type;
   GdkDisplay *display;
   /* The paired logical device for logical devices,
    * or the associated logical device for physical ones
diff --git a/gdk/gdkdisplay.c b/gdk/gdkdisplay.c
index 14abf69c73..c24d1216be 100644
--- a/gdk/gdkdisplay.c
+++ b/gdk/gdkdisplay.c
@@ -639,12 +639,7 @@ switch_to_pointer_grab (GdkDisplay        *display,
       if (grab == NULL /* ungrab */ ||
          (!last_grab->owner_events && grab->owner_events) /* switched to owner_events */ )
        {
-          /* Ungrabbed physical devices don't have a position by
-           * itself, rather depend on its logical pointer, so
-           * it doesn't make sense to track any position for
-           * these after the grab
-           */
-          if (grab || gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_PHYSICAL)
+          if (grab)
             new_toplevel = get_current_toplevel (display, device, &x, &y, &state);
 
          if (new_toplevel)
diff --git a/gdk/gdksurface.c b/gdk/gdksurface.c
index 944b34ab4d..6cbbe391ee 100644
--- a/gdk/gdksurface.c
+++ b/gdk/gdksurface.c
@@ -1840,7 +1840,6 @@ gdk_surface_get_device_cursor (GdkSurface *surface,
   g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
   g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
   g_return_val_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD, NULL);
-  g_return_val_if_fail (gdk_device_get_device_type (device) == GDK_DEVICE_TYPE_LOGICAL, NULL);
 
   return g_hash_table_lookup (surface->device_cursor, device);
 }
@@ -1866,7 +1865,6 @@ gdk_surface_set_device_cursor (GdkSurface *surface,
   g_return_if_fail (GDK_IS_SURFACE (surface));
   g_return_if_fail (GDK_IS_DEVICE (device));
   g_return_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD);
-  g_return_if_fail (gdk_device_get_device_type (device) == GDK_DEVICE_TYPE_LOGICAL);
 
   if (!cursor)
     g_hash_table_remove (surface->device_cursor, device);
diff --git a/gdk/macos/gdkmacosseat.c b/gdk/macos/gdkmacosseat.c
index cb3c3747e1..e239c6cb3c 100644
--- a/gdk/macos/gdkmacosseat.c
+++ b/gdk/macos/gdkmacosseat.c
@@ -38,14 +38,12 @@ _gdk_macos_seat_new (GdkMacosDisplay *display)
 
   core_pointer = g_object_new (GDK_TYPE_MACOS_DEVICE,
                                "name", "Core Pointer",
-                               "type", GDK_DEVICE_TYPE_LOGICAL,
                                "source", GDK_SOURCE_MOUSE,
                                "has-cursor", TRUE,
                                "display", display,
                                NULL);
   core_keyboard = g_object_new (GDK_TYPE_MACOS_DEVICE,
                                 "name", "Core Keyboard",
-                                "type", GDK_DEVICE_TYPE_LOGICAL,
                                 "source", GDK_SOURCE_KEYBOARD,
                                 "has-cursor", FALSE,
                                 "display", display,
diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c
index d503f6cf93..bf04b19142 100644
--- a/gdk/wayland/gdkdevice-wayland.c
+++ b/gdk/wayland/gdkdevice-wayland.c
@@ -2823,7 +2823,6 @@ tablet_handle_done (void                 *data,
   logical_name = g_strdup_printf ("Logical pointer for %s", tablet->name);
   logical_device = g_object_new (GDK_TYPE_WAYLAND_DEVICE,
                                  "name", logical_name,
-                                 "type", GDK_DEVICE_TYPE_LOGICAL,
                                  "source", GDK_SOURCE_MOUSE,
                                  "has-cursor", TRUE,
                                  "display", display,
@@ -2833,7 +2832,6 @@ tablet_handle_done (void                 *data,
 
   stylus_device = g_object_new (GDK_TYPE_WAYLAND_DEVICE,
                                 "name", tablet->name,
-                                "type", GDK_DEVICE_TYPE_PHYSICAL,
                                 "source", GDK_SOURCE_PEN,
                                 "has-cursor", FALSE,
                                 "display", display,
@@ -2938,7 +2936,6 @@ seat_handle_capabilities (void                    *data,
 
       seat->pointer = g_object_new (GDK_TYPE_WAYLAND_DEVICE,
                                     "name", "Wayland Pointer",
-                                    "type", GDK_DEVICE_TYPE_PHYSICAL,
                                     "source", GDK_SOURCE_MOUSE,
                                     "has-cursor", TRUE,
                                     "display", seat->display,
@@ -3008,7 +3005,6 @@ seat_handle_capabilities (void                    *data,
 
       seat->keyboard = g_object_new (GDK_TYPE_WAYLAND_DEVICE,
                                      "name", "Wayland Keyboard",
-                                     "type", GDK_DEVICE_TYPE_PHYSICAL,
                                      "source", GDK_SOURCE_KEYBOARD,
                                      "has-cursor", FALSE,
                                      "display", seat->display,
@@ -3036,7 +3032,6 @@ seat_handle_capabilities (void                    *data,
 
       seat->logical_touch = g_object_new (GDK_TYPE_WAYLAND_DEVICE,
                                          "name", "Wayland Touch Logical Pointer",
-                                         "type", GDK_DEVICE_TYPE_LOGICAL,
                                          "source", GDK_SOURCE_TOUCHSCREEN,
                                          "has-cursor", TRUE,
                                          "display", seat->display,
@@ -3048,7 +3043,6 @@ seat_handle_capabilities (void                    *data,
 
       seat->touch = g_object_new (GDK_TYPE_WAYLAND_DEVICE,
                                   "name", "Wayland Touch",
-                                  "type", GDK_DEVICE_TYPE_PHYSICAL,
                                   "source", GDK_SOURCE_TOUCHSCREEN,
                                   "has-cursor", FALSE,
                                   "display", seat->display,
@@ -3085,7 +3079,6 @@ get_scroll_device (GdkWaylandSeat              *seat,
         {
           seat->wheel_scrolling = g_object_new (GDK_TYPE_WAYLAND_DEVICE,
                                                 "name", "Wayland Wheel Scrolling",
-                                                "type", GDK_DEVICE_TYPE_LOGICAL,
                                                 "source", GDK_SOURCE_MOUSE,
                                                 "has-cursor", TRUE,
                                                 "display", seat->display,
@@ -3100,7 +3093,6 @@ get_scroll_device (GdkWaylandSeat              *seat,
         {
           seat->finger_scrolling = g_object_new (GDK_TYPE_WAYLAND_DEVICE,
                                                  "name", "Wayland Finger Scrolling",
-                                                 "type", GDK_DEVICE_TYPE_LOGICAL,
                                                  "source", GDK_SOURCE_TOUCHPAD,
                                                  "has-cursor", TRUE,
                                                  "display", seat->display,
@@ -3115,7 +3107,6 @@ get_scroll_device (GdkWaylandSeat              *seat,
         {
           seat->continuous_scrolling = g_object_new (GDK_TYPE_WAYLAND_DEVICE,
                                                      "name", "Wayland Continuous Scrolling",
-                                                     "type", GDK_DEVICE_TYPE_LOGICAL,
                                                      "source", GDK_SOURCE_TRACKPOINT,
                                                      "has-cursor", TRUE,
                                                      "display", seat->display,
@@ -4098,7 +4089,6 @@ tablet_pad_handle_done (void                     *data,
   pad->device =
     g_object_new (GDK_TYPE_WAYLAND_DEVICE_PAD,
                   "name", "Pad device",
-                  "type", GDK_DEVICE_TYPE_PHYSICAL,
                   "source", GDK_SOURCE_TABLET_PAD,
                   "display", gdk_seat_get_display (pad->seat),
                   "seat", pad->seat,
@@ -4276,7 +4266,6 @@ init_devices (GdkWaylandSeat *seat)
   /* pointer */
   seat->logical_pointer = g_object_new (GDK_TYPE_WAYLAND_DEVICE,
                                        "name", "Core Pointer",
-                                       "type", GDK_DEVICE_TYPE_LOGICAL,
                                        "source", GDK_SOURCE_MOUSE,
                                        "has-cursor", TRUE,
                                        "display", seat->display,
@@ -4288,7 +4277,6 @@ init_devices (GdkWaylandSeat *seat)
   /* keyboard */
   seat->logical_keyboard = g_object_new (GDK_TYPE_WAYLAND_DEVICE,
                                         "name", "Core Keyboard",
-                                        "type", GDK_DEVICE_TYPE_LOGICAL,
                                         "source", GDK_SOURCE_KEYBOARD,
                                         "has-cursor", FALSE,
                                         "display", seat->display,
diff --git a/gdk/win32/gdkdevicemanager-win32.c b/gdk/win32/gdkdevicemanager-win32.c
index 5ca900b850..35871706dd 100644
--- a/gdk/win32/gdkdevicemanager-win32.c
+++ b/gdk/win32/gdkdevicemanager-win32.c
@@ -74,13 +74,13 @@ static GdkDevice *
 create_pointer (GdkDeviceManagerWin32 *device_manager,
                GType g_type,
                const char *name,
-               GdkDeviceType type)
+                gboolean has_cursor)
 {
   return g_object_new (g_type,
                        "name", name,
                        "type", type,
                        "source", GDK_SOURCE_MOUSE,
-                       "has-cursor", type == GDK_DEVICE_TYPE_LOGICAL,
+                       "has-cursor", has_cursor,
                        "display", _gdk_display,
                        NULL);
 }
@@ -555,7 +555,6 @@ wintab_init_check (GdkDeviceManagerWin32 *device_manager)
 
           device = g_object_new (GDK_TYPE_DEVICE_WINTAB,
                                  "name", device_name,
-                                 "type", GDK_DEVICE_TYPE_FLOATING,
                                  "source", GDK_SOURCE_PEN,
                                  "has-cursor", lc.lcOptions & CXO_SYSTEM,
                                  "display", display,
@@ -693,12 +692,12 @@ gdk_device_manager_win32_constructed (GObject *object)
     create_pointer (device_manager,
                    GDK_TYPE_DEVICE_VIRTUAL,
                    "Virtual Core Pointer",
-                   GDK_DEVICE_TYPE_LOGICAL);
+                    TRUE);
   device_manager->system_pointer =
     create_pointer (device_manager,
                    GDK_TYPE_DEVICE_WIN32,
                    "System Aggregated Pointer",
-                   GDK_DEVICE_TYPE_PHYSICAL);
+                    FALSE);
   _gdk_device_virtual_set_active (device_manager->core_pointer,
                                  device_manager->system_pointer);
   _gdk_device_set_associated_device (device_manager->system_pointer, device_manager->core_pointer);
@@ -708,12 +707,12 @@ gdk_device_manager_win32_constructed (GObject *object)
     create_keyboard (device_manager,
                     GDK_TYPE_DEVICE_VIRTUAL,
                     "Virtual Core Keyboard",
-                    GDK_DEVICE_TYPE_LOGICAL);
+                     FALSE);
   device_manager->system_keyboard =
     create_keyboard (device_manager,
                    GDK_TYPE_DEVICE_WIN32,
                     "System Aggregated Keyboard",
-                    GDK_DEVICE_TYPE_PHYSICAL);
+                     FALSE);
   _gdk_device_virtual_set_active (device_manager->core_keyboard,
                                  device_manager->system_keyboard);
   _gdk_device_set_associated_device (device_manager->system_keyboard, device_manager->core_keyboard);
diff --git a/testsuite/gdk/seat.c b/testsuite/gdk/seat.c
index 0d723f1367..640e7d0c81 100644
--- a/testsuite/gdk/seat.c
+++ b/testsuite/gdk/seat.c
@@ -65,7 +65,6 @@ test_default_seat (void)
   if ((caps & GDK_SEAT_CAPABILITY_POINTER) != 0)
     {
       g_assert_nonnull (pointer0);
-      g_assert (gdk_device_get_device_type (pointer0) == GDK_DEVICE_TYPE_LOGICAL);
       g_assert (gdk_device_get_display (pointer0) == display);
       g_assert (gdk_device_get_seat (pointer0) == seat0);
 
@@ -73,7 +72,6 @@ test_default_seat (void)
       for (l = physical_devices; l; l = l->next)
         {
           device = l->data;
-          g_assert (gdk_device_get_device_type (device) == GDK_DEVICE_TYPE_PHYSICAL);
           g_assert (gdk_device_get_display (device) == display);
           g_assert (gdk_device_get_seat (device) == seat0);
         }
@@ -91,7 +89,6 @@ test_default_seat (void)
   if ((caps & GDK_SEAT_CAPABILITY_KEYBOARD) != 0)
     {
       g_assert_nonnull (keyboard0);
-      g_assert (gdk_device_get_device_type (keyboard0) == GDK_DEVICE_TYPE_LOGICAL);
       g_assert (gdk_device_get_display (keyboard0) == display);
       g_assert (gdk_device_get_seat (keyboard0) == seat0);
       g_assert (gdk_device_get_source (keyboard0) == GDK_SOURCE_KEYBOARD);
@@ -100,7 +97,6 @@ test_default_seat (void)
       for (l = physical_devices; l; l = l->next)
         {
           device = l->data;
-          g_assert (gdk_device_get_device_type (device) == GDK_DEVICE_TYPE_PHYSICAL);
           g_assert (gdk_device_get_display (device) == display);
           g_assert (gdk_device_get_seat (device) == seat0);
           g_assert (gdk_device_get_source (device) == GDK_SOURCE_KEYBOARD);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]