]> Pileus Git - ~andy/gtk/commitdiff
GtkButton: Notify on prelight state change.
authorCarlos Garnacho <carlosg@gnome.org>
Tue, 5 Oct 2010 08:56:52 +0000 (10:56 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Sat, 4 Dec 2010 14:38:17 +0000 (15:38 +0100)
gtk/gtkbutton.c

index beece346c12456972ba379735117c917b602855d..9b71c298f500c71478bdd02c5c72c31e393d29f4 100644 (file)
@@ -1746,6 +1746,18 @@ gtk_button_enter_notify (GtkWidget        *widget,
     {
       priv->in_button = TRUE;
       gtk_button_enter (button);
+
+      if (gtk_widget_get_realized (widget) &&
+          gtk_widget_is_drawable (widget))
+        {
+          GtkStyleContext *context;
+
+          context = gtk_widget_get_style_context (widget);
+          gtk_style_context_notify_state_change (context,
+                                                 gtk_widget_get_window (widget),
+                                                 NULL, GTK_STATE_PRELIGHT,
+                                                 button->in_button);
+        }
     }
 
   return FALSE;
@@ -1764,6 +1776,18 @@ gtk_button_leave_notify (GtkWidget        *widget,
     {
       priv->in_button = FALSE;
       gtk_button_leave (button);
+
+      if (gtk_widget_get_realized (widget) &&
+          gtk_widget_is_drawable (widget))
+        {
+          GtkStyleContext *context;
+
+          context = gtk_widget_get_style_context (widget);
+          gtk_style_context_notify_state_change (context,
+                                                 gtk_widget_get_window (widget),
+                                                 NULL, GTK_STATE_PRELIGHT,
+                                                 button->in_button);
+        }
     }
 
   return FALSE;