[epiphany] Avoid ending up with stuck URL-entry statusbar messages



commit 71ec9b46c22a8c5f6fa174aed77c54006e9089ea
Author: Xan Lopez <xan gnome org>
Date:   Tue May 18 15:53:01 2010 +0200

    Avoid ending up with stuck URL-entry statusbar messages
    
    Turns out we can get two enter messages in a row followed by just one
    leave message, which will make the statusbar get stuck with a message
    forever. As a solution do not allow two enter messages to be processed
    unless we have gone through the corresponding leave message.

 src/ephy-window.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/ephy-window.c b/src/ephy-window.c
index b5d7434..d49b3f1 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -1255,7 +1255,11 @@ tool_item_enter_cb (GtkWidget *proxy,
 		    GdkEventCrossing *event,
 		    EphyWindow *window)
 {
-	if (event->mode == GDK_CROSSING_NORMAL)
+	gboolean repeated;
+
+	repeated = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (proxy), "ephy-window-enter-event"));
+	
+	if (event->mode == GDK_CROSSING_NORMAL && repeated == FALSE)
 	{
 		GtkToolItem *item;
 		GtkAction *action;
@@ -1271,6 +1275,7 @@ tool_item_enter_cb (GtkWidget *proxy,
 		{
 			EphyWebView *view = ephy_window_get_active_web_view (window);
 			ephy_web_view_statusbar_push (view, window->priv->help_message_cid, message);
+			g_object_set_data (G_OBJECT (proxy), "ephy-window-enter-event", GINT_TO_POINTER (TRUE));
 			g_free (message);
 		}
 	}
@@ -1287,6 +1292,7 @@ tool_item_leave_cb (GtkWidget *proxy,
 	{
 		EphyWebView *view = ephy_window_get_active_web_view (window);
 		ephy_web_view_statusbar_pop (view, window->priv->help_message_cid);
+		g_object_set_data (G_OBJECT (proxy), "ephy-window-enter-event", GINT_TO_POINTER (FALSE));
 	}
 	
 	return FALSE;



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