[gtk+/gtk-2-24] GtkButton: do not prelight in touchscreen mode



commit 0b5b2779a2ec17b633c0c58c8907cc5d0c369c4b
Author: Andreas Müller <schnitzeltony googlemail com>
Date:   Fri Nov 16 22:07:28 2012 +0100

    GtkButton: do not prelight in touchscreen mode
    
    Code was copied from GtkToggleButton.
    
    Signed-off-by: Andreas Müller <schnitzeltony googlemail com>
    
    https://bugzilla.gnome.org/show_bug.cgi?id=689138

 gtk/gtkbutton.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c
index a7bc925..68e8ea7 100644
--- a/gtk/gtkbutton.c
+++ b/gtk/gtkbutton.c
@@ -2066,15 +2066,19 @@ _gtk_button_set_depressed (GtkButton *button,
 static void
 gtk_button_update_state (GtkButton *button)
 {
-  gboolean depressed;
+  gboolean depressed, touchscreen;
   GtkStateType new_state;
 
+  g_object_get (gtk_widget_get_settings (GTK_WIDGET (button)),
+                "gtk-touchscreen-mode", &touchscreen,
+                NULL);
+
   if (button->activate_timeout)
     depressed = button->depress_on_activate;
   else
     depressed = button->in_button && button->button_down;
 
-  if (button->in_button && (!button->button_down || !depressed))
+  if (!touchscreen && button->in_button && (!button->button_down || !depressed))
     new_state = GTK_STATE_PRELIGHT;
   else
     new_state = depressed ? GTK_STATE_ACTIVE : GTK_STATE_NORMAL;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]