clutter: Drop unused function to translate to screen coordinates
We don't have anything like GdkInputMode that we'd like to honor, this can just be dropped. https://gitlab.gnome.org/GNOME/mutter/merge_requests/672
This commit is contained in:
parent
c710a56903
commit
cb31e3e12a
@ -1110,51 +1110,3 @@ clutter_x11_get_visual_info (void)
|
|||||||
|
|
||||||
return _clutter_backend_x11_get_visual_info (backend_x11);
|
return _clutter_backend_x11_get_visual_info (backend_x11);
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
|
||||||
_clutter_x11_input_device_translate_screen_coord (ClutterInputDevice *device,
|
|
||||||
gint stage_root_x,
|
|
||||||
gint stage_root_y,
|
|
||||||
guint index_,
|
|
||||||
gdouble value,
|
|
||||||
gdouble *axis_value)
|
|
||||||
{
|
|
||||||
ClutterAxisInfo *info;
|
|
||||||
ClutterBackendX11 *backend_x11;
|
|
||||||
gdouble width, scale, offset;
|
|
||||||
|
|
||||||
backend_x11 = CLUTTER_BACKEND_X11 (device->backend);
|
|
||||||
|
|
||||||
if (device->axes == NULL || index_ >= device->axes->len)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
info = &g_array_index (device->axes, ClutterAxisInfo, index_);
|
|
||||||
if (!(info->axis == CLUTTER_INPUT_AXIS_X || info->axis == CLUTTER_INPUT_AXIS_Y))
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
width = info->max_value - info->min_value;
|
|
||||||
|
|
||||||
if (info->axis == CLUTTER_INPUT_AXIS_X)
|
|
||||||
{
|
|
||||||
if (width > 0)
|
|
||||||
scale = backend_x11->xscreen_width / width;
|
|
||||||
else
|
|
||||||
scale = 1;
|
|
||||||
|
|
||||||
offset = - stage_root_x;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (width > 0)
|
|
||||||
scale = backend_x11->xscreen_height / width;
|
|
||||||
else
|
|
||||||
scale = 1;
|
|
||||||
|
|
||||||
offset = - stage_root_y;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (axis_value)
|
|
||||||
*axis_value = offset + scale * (value - info->min_value);
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
@ -108,13 +108,6 @@ XVisualInfo * _clutter_backend_x11_get_visual_info (ClutterBackendX11 *backend
|
|||||||
|
|
||||||
void _clutter_x11_select_events (Window xwin);
|
void _clutter_x11_select_events (Window xwin);
|
||||||
|
|
||||||
gboolean _clutter_x11_input_device_translate_screen_coord (ClutterInputDevice *device,
|
|
||||||
gint stage_root_x,
|
|
||||||
gint stage_root_y,
|
|
||||||
guint index_,
|
|
||||||
gdouble value,
|
|
||||||
gdouble *axis_value);
|
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __CLUTTER_BACKEND_X11_H__ */
|
#endif /* __CLUTTER_BACKEND_X11_H__ */
|
||||||
|
Loading…
Reference in New Issue
Block a user