gdk: Drop GdkDevice::input-mode and rename ::input-source

Drop the input-mode, since it only makes sense for
floating devices, which we don't have anymore. And renamt
::input-source to ::source, to match the getter.

Update all users.
This commit is contained in:
Matthias Clasen 2020-02-24 13:35:27 -05:00
parent 9ce6e98487
commit 6be9e44786
10 changed files with 43 additions and 221 deletions

View File

@ -110,8 +110,7 @@ create_core_pointer (GdkDisplay *display)
return g_object_new (GDK_TYPE_BROADWAY_DEVICE,
"name", "Core Pointer",
"type", GDK_DEVICE_TYPE_MASTER,
"input-source", GDK_SOURCE_MOUSE,
"input-mode", GDK_MODE_SCREEN,
"source", GDK_SOURCE_MOUSE,
"has-cursor", TRUE,
"display", display,
NULL);
@ -123,8 +122,7 @@ create_core_keyboard (GdkDisplay *display)
return g_object_new (GDK_TYPE_BROADWAY_DEVICE,
"name", "Core Keyboard",
"type", GDK_DEVICE_TYPE_MASTER,
"input-source", GDK_SOURCE_KEYBOARD,
"input-mode", GDK_MODE_SCREEN,
"source", GDK_SOURCE_KEYBOARD,
"has-cursor", FALSE,
"display", display,
NULL);
@ -136,8 +134,7 @@ create_touchscreen (GdkDisplay *display)
return g_object_new (GDK_TYPE_BROADWAY_DEVICE,
"name", "Touchscreen",
"type", GDK_DEVICE_TYPE_SLAVE,
"input-source", GDK_SOURCE_TOUCHSCREEN,
"input-mode", GDK_MODE_SCREEN,
"source", GDK_SOURCE_TOUCHSCREEN,
"has-cursor", FALSE,
"display", display,
NULL);

View File

@ -93,7 +93,6 @@ enum {
PROP_ASSOCIATED_DEVICE,
PROP_TYPE,
PROP_SOURCE,
PROP_MODE,
PROP_HAS_CURSOR,
PROP_N_AXES,
PROP_VENDOR_ID,
@ -182,19 +181,6 @@ gdk_device_class_init (GdkDeviceClass *klass)
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
/*
* GdkDevice:mode:
*
* Input mode for the device.
*/
device_props[PROP_MODE] =
g_param_spec_enum ("mode",
P_("Input mode for the device"),
P_("Input mode for the device"),
GDK_TYPE_INPUT_MODE,
GDK_MODE_DISABLED,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
/**
* GdkDevice:has-cursor:
*
@ -417,9 +403,6 @@ gdk_device_set_property (GObject *object,
case PROP_SOURCE:
device->source = g_value_get_enum (value);
break;
case PROP_MODE:
gdk_device_set_mode (device, g_value_get_enum (value));
break;
case PROP_HAS_CURSOR:
device->has_cursor = g_value_get_boolean (value);
break;
@ -466,9 +449,6 @@ gdk_device_get_property (GObject *object,
case PROP_SOURCE:
g_value_set_enum (value, device->source);
break;
case PROP_MODE:
g_value_set_enum (value, device->mode);
break;
case PROP_HAS_CURSOR:
g_value_set_boolean (value, device->has_cursor);
break;
@ -727,56 +707,6 @@ gdk_device_get_source (GdkDevice *device)
return device->source;
}
/**
* gdk_device_get_mode:
* @device: a #GdkDevice
*
* Determines the mode of the device.
*
* Returns: a #GdkInputMode
**/
GdkInputMode
gdk_device_get_mode (GdkDevice *device)
{
g_return_val_if_fail (GDK_IS_DEVICE (device), 0);
return device->mode;
}
/**
* gdk_device_set_mode:
* @device: a #GdkDevice.
* @mode: the input mode.
*
* Sets a the mode of an input device. The mode controls if the
* device is active and whether the devices range is mapped to the
* entire screen or to a single surface.
*
* Note: This is only meaningful for floating devices, master devices (and
* slaves connected to these) drive the pointer cursor, which is not limited
* by the input mode.
*
* Returns: %TRUE if the mode was successfully changed.
**/
gboolean
gdk_device_set_mode (GdkDevice *device,
GdkInputMode mode)
{
g_return_val_if_fail (GDK_IS_DEVICE (device), FALSE);
if (device->mode == mode)
return TRUE;
if (mode == GDK_MODE_DISABLED &&
gdk_device_get_device_type (device) == GDK_DEVICE_TYPE_MASTER)
return FALSE;
device->mode = mode;
g_object_notify_by_pspec (G_OBJECT (device), device_props[PROP_MODE]);
return TRUE;
}
/**
* gdk_device_get_n_keys:
* @device: a #GdkDevice
@ -866,7 +796,7 @@ gdk_device_get_axis_use (GdkDevice *device,
GdkAxisInfo *info;
g_return_val_if_fail (GDK_IS_DEVICE (device), GDK_AXIS_IGNORE);
g_return_val_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD, GDK_AXIS_IGNORE);
g_return_val_if_fail (device->source != GDK_SOURCE_KEYBOARD, GDK_AXIS_IGNORE);
g_return_val_if_fail (index_ < device->axes->len, GDK_AXIS_IGNORE);
info = &g_array_index (device->axes, GdkAxisInfo, index_);
@ -890,7 +820,7 @@ gdk_device_set_axis_use (GdkDevice *device,
GdkAxisInfo *info;
g_return_if_fail (GDK_IS_DEVICE (device));
g_return_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD);
g_return_if_fail (device->source != GDK_SOURCE_KEYBOARD);
g_return_if_fail (index_ < device->axes->len);
info = &g_array_index (device->axes, GdkAxisInfo, index_);
@ -1075,7 +1005,7 @@ gint
gdk_device_get_n_axes (GdkDevice *device)
{
g_return_val_if_fail (GDK_IS_DEVICE (device), 0);
g_return_val_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD, 0);
g_return_val_if_fail (device->source != GDK_SOURCE_KEYBOARD, 0);
return device->axes->len;
}
@ -1098,7 +1028,7 @@ gdk_device_get_axis_names (GdkDevice *device)
gint i;
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 (device->source != GDK_SOURCE_KEYBOARD, NULL);
if (device->axes->len == 0)
return NULL;
@ -1140,7 +1070,7 @@ gdk_device_get_axis_value (GdkDevice *device,
gint i;
g_return_val_if_fail (GDK_IS_DEVICE (device), FALSE);
g_return_val_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD, FALSE);
g_return_val_if_fail (device->source != GDK_SOURCE_KEYBOARD, FALSE);
if (axes == NULL)
return FALSE;
@ -1184,7 +1114,7 @@ gdk_device_get_axis (GdkDevice *device,
gint i;
g_return_val_if_fail (GDK_IS_DEVICE (device), FALSE);
g_return_val_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD, FALSE);
g_return_val_if_fail (device->source != GDK_SOURCE_KEYBOARD, FALSE);
if (axes == NULL)
return FALSE;
@ -1506,9 +1436,6 @@ _gdk_device_translate_screen_coord (GdkDevice *device,
GdkAxisInfo axis_info;
gdouble axis_width, scale, offset;
if (device->mode != GDK_MODE_SCREEN)
return FALSE;
if (index_ >= device->axes->len)
return FALSE;
@ -1626,7 +1553,7 @@ gdk_device_get_last_event_surface (GdkDevice *device)
GdkPointerSurfaceInfo *info;
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 (device->source != GDK_SOURCE_KEYBOARD, NULL);
display = gdk_device_get_display (device);
info = _gdk_display_get_pointer_info (display, device);

View File

@ -69,25 +69,6 @@ typedef enum
GDK_SOURCE_TABLET_PAD
} GdkInputSource;
/**
* GdkInputMode:
* @GDK_MODE_DISABLED: the device is disabled and will not report any events.
* @GDK_MODE_SCREEN: the device is enabled. The devices coordinate space
* maps to the entire screen.
* @GDK_MODE_SURFACE: the device is enabled. The devices coordinate space
* is mapped to a single surface. The manner in which this surface
* is chosen is undefined, but it will typically be the same
* way in which the focus surface for key events is determined.
*
* An enumeration that describes the mode of an input device.
*/
typedef enum
{
GDK_MODE_DISABLED,
GDK_MODE_SCREEN,
GDK_MODE_SURFACE
} GdkInputMode;
/**
* GdkDeviceType:
* @GDK_DEVICE_TYPE_MASTER: Device is a master (or virtual) device. There will
@ -132,13 +113,7 @@ gboolean gdk_device_get_has_cursor (GdkDevice *device);
/* Functions to configure a device */
GDK_AVAILABLE_IN_ALL
GdkInputSource gdk_device_get_source (GdkDevice *device);
GDK_AVAILABLE_IN_ALL
GdkInputMode gdk_device_get_mode (GdkDevice *device);
GDK_AVAILABLE_IN_ALL
gboolean gdk_device_set_mode (GdkDevice *device,
GdkInputMode mode);
GdkInputSource gdk_device_get_source (GdkDevice *device);
GDK_AVAILABLE_IN_ALL
gint gdk_device_get_n_keys (GdkDevice *device);

View File

@ -44,7 +44,6 @@ struct _GdkDevice
gchar *name;
GdkInputSource source;
GdkInputMode mode;
gboolean has_cursor;
gint num_keys;
GdkAxisFlags axis_flags;

View File

@ -2695,12 +2695,9 @@ _gdk_windowing_got_event (GdkDisplay *display,
_gdk_display_device_grab_update (display, device, source_device, serial);
if (gdk_device_get_mode (device) == GDK_MODE_DISABLED ||
!_gdk_display_check_grab_ownership (display, device, serial))
if (!_gdk_display_check_grab_ownership (display, device, serial))
{
/* Device events are blocked by another
* device grab, or the device is disabled
*/
/* Device events are blocked by another device grab */
unlink_event = TRUE;
goto out;
}

View File

@ -2780,8 +2780,7 @@ tablet_handle_done (void *data,
master = g_object_new (GDK_TYPE_WAYLAND_DEVICE,
"name", master_name,
"type", GDK_DEVICE_TYPE_MASTER,
"input-source", GDK_SOURCE_MOUSE,
"input-mode", GDK_MODE_SCREEN,
"source", GDK_SOURCE_MOUSE,
"has-cursor", TRUE,
"display", display,
"seat", seat,
@ -2793,8 +2792,7 @@ tablet_handle_done (void *data,
stylus_device = g_object_new (GDK_TYPE_WAYLAND_DEVICE,
"name", tablet->name,
"type", GDK_DEVICE_TYPE_SLAVE,
"input-source", GDK_SOURCE_PEN,
"input-mode", GDK_MODE_SCREEN,
"source", GDK_SOURCE_PEN,
"has-cursor", FALSE,
"display", display,
"seat", seat,
@ -2805,8 +2803,7 @@ tablet_handle_done (void *data,
eraser_device = g_object_new (GDK_TYPE_WAYLAND_DEVICE,
"name", eraser_name,
"type", GDK_DEVICE_TYPE_SLAVE,
"input-source", GDK_SOURCE_ERASER,
"input-mode", GDK_MODE_SCREEN,
"source", GDK_SOURCE_ERASER,
"has-cursor", FALSE,
"display", display,
"seat", seat,
@ -2915,8 +2912,7 @@ seat_handle_capabilities (void *data,
seat->pointer = g_object_new (GDK_TYPE_WAYLAND_DEVICE,
"name", "Wayland Pointer",
"type", GDK_DEVICE_TYPE_SLAVE,
"input-source", GDK_SOURCE_MOUSE,
"input-mode", GDK_MODE_SCREEN,
"source", GDK_SOURCE_MOUSE,
"has-cursor", TRUE,
"display", seat->display,
"seat", seat,
@ -2986,8 +2982,7 @@ seat_handle_capabilities (void *data,
seat->keyboard = g_object_new (GDK_TYPE_WAYLAND_DEVICE,
"name", "Wayland Keyboard",
"type", GDK_DEVICE_TYPE_SLAVE,
"input-source", GDK_SOURCE_KEYBOARD,
"input-mode", GDK_MODE_SCREEN,
"source", GDK_SOURCE_KEYBOARD,
"has-cursor", FALSE,
"display", seat->display,
"seat", seat,
@ -3015,8 +3010,7 @@ seat_handle_capabilities (void *data,
seat->touch_master = g_object_new (GDK_TYPE_WAYLAND_DEVICE,
"name", "Wayland Touch Master Pointer",
"type", GDK_DEVICE_TYPE_MASTER,
"input-source", GDK_SOURCE_MOUSE,
"input-mode", GDK_MODE_SCREEN,
"source", GDK_SOURCE_MOUSE,
"has-cursor", TRUE,
"display", seat->display,
"seat", seat,
@ -3028,8 +3022,7 @@ seat_handle_capabilities (void *data,
seat->touch = g_object_new (GDK_TYPE_WAYLAND_DEVICE,
"name", "Wayland Touch",
"type", GDK_DEVICE_TYPE_SLAVE,
"input-source", GDK_SOURCE_TOUCHSCREEN,
"input-mode", GDK_MODE_SCREEN,
"source", GDK_SOURCE_TOUCHSCREEN,
"has-cursor", FALSE,
"display", seat->display,
"seat", seat,
@ -3066,8 +3059,7 @@ get_scroll_device (GdkWaylandSeat *seat,
seat->wheel_scrolling = g_object_new (GDK_TYPE_WAYLAND_DEVICE,
"name", "Wayland Wheel Scrolling",
"type", GDK_DEVICE_TYPE_SLAVE,
"input-source", GDK_SOURCE_MOUSE,
"input-mode", GDK_MODE_SCREEN,
"source", GDK_SOURCE_MOUSE,
"has-cursor", TRUE,
"display", seat->display,
"seat", seat,
@ -3083,8 +3075,7 @@ get_scroll_device (GdkWaylandSeat *seat,
seat->finger_scrolling = g_object_new (GDK_TYPE_WAYLAND_DEVICE,
"name", "Wayland Finger Scrolling",
"type", GDK_DEVICE_TYPE_SLAVE,
"input-source", GDK_SOURCE_TOUCHPAD,
"input-mode", GDK_MODE_SCREEN,
"source", GDK_SOURCE_TOUCHPAD,
"has-cursor", TRUE,
"display", seat->display,
"seat", seat,
@ -3100,8 +3091,7 @@ get_scroll_device (GdkWaylandSeat *seat,
seat->continuous_scrolling = g_object_new (GDK_TYPE_WAYLAND_DEVICE,
"name", "Wayland Continuous Scrolling",
"type", GDK_DEVICE_TYPE_SLAVE,
"input-source", GDK_SOURCE_TRACKPOINT,
"input-mode", GDK_MODE_SCREEN,
"source", GDK_SOURCE_TRACKPOINT,
"has-cursor", TRUE,
"display", seat->display,
"seat", seat,
@ -4102,8 +4092,7 @@ tablet_pad_handle_done (void *data,
g_object_new (GDK_TYPE_WAYLAND_DEVICE_PAD,
"name", "Pad device",
"type", GDK_DEVICE_TYPE_SLAVE,
"input-source", GDK_SOURCE_TABLET_PAD,
"input-mode", GDK_MODE_SCREEN,
"source", GDK_SOURCE_TABLET_PAD,
"display", gdk_seat_get_display (pad->seat),
"seat", pad->seat,
NULL);
@ -4281,8 +4270,7 @@ init_devices (GdkWaylandSeat *seat)
seat->master_pointer = g_object_new (GDK_TYPE_WAYLAND_DEVICE,
"name", "Core Pointer",
"type", GDK_DEVICE_TYPE_MASTER,
"input-source", GDK_SOURCE_MOUSE,
"input-mode", GDK_MODE_SCREEN,
"source", GDK_SOURCE_MOUSE,
"has-cursor", TRUE,
"display", seat->display,
"seat", seat,
@ -4294,8 +4282,7 @@ init_devices (GdkWaylandSeat *seat)
seat->master_keyboard = g_object_new (GDK_TYPE_WAYLAND_DEVICE,
"name", "Core Keyboard",
"type", GDK_DEVICE_TYPE_MASTER,
"input-source", GDK_SOURCE_KEYBOARD,
"input-mode", GDK_MODE_SCREEN,
"source", GDK_SOURCE_KEYBOARD,
"has-cursor", FALSE,
"display", seat->display,
"seat", seat,

View File

@ -233,11 +233,6 @@ _gdk_device_wintab_translate_axes (GdkDeviceWintab *device_wintab,
{
case GDK_AXIS_X:
case GDK_AXIS_Y:
if (gdk_device_get_mode (device) == GDK_MODE_SURFACE)
_gdk_device_translate_surface_coord (device, window, i,
device_wintab->last_axis_data[i],
&axes[i]);
else
{
HMONITOR hmonitor;
MONITORINFO minfo = {sizeof (MONITORINFO),};

View File

@ -79,8 +79,7 @@ create_pointer (GdkDeviceManagerWin32 *device_manager,
return g_object_new (g_type,
"name", name,
"type", type,
"input-source", GDK_SOURCE_MOUSE,
"input-mode", GDK_MODE_SCREEN,
"source", GDK_SOURCE_MOUSE,
"has-cursor", type == GDK_DEVICE_TYPE_MASTER,
"display", _gdk_display,
NULL);
@ -95,8 +94,7 @@ create_keyboard (GdkDeviceManagerWin32 *device_manager,
return g_object_new (g_type,
"name", name,
"type", type,
"input-source", GDK_SOURCE_KEYBOARD,
"input-mode", GDK_MODE_SCREEN,
"source", GDK_SOURCE_KEYBOARD,
"has-cursor", FALSE,
"display", _gdk_display,
NULL);
@ -558,8 +556,7 @@ wintab_init_check (GdkDeviceManagerWin32 *device_manager)
device = g_object_new (GDK_TYPE_DEVICE_WINTAB,
"name", device_name,
"type", GDK_DEVICE_TYPE_FLOATING,
"input-source", GDK_SOURCE_PEN,
"input-mode", GDK_MODE_SCREEN,
"source", GDK_SOURCE_PEN,
"has-cursor", lc.lcOptions & CXO_SYSTEM,
"display", display,
NULL);
@ -940,8 +937,7 @@ gdk_input_other_event (GdkDisplay *display,
device_manager->dev_entered_proximity -= 1;
if (source_device != NULL &&
source_device->sends_core &&
gdk_device_get_mode (GDK_DEVICE (source_device)) != GDK_MODE_DISABLED)
source_device->sends_core)
{
_gdk_device_virtual_set_active (device_manager->core_pointer,
GDK_DEVICE (source_device));
@ -950,7 +946,6 @@ gdk_input_other_event (GdkDisplay *display,
}
else if (source_device != NULL &&
source_device->sends_core &&
gdk_device_get_mode (GDK_DEVICE (source_device)) != GDK_MODE_DISABLED &&
_gdk_input_ignore_core == 0)
{
/* A fallback for cases when two devices (disabled and enabled)
@ -970,8 +965,7 @@ gdk_input_other_event (GdkDisplay *display,
_gdk_input_ignore_core += 1;
}
if (source_device == NULL ||
gdk_device_get_mode (GDK_DEVICE (source_device)) == GDK_MODE_DISABLED)
if (source_device == NULL)
return NULL;
/* Don't produce any button or motion events while a window is being
@ -1127,8 +1121,7 @@ gdk_input_other_event (GdkDisplay *display,
packet.pkCursor)) == NULL)
return NULL;
if (source_device->sends_core &&
gdk_device_get_mode (GDK_DEVICE (source_device)) != GDK_MODE_DISABLED)
if (source_device->sends_core)
{
_gdk_device_virtual_set_active (device_manager->core_pointer,
GDK_DEVICE (source_device));

View File

@ -230,9 +230,6 @@ gdk_x11_device_xi2_get_state (GdkDevice *device,
case GDK_AXIS_X:
case GDK_AXIS_Y:
case GDK_AXIS_IGNORE:
if (gdk_device_get_mode (device) == GDK_MODE_SURFACE)
_gdk_device_translate_surface_coord (device, surface, j, value, &axes[j]);
else
{
gint root_x, root_y;

View File

@ -473,7 +473,6 @@ create_device (GdkX11DeviceManagerXI2 *device_manager,
GdkInputSource touch_source;
GdkDeviceType type;
GdkDevice *device;
GdkInputMode mode;
gint num_touches = 0;
gchar *vendor_id = NULL, *product_id = NULL;
@ -520,17 +519,14 @@ create_device (GdkX11DeviceManagerXI2 *device_manager,
case XIMasterKeyboard:
case XIMasterPointer:
type = GDK_DEVICE_TYPE_MASTER;
mode = GDK_MODE_SCREEN;
break;
case XISlaveKeyboard:
case XISlavePointer:
type = GDK_DEVICE_TYPE_SLAVE;
mode = GDK_MODE_DISABLED;
break;
case XIFloatingSlave:
default:
type = GDK_DEVICE_TYPE_FLOATING;
mode = GDK_MODE_DISABLED;
break;
}
@ -538,12 +534,10 @@ create_device (GdkX11DeviceManagerXI2 *device_manager,
({
const gchar *type_names[] = { "master", "slave", "floating" };
const gchar *source_names[] = { "mouse", "pen", "eraser", "cursor", "keyboard", "direct touch", "indirect touch", "trackpoint", "pad" };
const gchar *mode_names[] = { "disabled", "screen", "window" };
g_message ("input device:\n\tname: %s\n\ttype: %s\n\tsource: %s\n\tmode: %s\n\thas cursor: %d\n\ttouches: %d",
g_message ("input device:\n\tname: %s\n\ttype: %s\n\tsource: %s\n\thas cursor: %d\n\ttouches: %d",
dev->name,
type_names[type],
source_names[input_source],
mode_names[mode],
dev->use == XIMasterPointer,
num_touches);
}));
@ -555,8 +549,7 @@ create_device (GdkX11DeviceManagerXI2 *device_manager,
device = g_object_new (GDK_TYPE_X11_DEVICE_XI2,
"name", dev->name,
"type", type,
"input-source", input_source,
"input-mode", mode,
"source", input_source,
"has-cursor", (dev->use == XIMasterPointer),
"display", display,
"device-id", dev->deviceid,
@ -1228,9 +1221,6 @@ translate_axes (GdkDevice *device,
{
case GDK_AXIS_X:
case GDK_AXIS_Y:
if (gdk_device_get_mode (device) == GDK_MODE_SURFACE)
_gdk_device_translate_surface_coord (device, surface, i, val, &axes[i]);
else
{
if (use == GDK_AXIS_X)
axes[i] = x;
@ -1661,17 +1651,8 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
surface,
&xev->valuators);
if (gdk_device_get_mode (device) == GDK_MODE_SURFACE)
{
/* Update event coordinates from axes */
gdk_device_get_axis (device, axes, GDK_AXIS_X, &x);
gdk_device_get_axis (device, axes, GDK_AXIS_Y, &y);
}
else
{
x = (double) xev->event_x / scale;
y = (double) xev->event_y / scale;
}
x = (double) xev->event_x / scale;
y = (double) xev->event_y / scale;
event = gdk_event_button_new (ev->evtype == XI_ButtonPress
? GDK_BUTTON_PRESS
@ -1746,17 +1727,8 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
surface,
&xev->valuators);
if (gdk_device_get_mode (device) == GDK_MODE_SURFACE)
{
/* Update event coordinates from axes */
gdk_device_get_axis (device, axes, GDK_AXIS_X, &x);
gdk_device_get_axis (device, axes, GDK_AXIS_Y, &y);
}
else
{
x = (double) xev->event_x / scale;
y = (double) xev->event_y / scale;
}
x = (double) xev->event_x / scale;
y = (double) xev->event_y / scale;
event = gdk_event_motion_new (surface,
device,
@ -1803,17 +1775,9 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
surface,
&xev->valuators);
if (gdk_device_get_mode (device) == GDK_MODE_SURFACE)
{
/* Update event coordinates from axes */
gdk_device_get_axis (device, axes, GDK_AXIS_X, &x);
gdk_device_get_axis (device, axes, GDK_AXIS_Y, &y);
}
else
{
x = (double) xev->event_x / scale;
y = (double) xev->event_y / scale;
}
x = (double) xev->event_x / scale;
y = (double) xev->event_y / scale;
event = gdk_event_touch_new (ev->evtype == XI_TouchBegin
? GDK_TOUCH_BEGIN
: GDK_TOUCH_END,
@ -1861,17 +1825,8 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
surface,
&xev->valuators);
if (gdk_device_get_mode (device) == GDK_MODE_SURFACE)
{
/* Update event coordinates from axes */
gdk_device_get_axis (device, axes, GDK_AXIS_X, &x);
gdk_device_get_axis (device, axes, GDK_AXIS_Y, &y);
}
else
{
x = (double) xev->event_x / scale;
y = (double) xev->event_y / scale;
}
x = (double) xev->event_x / scale;
y = (double) xev->event_y / scale;
event = gdk_event_touch_new (GDK_TOUCH_UPDATE,
GUINT_TO_POINTER (xev->detail),