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 345934 - URL dropdown not compatible with ctrl-enter
URL dropdown not compatible with ctrl-enter
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: Interface
2.14.x
Other All
: Normal minor
: ---
Assigned To: Epiphany Maintainers
Marco Pesenti Gritti
: 314754 328293 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-06-26 06:33 UTC by Johannes Berg
Modified: 2006-07-20 10:26 UTC
See Also:
GNOME target: ---
GNOME version: 2.13/2.14


Attachments
patch almost fixing this problem (1.60 KB, patch)
2006-07-08 02:04 UTC, Johannes Berg
none Details | Review
patch fixing it for me (1.97 KB, patch)
2006-07-08 12:22 UTC, Johannes Berg
none Details | Review
another patch (2.03 KB, patch)
2006-07-09 22:15 UTC, Johannes Berg
none Details | Review
patch (5.10 KB, patch)
2006-07-10 14:50 UTC, Christian Persch
none Details | Review
updated patch (5.05 KB, patch)
2006-07-10 17:06 UTC, Christian Persch
committed Details | Review
additional patch (6.25 KB, patch)
2006-07-12 19:31 UTC, Christian Persch
none Details | Review
only the relevant parts (2.18 KB, patch)
2006-07-12 19:33 UTC, Christian Persch
committed Details | Review

Description Johannes Berg 2006-06-26 06:33:32 UTC
When you start typing a URL you get the URL dropdown that shows matching history. Often, I find myself wanting to open an old URL in a new tab, which I can do by hitting ctrl-enter while the URL is in the entry field.

However, I've gotten used to only partially typing the URL, selecting the URL in the dropdown with the arrow keys, and then hitting ctrl-enter.

That'll look like this text-screenshot ;)

URL: http://example.com/par                           < entry field
    |http://example.com/partial                    |
    |http://example.com/partial/12345              |  < selected line
    | ...                                          |

Now when I have selected the 12345 entry and hit ctrl-enter I would expect it to open the 12345 entry in a new tab (I think galeon does this and that's why I'm used to it), but it actually opens just the 'par' entry that I typed.

Other information:
Comment 1 Johannes Berg 2006-07-08 00:12:22 UTC
The same, btw, happens if you select a different search from the list (one of the smart bookmarks).
Comment 2 Johannes Berg 2006-07-08 02:04:32 UTC
Created attachment 68605 [details] [review]
patch almost fixing this problem

This patch makes it behave like I'd expect, open a new tab with whatever I had selected. Actually, I probably expect it to jump to the new tab too, and the reset code doesn't seem to work properly (it resets, but then displays the other thing again once you switch tabs and back).
Comment 3 Johannes Berg 2006-07-08 10:49:59 UTC
Heh

+		if (ephy_link_flags_from_current_event ()
+		    | (EPHY_LINK_NEW_WINDOW|EPHY_LINK_NEW_TAB))

should of course be

+		if (ephy_link_flags_from_current_event ()
+		    & (EPHY_LINK_NEW_WINDOW|EPHY_LINK_NEW_TAB))

But I haven't built it yet to see if it helps.
Comment 4 Johannes Berg 2006-07-08 12:22:49 UTC
Created attachment 68620 [details] [review]
patch fixing it for me

This patch seems to work properly including resetting the typed URL on a tab and having it correct when you switch back and forth. I'd like to actually activate the tab right away though, but this is a more intrusive change I think.
Comment 5 Johannes Berg 2006-07-08 12:33:04 UTC
patch also applies against current CVS with some offset.
Comment 6 Christian Persch 2006-07-08 22:54:29 UTC
So it seems that ctrl-enter does indeed put the selected text in the entry... so I think just moving the keypress handler from g_signal_connect to g_signal_connect_after should also work and be a simpler patch?
Comment 7 Johannes Berg 2006-07-09 09:46:50 UTC
But will that also work with completion actions (as in the different search types) you can have there?
Comment 8 Christian Persch 2006-07-09 12:08:11 UTC
At least in testentrycompletion Ctrl-Enter does activate the action, yes. You'll need to add the flags in src/ephy-location-entry.c:action_activated_cb of course.
Comment 9 Johannes Berg 2006-07-09 21:51:40 UTC
I guess I just have to try this (not familiar with gtk at all), but it seems to me that moving it to g_signal_connect_after would sort of defeat the point of the keypress handler because its return value is important in that it returns TRUE and stops the event from propagating further if the user had pressed ctrl (+shift), which means that we don't need to reset.

But then, if I move it to _after, the event will again propagate through so that I'd still have to do the reset stuff, just in a different place.

Ah, I guess I see what you mean -- I can then put the reset into the keypress handler... But that'll only work if g_signal_emit_by_name actually calls the handlers right away instead of queuing them up (I assume it does, will play with it tomorrow)
Comment 10 Johannes Berg 2006-07-09 22:15:11 UTC
Created attachment 68689 [details] [review]
another patch

Well, I quickly played with it. This makes it almost work, but the typed_address remains set to whatever I enter, and isn't reset by opening a new window/tab. And I have no idea how to reset the typed address from the location-entry code (I'd have to trigger a user-changed signal but from the entry, not the lentry, and with the right action. I think.)
Comment 11 Christian Persch 2006-07-09 22:40:19 UTC
Hmm I see the problem... the 'reset' comes before the 'activate' in this case so it's useless. You could try ephy_location_entry_reset from ephy-location-action's activate/action_activate callbacks.
Comment 12 Johannes Berg 2006-07-10 05:35:18 UTC
Ah, but then I have the same problem as in the first patch, that I need a reference to the location-entry and don't have one, so again I'd need to pass a pointer around. Or am I missing something?
Comment 13 Christian Persch 2006-07-10 14:50:05 UTC
Created attachment 68719 [details] [review]
patch

This was a bit more involved than I'd thought...

Can you test this patch please?
Comment 14 Christian Persch 2006-07-10 17:06:29 UTC
Created attachment 68729 [details] [review]
updated patch

Also fixes middle-click.
Comment 15 Christian Persch 2006-07-10 19:26:03 UTC
Committed to HEAD and gnome-2-14. Can you verify it fixes all cases? Thanks for the initial patch!
Comment 16 Johannes Berg 2006-07-11 14:22:03 UTC
No, that doesn't fix it completely. Try it:
 * enter anything and select any action
 * press ctrl-enter
 * go to the new tab
 * go back to the old tab
note that whatever you entered is in the location entry instead of the URL of the page.
Comment 17 Christian Persch 2006-07-11 19:19:05 UTC
Right, that's a problem with ephy_location_entry_reset which also occurs when you just reset with ESC...
Comment 18 Christian Persch 2006-07-12 19:31:34 UTC
Created attachment 68834 [details] [review]
additional patch

This should fix the remaining problem.
Comment 19 Christian Persch 2006-07-12 19:33:16 UTC
Created attachment 68835 [details] [review]
only the relevant parts
Comment 20 Christian Persch 2006-07-18 14:19:48 UTC
*** Bug 314754 has been marked as a duplicate of this bug. ***
Comment 21 Christian Persch 2006-07-18 14:20:00 UTC
*** Bug 328293 has been marked as a duplicate of this bug. ***
Comment 22 Johannes Berg 2006-07-18 14:34:17 UTC
Good point, I never noticed it also happens when you press just ESC.

But with these two patches, it works perfectly, thank you!
Comment 23 Christian Persch 2006-07-20 10:26:13 UTC
Checked in.

Thanks for the bug report, the patches and the testing!