diff options
author | Martin Robinson <mrobinson@webkit.org> | 2011-11-27 18:34:07 +0800 |
---|---|---|
committer | Xan Lopez <xan@igalia.com> | 2011-11-30 02:49:21 +0800 |
commit | d1d329e512877f34d2109e65a267c883e0c87b06 (patch) | |
tree | b1ddb0f67a492835f30b6145ff692bb05f9a48b1 | |
parent | af225d4e73650098b5e2b860ba3747ee421ea52e (diff) | |
download | gsoc2013-epiphany-d1d329e512877f34d2109e65a267c883e0c87b06.tar gsoc2013-epiphany-d1d329e512877f34d2109e65a267c883e0c87b06.tar.gz gsoc2013-epiphany-d1d329e512877f34d2109e65a267c883e0c87b06.tar.bz2 gsoc2013-epiphany-d1d329e512877f34d2109e65a267c883e0c87b06.tar.lz gsoc2013-epiphany-d1d329e512877f34d2109e65a267c883e0c87b06.tar.xz gsoc2013-epiphany-d1d329e512877f34d2109e65a267c883e0c87b06.tar.zst gsoc2013-epiphany-d1d329e512877f34d2109e65a267c883e0c87b06.zip |
Delay hiding the statusbar overlay when the status text changes.
Delaying the statusbar hide prevents the overlay from flickering
when moving the cursor over a series of links.
-rw-r--r-- | embed/ephy-embed.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/embed/ephy-embed.c b/embed/ephy-embed.c index 623c659e8..36c6126b4 100644 --- a/embed/ephy-embed.c +++ b/embed/ephy-embed.c @@ -87,6 +87,7 @@ struct _EphyEmbedPrivate guint seq_message_id; guint tab_message_id; + guint pop_statusbar_later_source_id; }; G_DEFINE_TYPE (EphyEmbed, ephy_embed, GTK_TYPE_BOX) @@ -439,6 +440,17 @@ _ephy_embed_set_statusbar_label (EphyEmbed *embed, const char *label) gtk_widget_show (parent); } +static gboolean +pop_statusbar_later_cb (gpointer data) +{ + EphyEmbed *embed = EPHY_EMBED (data); + EphyEmbedPrivate *priv = embed->priv; + + ephy_embed_statusbar_pop (embed, priv->tab_message_id); + priv->pop_statusbar_later_source_id = 0; + return FALSE; +} + static void status_message_notify_cb (EphyWebView *view, GParamSpec *pspec, EphyEmbed *embed) { @@ -449,10 +461,19 @@ status_message_notify_cb (EphyWebView *view, GParamSpec *pspec, EphyEmbed *embed priv = embed->priv; - ephy_embed_statusbar_pop (embed, priv->tab_message_id); + if (message) { + if (priv->pop_statusbar_later_source_id) { + g_source_remove (priv->pop_statusbar_later_source_id); + priv->pop_statusbar_later_source_id = 0; + } - if (message) + ephy_embed_statusbar_pop (embed, priv->tab_message_id); ephy_embed_statusbar_push (embed, priv->tab_message_id, message); + } else { + /* A short timeout before hiding the statusbar ensures that while moving + over a series of links, the overlay widget doesn't flicker on and off. */ + priv->pop_statusbar_later_source_id = g_timeout_add (250, pop_statusbar_later_cb, embed); + } } static void |