After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 300344 - Double click on the "popup blocked" icon must allow popup
Double click on the "popup blocked" icon must allow popup
Status: RESOLVED OBSOLETE
Product: epiphany
Classification: Core
Component: Interface
unspecified
Other All
: Normal enhancement
: ---
Assigned To: Diego Escalante Urrelo (not reading bugmail)
Epiphany Maintainers
Depends on:
Blocks: 755292
 
 
Reported: 2005-04-12 15:29 UTC by Lionel Dricot
Modified: 2015-09-30 02:00 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
Adds doubleclick behavior to the popup blocked icon (1.43 KB, patch)
2006-04-19 17:09 UTC, Diego Escalante Urrelo (not reading bugmail)
needs-work Details | Review
Implements popups-manager-clicked and changes the approach to detect double clicks (3.67 KB, patch)
2006-04-20 00:45 UTC, Diego Escalante Urrelo (not reading bugmail)
reviewed Details | Review
Updated, doesn't work however (7.58 KB, patch)
2007-01-10 14:40 UTC, Diego Escalante Urrelo (not reading bugmail)
needs-work Details | Review
New version, this one works :) (8.58 KB, patch)
2007-01-19 04:52 UTC, Diego Escalante Urrelo (not reading bugmail)
none Details | Review
Implements the padlock functionality and the popups func. (7.58 KB, patch)
2007-01-23 20:01 UTC, Diego Escalante Urrelo (not reading bugmail)
none Details | Review
Like the previous patch, but this one is complete. (8.54 KB, patch)
2007-02-01 20:37 UTC, Diego Escalante Urrelo (not reading bugmail)
needs-work Details | Review
20071225_bgo_300344_popup-clicks.diff: uses its own signal and a popup menu (3.24 KB, patch)
2007-12-26 02:32 UTC, Diego Escalante Urrelo (not reading bugmail)
needs-work Details | Review

Description Lionel Dricot 2005-04-12 15:29:48 UTC
When a popup is blocked, a little and very informative icon appears at the
bottom left of epiphany.

If I want to enable popup for this web page, my first guess would be to
double-click on it or to right-click and find a menu that allow me to re-enable
popup.

The current behaviour is very disturbing.

Also, I suggest to leave the icon after middle clicked but without the red
circle. So re-double-clicking on it re-disable popups.

In fact, the expected behaviour is just like the Display > Popups Windows entry,
which is nice.

Other information:
Comment 1 Reinout van Schouwen 2005-04-15 12:33:14 UTC
This would be an enhancement...

However I'm not convinced that UI elements that are normally unsensitive, that
are there to provide status information, should become responsive to mouse clicks. 

Perhaps an extension that provides a notification area icon would be more suitable.
Comment 2 Lionel Dricot 2005-08-08 12:15:34 UTC
Reinout, what about the RSS extension then ?
It provides a clickable icon in the status bar and that's quite intuitive IMHO.

To be consistent, it could be an idea that _all_ icons in this status bar become
clickable.

For example, the lock could bring a dialog with the current certificate or just
tell you : "this site is not secure, do not provide valuable informations on
this page".
Comment 3 Raphael Slinckx 2006-04-06 22:54:31 UTC
Mayve this could be marked for gnome-love task ?
Comment 4 Diego Escalante Urrelo (not reading bugmail) 2006-04-19 17:09:07 UTC
Created attachment 63886 [details] [review]
Adds doubleclick behavior to the popup blocked icon

This was easily solved adding a callback for button-press-event.
I changed only ephy-window.c the function ephy_window_constructor and also added a ephy_popups_manager_frame_clicked_cb function.

However I'm not sure if I took the right approach. In the callback I get the GtkActionGroup ViewPopupWindows and toggle it to true. The other option (I think) is to do something like sync_tab_popups_allowed (), setting the current tab popups_allowed property. I think the ActionGroup is a better solution because that way there's 'sync' between the View menu and the icon (if I would use the property I don't know if the ViewPopupWindows menu would be automagically toggled).

I hope my patch is ok.
Comment 5 Christian Persch 2006-04-19 22:23:40 UTC
Thanks for the patch!

Setting the toggle action to 'active' is the right approach, yes.
But I don't like the way the signal is connected. IMHO this should all stay internal to ephy-statusbar: ephy-statusbar should declare a "popup-frame-clicked" (or so) signal that's emitted when the popup frame is clicked, and the ephy_popups_manager_frame_clicked_cb callback in ephy-window should only connect to that. ephy-statusbar would connect to button-press-event on the priv->popup_manager_evbox and emit the statusbar signal if it's the right kind of click. (You may need to add gtk_widget_add_events ( s->priv->popups_manager_evbox, GDK_BUTTON_PRESS_MASK); in create_statusbar_popups_manager_icon.)
Comment 6 Diego Escalante Urrelo (not reading bugmail) 2006-04-20 00:45:21 UTC
Created attachment 63911 [details] [review]
Implements popups-manager-clicked and changes the approach to detect double clicks

Well, I followed your advice and added the signal, connected to it in ephy-window.c. Just as you said chpe.

I hope the signal is ok, I copy pasted from ephy-find-toolbar.c/h.
Comment 7 Christian Persch 2006-05-11 13:05:37 UTC
The patch itself looks fine now, thanks! :)

However I'm having a few doubts about the functionality itself; it seems to me it'd be a bit surprising to just click the icon and have loads of windows open. Might it be better to show a popup menu with a list of the windows, or just one "Open popup windows"?
Comment 8 Diego Escalante Urrelo (not reading bugmail) 2006-05-12 08:47:52 UTC
That's a good idea, I think the popupmenu with just 'show popup windows (#)' would be nice.

However maybe someone has a better idea. A tooltip could be enough too.
Comment 9 Diego Escalante Urrelo (not reading bugmail) 2006-05-12 09:31:51 UTC
I just thought that a popup might be better because maybe options like firefox ones can be added (show popups, always allow for this site, allow just this time).

Mmmm...
Comment 10 Diego Escalante Urrelo (not reading bugmail) 2006-05-17 12:48:12 UTC
I was thinking about how to implement this and I think that I should add the UI definition inside the create_statusbar_popups_manager_icon() function in ephy-statusbar.c (since I only need to define it once) and leave the uimanager somehow exposed so I can manipulate it from outside (just like now with the new POPUPS_MANAGER_CLICKED signal), I'm not sure if I have to expose the uimanager or I can get it through some function that I haven't seen yet. 
I'm not sure, guidance will be appreciated.

I think that maybe this popups in statusbar idea could or could not be generalized to let other statusbar icons to give popups with possible actions (like the RSS plugin?). Maybe they should implement it themselves? I don't know, just a thought.
Comment 11 Lionel Dricot 2006-05-17 14:11:56 UTC
If there was any doubt about this feature, I think I have an argument.

I was on a popup-contained website without any toolbar. Then, I clicked on a link a I saw that a popup was blocked. I wanted to see this popup : no way !

So no more hesitation to have ;-)
Comment 12 Diego Escalante Urrelo (not reading bugmail) 2006-05-21 00:06:42 UTC
As discussed in IRC:

< chpe> hmm the lock widget isn't accessible outside statusbar... maybe ephy_statusbar_add_widget should have a string parameter, and the signal would deliver the string + the widget (to position the menu on), i.e. ("lock", <widget>), ("popup-frame", <widget>) etc?

I understand that I should emit a signal throwing the string and the widget, but I don't get what should I do with the string in ephy_statusbar_add_widget(). Wouldn't it be easier to throw this string when I connect:

gtk_widget_add_events (s->priv->popups_manager_evbox, GDK_BUTTON_PRESS_MASK);
g_signal_connect (s->priv->popups_manager_evbox, "button-press-event",
		G_CALLBACK (ephy_popups_manager_evbox_clicked_cb), s);

I think that should be easier. That way the callback connected to the 'clicked' signal would see which widget said 'im clicked' and do the corresponding actions (using a switch()?).

Comment 13 Christian Persch 2006-05-21 17:56:54 UTC
Yes.
Comment 14 Christian Persch 2006-08-17 14:04:42 UTC
Mass changing target 2.16 -> 2.18
Comment 15 Diego Escalante Urrelo (not reading bugmail) 2007-01-10 14:40:33 UTC
Created attachment 79951 [details] [review]
Updated, doesn't work however

:(
Comment 16 Christian Persch 2007-01-10 14:58:41 UTC
 static gboolean
 padlock_button_press_cb (GtkWidget *ebox,
                          GdkEventButton *event,
-			 EphyStatusbar *statusbar)
+			 EphyStatusbar *statusbar,
+			 const char *name)

That won't work, you can only have one datum here.

I guess it would be simplest to just add POPUPS_CLICKED in addition to LOCK_CLICKED and handle it in the same way?
Comment 17 Diego Escalante Urrelo (not reading bugmail) 2007-01-10 15:10:10 UTC
I don't use that function at all, it's actually printed as "warning declared but not used".
Check statusbar_icon_clicked_cb.
Comment 18 Christian Persch 2007-01-18 00:27:48 UTC
ephy_statusbar_get_widget leaks the |children| list, btw.

@@ -696,9 +701,8 @@ ephy_window_fullscreen (EphyWindow *wind
-	action = gtk_action_group_get_action (priv->action_group, "ViewPageSecurityInfo");
-	g_signal_connect_swapped (popup, "lock-clicked",
-				  G_CALLBACK (gtk_action_activate), action);
+	g_signal_connect_swapped (popup, "icon-clicked",
+				  G_CALLBACK (statusbar_icon_clicked_cb), NULL);

This looks wrong, since this concerns the fullscreen popup, not the statusbar.

+	g_signal_connect_swapped (priv->statusbar, "icon-clicked",
+				  G_CALLBACK (statusbar_icon_clicked_cb), NULL);

You get NULL in the callback because you use _swapped and pass NULL userdata. Just use normal g_signal_connect.
Comment 19 Diego Escalante Urrelo (not reading bugmail) 2007-01-18 01:11:38 UTC
It works now! Thanks :).

I'll now make all the icons do something.
Comment 20 Diego Escalante Urrelo (not reading bugmail) 2007-01-19 04:52:02 UTC
Created attachment 80679 [details] [review]
New version, this one works :)

Ok, this version works :).
I think it's fine in concept (the generic icon-clicked signal), now I'm not sure about the implementation. I don't see anything wrong but I'm not that savvy.

The lock icon reaction is still not in the patch, but it's fairly easy to add. Also I have noted that it's sort of slow to show all the hidden windows, I have noted that this is not related to the patch. It might be my pc however.
Comment 21 Diego Escalante Urrelo (not reading bugmail) 2007-01-23 20:01:21 UTC
Created attachment 81016 [details] [review]
Implements the padlock functionality and the popups func.

This makes the change transparent, I mean it implements everything that was there before I modified this. Now it's patch-improving time :).
Comment 22 Christian Persch 2007-01-29 21:55:20 UTC
The changes in create_caret_indicator are not part of this bug; if they contain more than just the variable rename please file them separately, else just drop them (or commit that part if you like).

+	g_print("name:%p ;widget:%p; statusbar:%p\n", name, widget, statusbar);
No g_print's in production code :)

+}
 #if !GTK_CHECK_VERSION (2, 11, 0)
Missing newline.

+	children = gtk_container_get_children
+		(GTK_CONTAINER (statusbar->priv->icon_container));
+	for (l = children; l != NULL; l = l->next)
+	{
+		if (GTK_IS_EVENT_BOX (l->data))
Why this check for event boxes?
+			if (widget_name == name)
+			{
+				g_print("%s\n", widget_name);
+				return l->data;
+			}

This leaks the |children| list.

Also the patch seems to miss the part that this bug is about, catching the click on the popup icon in ephy-window.c :)
Comment 23 Diego Escalante Urrelo (not reading bugmail) 2007-01-29 22:06:11 UTC
(In reply to comment #22)
> The changes in create_caret_indicator are not part of this bug; if they contain
> more than just the variable rename please file them separately, else just drop
> them (or commit that part if you like).
It was only to make the things a little more tidy, but I can commit it separately.

> 
> +       g_print("name:%p ;widget:%p; statusbar:%p\n", name, widget, statusbar);
> No g_print's in production code :)
> 
But they are so lovely!

> +}
>  #if !GTK_CHECK_VERSION (2, 11, 0)
> Missing newline.
> 
> +       children = gtk_container_get_children
> +               (GTK_CONTAINER (statusbar->priv->icon_container));
> +       for (l = children; l != NULL; l = l->next)
> +       {
> +               if (GTK_IS_EVENT_BOX (l->data))
> Why this check for event boxes?
If I remember correctly, because you neeed an event box to catch the clicks, but it's useless to have this here since the named widgets are only the event boxes. It's legacy from the old patch.

> +                       if (widget_name == name)
> +                       {
> +                               g_print("%s\n", widget_name);
> +                               return l->data;
> +                       }
> 
> This leaks the |children| list.
I'll change the logic because I don't like it very much either.

> 
> Also the patch seems to miss the part that this bug is about, catching the
> click on the popup icon in ephy-window.c :)
> 

That's weird, maybe I uploaded an older version. I'll check that.
Comment 24 Diego Escalante Urrelo (not reading bugmail) 2007-02-01 20:37:17 UTC
Created attachment 81699 [details] [review]
Like the previous patch, but this one is complete.

I have some doubts about the get_widget function, I don't know if it's smart to do it like that... :/.
Comment 25 Christian Persch 2007-03-12 12:25:17 UTC
Moving to 2.20 target due to feature and UI freeze for 2.18.
Comment 26 Christian Persch 2007-03-12 13:00:21 UTC
Thinking this through, a simple signal just for popup-clicked instead of the generalised clicked signal would be enought here.

Maybe better than just open the popups on double-click, instead we should open a menu on the icon, with 

Open popup "popup1"
Open popup "popup2"
...
---
Open all popups

?

That would give you better control, and also not open an unexpected number of windows.
Comment 27 Diego Escalante Urrelo (not reading bugmail) 2007-03-12 19:14:40 UTC
I agree with your idea, however I'm not sure about the signal. What are the pros and cons?
Comment 28 Christian Persch 2007-05-19 17:21:06 UTC
pro: less code, con: none? :)
Comment 29 Christian Persch 2007-08-27 20:43:00 UTC
Moving Severity:enhancement bugs off of 2.20 target.
Comment 30 Christian Persch 2007-12-24 18:22:16 UTC
Setting patch status according to comment 26 ff.
Comment 31 Diego Escalante Urrelo (not reading bugmail) 2007-12-26 02:32:46 UTC
Created attachment 101605 [details] [review]
20071225_bgo_300344_popup-clicks.diff: uses its own signal and a popup menu

First draft for this, my doubts so far:
 * how to iterate over the available popup windows
 * if it's ok how I used gtk_get_current_event_time()
 * if it's ok to create the menu by hand
 * if it's possible to selectively hide/show a popup
Comment 32 Christian Persch 2007-12-26 19:11:20 UTC
+static gboolean
+popups_button_press_cb (GtkWidget *widget,
+			   GdkEventButton *event,
+			   EphyStatusbar *statusbar)
+{
+	g_signal_emit (statusbar, signals[POPUPS_CLICKED], 0);
+	
+	return TRUE;
+}

Should copy what the padlock_btton_press_cb here and check for button and state modified to use GDK_2BUTTON_PRESS so you only emit on double click; you can remove the check in ephy-window then.

+		/* placeholder */
+		menu = gtk_menu_new ();
+		menuitem = gtk_menu_item_new_with_label ("Show popup window #1");
+		gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menuitem);

All ephy menus should be GtkUIManager based.

+		gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, 0, gtk_get_current_event_time ());

1, not 0 (since it was left-clicked)

Comment 33 Reinout van Schouwen 2008-07-28 20:53:52 UTC
@diego, don't forget about this bug? :)
Comment 34 Diego Escalante Urrelo (not reading bugmail) 2008-07-31 04:16:13 UTC
Hiya, I have a problem:

 static void
+popups_button_press_cb (EphyStatusbar *statusbar, 
+                       EphyWindow *window)
+{
+       EphyWindowPrivate *priv = window->priv;
+
+       GtkWidget *menubar;
+

window->priv is *always* 0x0, so I guess something is not really working :). Ideas?
Comment 35 Christian Persch 2008-07-31 12:09:06 UTC
+	g_signal_connect_swapped (priv->statusbar, "popups-clicked",
+				  G_CALLBACK (popups_button_press_cb), priv);

Did you change that to pass window as data, not priv ?
Comment 36 Diego Escalante Urrelo (not reading bugmail) 2008-07-31 23:17:54 UTC
Yeah. window->priv is always 0x0, and if i pass priv, it's 0x0 too.
Comment 37 Christian Persch 2008-08-01 11:04:42 UTC
This
+       g_signal_connect_swapped (priv->statusbar, "popups-clicked",
+                                 G_CALLBACK (popups_button_press_cb), priv);

doesn't fit with this:
+popups_button_press_cb (EphyStatusbar *statusbar, 
+                       EphyWindow *window)

If you connect_swapped, the callback args are reversed.
Comment 38 Diego Escalante Urrelo (not reading bugmail) 2008-08-01 12:14:10 UTC
hehe :).

Something I'm still wondering: how can I know the titles of the windows being blocked? I would like the menu to say "show <title>" and alike.
Comment 39 Diego Escalante Urrelo (not reading bugmail) 2008-08-03 01:12:43 UTC
To answer my question, there's popup_list in ephy-base-embed, although there's no clear way to get it out of there... I think I might have to add a property or maybe a getter? Not sure what would be better, haven't checked.
Comment 40 Diogo Campos 2015-09-30 01:16:14 UTC
I think Web doesn't have "popup blocker status/whitelist" anymore. So, obsolete?
Comment 41 Michael Catanzaro 2015-09-30 01:51:57 UTC
Yup. Nowadays popups simply don't work.