From b6f9ce8a73eeae696f15386d10477488624c66a3 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Sat, 7 Dec 2013 01:29:56 +0100 Subject: [PATCH] button: Allow :hover on insensitive buttons You can still hover a mouse on insensitive elements; it's up to the theme to disable that. This is in line with the HTML/CSS interpretation of :hover. Insensitive elements still cannot be clicked. https://bugzilla.gnome.org/show_bug.cgi?id=719486 --- gtk/gtkbutton.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c index 6bcf1975e4..7486a73935 100644 --- a/gtk/gtkbutton.c +++ b/gtk/gtkbutton.c @@ -2044,8 +2044,7 @@ gtk_button_leave_notify (GtkWidget *widget, GtkButtonPrivate *priv = button->priv; if ((event->window == button->priv->event_window) && - (event->detail != GDK_NOTIFY_INFERIOR) && - (gtk_widget_get_sensitive (widget))) + (event->detail != GDK_NOTIFY_INFERIOR)) { priv->in_button = FALSE; g_signal_emit (button, button_signals[LEAVE], 0); @@ -2104,8 +2103,9 @@ static void gtk_real_button_released (GtkButton *button) { gtk_button_do_release (button, - button->priv->in_button || - touch_release_in_button (button)); + gtk_widget_is_sensitive (GTK_WIDGET (button)) && + (button->priv->in_button || + touch_release_in_button (button))); } static void @@ -2703,13 +2703,9 @@ gtk_button_state_changed (GtkWidget *widget, GtkStateType previous_state) { GtkButton *button = GTK_BUTTON (widget); - GtkButtonPrivate *priv = button->priv; if (!gtk_widget_is_sensitive (widget)) - { - priv->in_button = FALSE; - gtk_button_do_release (button, FALSE); - } + gtk_button_do_release (button, FALSE); } static void