aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAdam Hooper <adamh@src.gnome.org>2005-01-09 09:52:18 +0800
committerAdam Hooper <adamh@src.gnome.org>2005-01-09 09:52:18 +0800
commit83164008c7b412660d812edb9b5689dea519562d (patch)
treed17939d0982edcc33aad3db34ef844a099765ebd /src
parent26655a0641769e2b8d27980b9dc463f5282a489c (diff)
downloadgsoc2013-epiphany-83164008c7b412660d812edb9b5689dea519562d.tar
gsoc2013-epiphany-83164008c7b412660d812edb9b5689dea519562d.tar.gz
gsoc2013-epiphany-83164008c7b412660d812edb9b5689dea519562d.tar.bz2
gsoc2013-epiphany-83164008c7b412660d812edb9b5689dea519562d.tar.lz
gsoc2013-epiphany-83164008c7b412660d812edb9b5689dea519562d.tar.xz
gsoc2013-epiphany-83164008c7b412660d812edb9b5689dea519562d.tar.zst
gsoc2013-epiphany-83164008c7b412660d812edb9b5689dea519562d.zip
Don't store more than 5 hidden popups. Fixes bug #160863.
Diffstat (limited to 'src')
-rw-r--r--src/ephy-tab.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/ephy-tab.c b/src/ephy-tab.c
index a76f2b051..87eb8ac1a 100644
--- a/src/ephy-tab.c
+++ b/src/ephy-tab.c
@@ -65,6 +65,8 @@
#define CONF_LOCKDOWN_DISABLE_JAVASCRIPT_CHROME "/apps/epiphany/lockdown/disable_javascript_chrome"
+#define MAX_HIDDEN_POPUPS 5
+
struct _EphyTabPrivate
{
char *status_message;
@@ -504,7 +506,25 @@ popups_manager_add (EphyTab *tab,
tab->priv->hidden_popups = g_slist_prepend
(tab->priv->hidden_popups, popup);
- g_object_notify (G_OBJECT (tab), "hidden-popup-count");
+ if (popup_blocker_n_hidden (tab) > MAX_HIDDEN_POPUPS) /* bug #160863 */
+ {
+ /* Remove the oldest popup */
+ GSList *l = tab->priv->hidden_popups;
+
+ while (l->next->next != NULL)
+ {
+ l = l->next;
+ }
+
+ popup = (PopupInfo *) l->next->data;
+ popups_manager_free_info (popup);
+
+ l->next = NULL;
+ }
+ else
+ {
+ g_object_notify (G_OBJECT (tab), "hidden-popup-count");
+ }
}
static gboolean