GNOME Bugzilla – Bug 571794
Improve smart bookmarks click behavior
Last modified: 2011-12-23 17:47:21 UTC
Currently, smart bookmarks are only really usable with the keyboard. Clicking on one of them initiates a search with an empty parameter, which is useless. You can middle-click on the entry but it requires using the keyboard to actually activate it. I propose the following behavior: * When left-clicking on the button, initiate a search using the contents of the entry as parameter. * When middle-clicking on the button, load a new tab with the contents of the clipboard as parameter. * When middle-clicking on the entry, keep the current behavior of pasting the clipboard into it. This makes both actions (activate and activate in new tab) accessible by only the mouse: either you middle-click on the entry and then click on the button, either you middle-click on the button directly. It sounds weird to have one action (middle click) have two consequences (paste and new tab), but it’s actually the most intuitive thing to do since this button has actually two meanings in epiphany.
Created attachment 128742 [details] [review] Patch for epiphany 2.24.3
Created attachment 129145 [details] [review] Patch for epiphany 2.24 / trunk that doesn’t crash It seems the original patch causes crashes as text can be NULL (see bug#572445). This version should not exhibit the bug.
@Xan, could you review this please?
I think changing what the button does might make sense, but I don't think making it do different things when clicked with the left or middle button is a good idea. A patch to make it open a page with the contents of the entry when clicking on the button (either in the same or a new tab, depending on the button), would make more sense IMHO.
Created attachment 140332 [details] [review] Simplified patch for epiphany 2.26 Thanks for the suggestions, Xan. It makes indeed much more sense to correctly split the paste behavior (on the entry) from the this-tab/new-tab behavior (on the button). This much simpler patch should produced the desired result.
This callback is used also with a menu item, so I don't think this digging into the hierarchy thing when !EDITABLE you are doing is right. What I would do here is to create a callback just for the button case, where you pass a struct with the action and the entry as user data.
Since currently there is no direct relationship between the button and the entry, this would require adding a new property to the button widget, linking to the entry. Are you fine with such a change?
Sorry, I misread your suggestion. Please forget comment#7.
Well actually, my fault, because you'd be lacking a sane place to free the struct. So you'd need to set the struct as the object or data or something, and since you are going to do that you'd better off setting just the entry as the object data of the button IMHO. Sounds good?
This is no/won't be longer possible with Epiphany 3.4