summaryrefslogtreecommitdiff
path: root/gtk/gtklinkbutton.c
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2011-09-16 15:04:44 +0100
committerBastien Nocera <hadess@hadess.net>2011-09-16 15:06:28 +0100
commit3c2eb053d643f9812f3dce86553fafdfb5971d28 (patch)
tree549a587605921dcd1923d07cc26a3ff35cdbaec9 /gtk/gtklinkbutton.c
parent493d79886e1fcf5d417d2d0372a5726516e18345 (diff)
downloadgtk+-3c2eb053d643f9812f3dce86553fafdfb5971d28.tar.gz
link-button: Reset the mouse cursor when destroyed
If clicking on a link destroys the link button, and keeps the same GdkWindow then the cursor stays as a hand in the rest of the interface. https://bugzilla.gnome.org/show_bug.cgi?id=659247
Diffstat (limited to 'gtk/gtklinkbutton.c')
-rw-r--r--gtk/gtklinkbutton.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gtk/gtklinkbutton.c b/gtk/gtklinkbutton.c
index cafa3aaacb..bd2ca65d80 100644
--- a/gtk/gtklinkbutton.c
+++ b/gtk/gtklinkbutton.c
@@ -106,6 +106,7 @@ static gboolean gtk_link_button_button_press (GtkWidget *widget,
static void gtk_link_button_clicked (GtkButton *button);
static gboolean gtk_link_button_popup_menu (GtkWidget *widget);
static void gtk_link_button_style_updated (GtkWidget *widget);
+static void gtk_link_button_unrealize (GtkWidget *widget);
static gboolean gtk_link_button_enter_cb (GtkWidget *widget,
GdkEventCrossing *event,
gpointer user_data);
@@ -153,6 +154,7 @@ gtk_link_button_class_init (GtkLinkButtonClass *klass)
widget_class->button_press_event = gtk_link_button_button_press;
widget_class->popup_menu = gtk_link_button_popup_menu;
widget_class->style_updated = gtk_link_button_style_updated;
+ widget_class->unrealize = gtk_link_button_unrealize;
container_class->add = gtk_link_button_add;
@@ -394,6 +396,14 @@ set_hand_cursor (GtkWidget *widget,
}
static void
+gtk_link_button_unrealize (GtkWidget *widget)
+{
+ set_hand_cursor (widget, FALSE);
+
+ GTK_WIDGET_CLASS (gtk_link_button_parent_class)->unrealize (widget);
+}
+
+static void
popup_menu_detach (GtkWidget *attach_widget,
GtkMenu *menu)
{