aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@gnome.org>2004-07-11 19:06:57 +0800
committerMarco Pesenti Gritti <marco@src.gnome.org>2004-07-11 19:06:57 +0800
commit0e419aaf06e325e0ad4b6c7a9929e66773a3fb74 (patch)
tree332a661730096d536f0bbb3209395a68e97b5b29 /src
parentb341a4983b97e022d87e16590d5b7d8aa88c5374 (diff)
downloadgsoc2013-epiphany-0e419aaf06e325e0ad4b6c7a9929e66773a3fb74.tar
gsoc2013-epiphany-0e419aaf06e325e0ad4b6c7a9929e66773a3fb74.tar.gz
gsoc2013-epiphany-0e419aaf06e325e0ad4b6c7a9929e66773a3fb74.tar.bz2
gsoc2013-epiphany-0e419aaf06e325e0ad4b6c7a9929e66773a3fb74.tar.lz
gsoc2013-epiphany-0e419aaf06e325e0ad4b6c7a9929e66773a3fb74.tar.xz
gsoc2013-epiphany-0e419aaf06e325e0ad4b6c7a9929e66773a3fb74.tar.zst
gsoc2013-epiphany-0e419aaf06e325e0ad4b6c7a9929e66773a3fb74.zip
Make sure we stop the drag check also when button is released while the
2004-07-11 Marco Pesenti Gritti <marco@gnome.org> * src/bookmarks/ephy-topic-action.c: (stop_drag_check), (button_release_cb), (button_press_cb): Make sure we stop the drag check also when button is released while the menu grab is still in effect.
Diffstat (limited to 'src')
-rw-r--r--src/bookmarks/ephy-topic-action.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/bookmarks/ephy-topic-action.c b/src/bookmarks/ephy-topic-action.c
index 80994db8f..5c9931671 100644
--- a/src/bookmarks/ephy-topic-action.c
+++ b/src/bookmarks/ephy-topic-action.c
@@ -56,6 +56,7 @@ struct EphyTopicActionPrivate
EphyNode *topic_node;
guint motion_handler;
+ guint release_handler;
gint drag_x;
gint drag_y;
};
@@ -632,7 +633,7 @@ drag_data_delete_cb (GtkWidget *widget, GdkDragContext *context,
remove_from_model (widget);
}
-static gboolean
+static void
stop_drag_check (EphyTopicAction *action, GtkWidget *widget)
{
if (action->priv->motion_handler)
@@ -640,10 +641,9 @@ stop_drag_check (EphyTopicAction *action, GtkWidget *widget)
g_signal_handler_disconnect (widget, action->priv->motion_handler);
action->priv->motion_handler = 0;
- return TRUE;
+ g_signal_handler_disconnect (widget, action->priv->release_handler);
+ action->priv->release_handler = 0;
}
-
- return FALSE;
}
static gboolean
@@ -798,7 +798,12 @@ button_release_cb (GtkWidget *widget,
if (event->button == 1)
{
stop_drag_check (action, widget);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), FALSE);
+
+ if (GTK_IS_TOGGLE_BUTTON (widget))
+ {
+ gtk_toggle_button_set_active
+ (GTK_TOGGLE_BUTTON (widget), FALSE);
+ }
}
return FALSE;
@@ -827,7 +832,10 @@ button_press_cb (GtkWidget *widget,
action->priv->motion_handler = g_signal_connect
(menu, "motion_notify_event",
G_CALLBACK (drag_motion_cb), action);
-
+ action->priv->release_handler = g_signal_connect
+ (menu, "button_release_event",
+ G_CALLBACK (button_release_cb), action);
+
return TRUE;
}
}