diff --git a/src/st/st-button.c b/src/st/st-button.c index 38fe20759..8f5c4922f 100644 --- a/src/st/st-button.c +++ b/src/st/st-button.c @@ -765,7 +765,13 @@ st_button_fake_release (StButton *button) g_return_if_fail (ST_IS_BUTTON (button)); priv = st_button_get_instance_private (button); - if (priv->pressed) + if (priv->device && priv->press_sequence) + { + clutter_input_device_sequence_ungrab (priv->device, + priv->press_sequence); + } + + if (priv->pressed || priv->press_sequence) st_button_release (button, priv->device, priv->pressed, 0, NULL); @@ -775,14 +781,6 @@ st_button_fake_release (StButton *button) clutter_ungrab_pointer (); } - if (priv->device && - priv->press_sequence) - { - clutter_input_device_sequence_ungrab (priv->device, - priv->press_sequence); - priv->press_sequence = NULL; - } - priv->device = NULL; }