[gtk+] Make GtkModelButton work with touch
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Make GtkModelButton work with touch
- Date: Thu, 25 Sep 2014 03:35:34 +0000 (UTC)
commit 96fd15454b9bf95524ab6b61c64e6e257b10e9e9
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Sep 24 23:33:23 2014 -0400
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.
gtk/gtkmodelbutton.c | 15 +++++----------
1 files changed, 5 insertions(+), 10 deletions(-)
---
diff --git a/gtk/gtkmodelbutton.c b/gtk/gtkmodelbutton.c
index 568d54f..8762839 100644
--- a/gtk/gtkmodelbutton.c
+++ b/gtk/gtkmodelbutton.c
@@ -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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]