Commit 96fd1545 authored by Matthias Clasen's avatar Matthias Clasen

Make GtkModelButton work with touch

Some recent refactoring changed things so that in_button is no
longer TRUE when released() is called for touch events. As a minimal
fix, let GtkButton do more of the work by chaining up to its
pressed and released handlers, which know how to handle touch
events. This could be further improved by leaving more of the
state handling to GtkButton, like it was done for GtkToggleButton.
parent 4f76f18b
......@@ -675,22 +675,17 @@ out:
static void
gtk_model_button_pressed (GtkButton *button)
{
button->priv->button_down = TRUE;
GTK_BUTTON_CLASS (gtk_model_button_parent_class)->pressed (button);
gtk_model_button_update_state (GTK_MODEL_BUTTON (button));
gtk_widget_queue_draw (GTK_WIDGET (button));
}
static void
gtk_model_button_released (GtkButton *button)
{
if (button->priv->button_down)
{
button->priv->button_down = FALSE;
if (button->priv->in_button)
gtk_button_clicked (button);
gtk_model_button_update_state (GTK_MODEL_BUTTON (button));
gtk_widget_queue_draw (GTK_WIDGET (button));
}
GTK_BUTTON_CLASS (gtk_model_button_parent_class)->released (button);
gtk_model_button_update_state (GTK_MODEL_BUTTON (button));
}
static void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment