diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2004-05-20 02:42:22 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2004-05-20 02:42:22 +0800 |
commit | c26be9eaf445f04efd11ff3cb3daed38626b1b12 (patch) | |
tree | 92ae7f09f9ec0b7981675f676faa6cca8f09629e /src/toolbar.c | |
parent | f7d64a2da37e5d187d259fa6bb15e2a1e8e959d7 (diff) | |
download | gsoc2013-epiphany-c26be9eaf445f04efd11ff3cb3daed38626b1b12.tar gsoc2013-epiphany-c26be9eaf445f04efd11ff3cb3daed38626b1b12.tar.gz gsoc2013-epiphany-c26be9eaf445f04efd11ff3cb3daed38626b1b12.tar.bz2 gsoc2013-epiphany-c26be9eaf445f04efd11ff3cb3daed38626b1b12.tar.lz gsoc2013-epiphany-c26be9eaf445f04efd11ff3cb3daed38626b1b12.tar.xz gsoc2013-epiphany-c26be9eaf445f04efd11ff3cb3daed38626b1b12.tar.zst gsoc2013-epiphany-c26be9eaf445f04efd11ff3cb3daed38626b1b12.zip |
Open bookmark in new tab on middle-click. Fixes bug #106250.
2004-05-19 Christian Persch <chpe@cvs.gnome.org>
* src/bookmarks/ephy-bookmark-action.c: (activate_cb),
(button_press_cb), (button_release_cb), (connect_proxy),
(ephy_bookmark_action_class_init):
* src/toolbar.c: (go_location_cb):
Open bookmark in new tab on middle-click. Fixes bug #106250.
Diffstat (limited to 'src/toolbar.c')
-rwxr-xr-x | src/toolbar.c | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/src/toolbar.c b/src/toolbar.c index 0d52339ee..2a24815bd 100755 --- a/src/toolbar.c +++ b/src/toolbar.c @@ -166,7 +166,43 @@ arbitrary_url_notifier (GConfClient *client, static void go_location_cb (GtkAction *action, char *location, EphyWindow *window) { - ephy_window_load_url (window, location); + GdkEvent *event; + gboolean new_tab = FALSE; + + event = gtk_get_current_event (); + if (event != NULL) + { + if (event->type == GDK_BUTTON_RELEASE) + { + guint modifiers, button, state; + + modifiers = gtk_accelerator_get_default_mod_mask (); + button = event->button.button; + state = event->button.state; + + /* middle-click or control-click */ + if ((button == 1 && ((state & modifiers) == GDK_CONTROL_MASK)) || + (button == 2)) + { + new_tab = TRUE; + } + } + + gdk_event_free (event); + } + + if (new_tab) + { + ephy_shell_new_tab (ephy_shell, window, + ephy_window_get_active_tab (window), + location, + EPHY_NEW_TAB_OPEN_PAGE | + EPHY_NEW_TAB_IN_EXISTING_WINDOW); + } + else + { + ephy_window_load_url (window, location); + } } static void |