mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 01:20:42 -05:00
clutter: Drop clutter_input_device_update_from_event()
Input devices aren't "updated" anymore, but their state queried to the seat instead. This API was only meant for embedders of Clutter, and is pointless to us. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
This commit is contained in:
parent
730da1dbe1
commit
3234ae2993
@ -236,9 +236,6 @@ ClutterInputDeviceTool *
|
|||||||
ClutterInputDeviceToolType type);
|
ClutterInputDeviceToolType type);
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
void clutter_input_device_update_from_event (ClutterInputDevice *device,
|
|
||||||
ClutterEvent *event);
|
|
||||||
CLUTTER_EXPORT
|
|
||||||
gboolean clutter_input_device_keycode_to_evdev (ClutterInputDevice *device,
|
gboolean clutter_input_device_keycode_to_evdev (ClutterInputDevice *device,
|
||||||
guint hardware_keycode,
|
guint hardware_keycode,
|
||||||
guint *evdev_keycode);
|
guint *evdev_keycode);
|
||||||
|
@ -1022,83 +1022,6 @@ clutter_input_device_get_device_mode (ClutterInputDevice *device)
|
|||||||
return device->device_mode;
|
return device->device_mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_input_device_update_from_event:
|
|
||||||
* @device: a #ClutterInputDevice
|
|
||||||
* @event: a #ClutterEvent
|
|
||||||
* @update_stage: whether to update the #ClutterStage of the @device
|
|
||||||
* using the stage of the event
|
|
||||||
*
|
|
||||||
* Forcibly updates the state of the @device using a #ClutterEvent
|
|
||||||
*
|
|
||||||
* This function should never be used by applications: it is meant
|
|
||||||
* for integration with embedding toolkits, like clutter-gtk
|
|
||||||
*
|
|
||||||
* Embedding toolkits that disable the event collection inside Clutter
|
|
||||||
* need to use this function to update the state of input devices depending
|
|
||||||
* on a #ClutterEvent that they are going to submit to the event handling code
|
|
||||||
* in Clutter though clutter_do_event(). Since the input devices hold the state
|
|
||||||
* that is going to be used to fill in fields like the #ClutterButtonEvent
|
|
||||||
* click count, or to emit synthesized events like %CLUTTER_ENTER and
|
|
||||||
* %CLUTTER_LEAVE, it is necessary for embedding toolkits to also be
|
|
||||||
* responsible of updating the input device state.
|
|
||||||
*
|
|
||||||
* For instance, this might be the code to translate an embedding toolkit
|
|
||||||
* native motion notification into a Clutter #ClutterMotionEvent and ask
|
|
||||||
* Clutter to process it:
|
|
||||||
*
|
|
||||||
* |[
|
|
||||||
* ClutterEvent c_event;
|
|
||||||
*
|
|
||||||
* translate_native_event_to_clutter (native_event, &c_event);
|
|
||||||
*
|
|
||||||
* clutter_do_event (&c_event);
|
|
||||||
* ]|
|
|
||||||
*
|
|
||||||
* Before letting clutter_do_event() process the event, it is necessary to call
|
|
||||||
* clutter_input_device_update_from_event():
|
|
||||||
*
|
|
||||||
* |[
|
|
||||||
* ClutterEvent c_event;
|
|
||||||
* ClutterDeviceManager *manager;
|
|
||||||
* ClutterInputDevice *device;
|
|
||||||
*
|
|
||||||
* translate_native_event_to_clutter (native_event, &c_event);
|
|
||||||
*
|
|
||||||
* // get the seat
|
|
||||||
* seat = clutter_backend_get_deafult_seat (clutter_get_default_backend ());
|
|
||||||
*
|
|
||||||
* // use the default Core Pointer that Clutter backends register by default
|
|
||||||
* device = clutter_seat_get_pointer (seat);
|
|
||||||
*
|
|
||||||
* // update the state of the input device
|
|
||||||
* clutter_input_device_update_from_event (device, &c_event);
|
|
||||||
*
|
|
||||||
* clutter_do_event (&c_event);
|
|
||||||
* ]|
|
|
||||||
*
|
|
||||||
* The @update_stage boolean argument should be used when the input device
|
|
||||||
* enters and leaves a #ClutterStage; it will use the #ClutterStage field
|
|
||||||
* of the passed @event to update the stage associated to the input device.
|
|
||||||
*
|
|
||||||
* Since: 1.2
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
clutter_input_device_update_from_event (ClutterInputDevice *device,
|
|
||||||
ClutterEvent *event)
|
|
||||||
{
|
|
||||||
ClutterEventSequence *sequence;
|
|
||||||
gfloat event_x, event_y;
|
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_INPUT_DEVICE (device));
|
|
||||||
g_return_if_fail (event != NULL);
|
|
||||||
|
|
||||||
sequence = clutter_event_get_event_sequence (event);
|
|
||||||
clutter_event_get_coords (event, &event_x, &event_y);
|
|
||||||
|
|
||||||
_clutter_input_device_set_coords (device, sequence, event_x, event_y);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*< private >
|
/*< private >
|
||||||
* clutter_input_device_reset_axes:
|
* clutter_input_device_reset_axes:
|
||||||
* @device: a #ClutterInputDevice
|
* @device: a #ClutterInputDevice
|
||||||
|
@ -110,7 +110,6 @@ static gboolean perf_fake_mouse_cb (gpointer stage)
|
|||||||
event2->crossing.related = NULL;
|
event2->crossing.related = NULL;
|
||||||
|
|
||||||
clutter_event_set_device (event2, device);
|
clutter_event_set_device (event2, device);
|
||||||
clutter_input_device_update_from_event (device, event2);
|
|
||||||
|
|
||||||
clutter_event_put (event2);
|
clutter_event_put (event2);
|
||||||
clutter_event_free (event2);
|
clutter_event_free (event2);
|
||||||
|
Loading…
Reference in New Issue
Block a user