mirror of
https://github.com/brl/mutter.git
synced 2025-02-21 07:24:09 +00:00
clutter/text: Use implicit grab instead of grabbing all events
Clutter has implicit grabbing now, so no need for grabbing all events using clutter_stage_grab() anymore. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2342>
This commit is contained in:
parent
d374feb55f
commit
dbf56621ff
@ -186,8 +186,6 @@ struct _ClutterTextPrivate
|
|||||||
ClutterInputContentHintFlags input_hints;
|
ClutterInputContentHintFlags input_hints;
|
||||||
ClutterInputContentPurpose input_purpose;
|
ClutterInputContentPurpose input_purpose;
|
||||||
|
|
||||||
ClutterGrab *grab;
|
|
||||||
|
|
||||||
float last_click_x;
|
float last_click_x;
|
||||||
float last_click_y;
|
float last_click_y;
|
||||||
uint32_t last_click_time_ms;
|
uint32_t last_click_time_ms;
|
||||||
@ -2191,7 +2189,6 @@ clutter_text_press (ClutterActor *actor,
|
|||||||
ClutterText *self = CLUTTER_TEXT (actor);
|
ClutterText *self = CLUTTER_TEXT (actor);
|
||||||
ClutterTextPrivate *priv = self->priv;
|
ClutterTextPrivate *priv = self->priv;
|
||||||
ClutterEventType type = clutter_event_type (event);
|
ClutterEventType type = clutter_event_type (event);
|
||||||
ClutterActor *stage;
|
|
||||||
gboolean res = FALSE;
|
gboolean res = FALSE;
|
||||||
gfloat x, y;
|
gfloat x, y;
|
||||||
gint index_;
|
gint index_;
|
||||||
@ -2273,9 +2270,6 @@ clutter_text_press (ClutterActor *actor,
|
|||||||
/* grab the pointer */
|
/* grab the pointer */
|
||||||
priv->in_select_drag = TRUE;
|
priv->in_select_drag = TRUE;
|
||||||
|
|
||||||
stage = clutter_actor_get_stage (actor);
|
|
||||||
priv->grab = clutter_stage_grab (CLUTTER_STAGE (stage), actor);
|
|
||||||
|
|
||||||
if (type != CLUTTER_BUTTON_PRESS)
|
if (type != CLUTTER_BUTTON_PRESS)
|
||||||
priv->in_select_touch = TRUE;
|
priv->in_select_touch = TRUE;
|
||||||
|
|
||||||
@ -2324,12 +2318,6 @@ clutter_text_release (ClutterActor *actor,
|
|||||||
|
|
||||||
if (priv->in_select_drag)
|
if (priv->in_select_drag)
|
||||||
{
|
{
|
||||||
if (priv->grab)
|
|
||||||
{
|
|
||||||
clutter_grab_dismiss (priv->grab);
|
|
||||||
g_clear_pointer (&priv->grab, clutter_grab_unref);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (type == CLUTTER_BUTTON_RELEASE)
|
if (type == CLUTTER_BUTTON_RELEASE)
|
||||||
{
|
{
|
||||||
if (!priv->in_select_touch)
|
if (!priv->in_select_touch)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user