aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDiego Escalante Urrelo <descalante@igalia.com>2010-02-16 14:51:13 +0800
committerDiego Escalante Urrelo <descalante@igalia.com>2010-02-17 02:14:40 +0800
commit0a93c981821ba37765f271d87d6788370da5e409 (patch)
tree87baf4c822d2283efebf5ab79e3ce09f1a0d17aa /src
parent0e3eaec0ea23d4e4b2c006c82d92bb8a4027a726 (diff)
downloadgsoc2013-epiphany-0a93c981821ba37765f271d87d6788370da5e409.tar
gsoc2013-epiphany-0a93c981821ba37765f271d87d6788370da5e409.tar.gz
gsoc2013-epiphany-0a93c981821ba37765f271d87d6788370da5e409.tar.bz2
gsoc2013-epiphany-0a93c981821ba37765f271d87d6788370da5e409.tar.lz
gsoc2013-epiphany-0a93c981821ba37765f271d87d6788370da5e409.tar.xz
gsoc2013-epiphany-0a93c981821ba37765f271d87d6788370da5e409.tar.zst
gsoc2013-epiphany-0a93c981821ba37765f271d87d6788370da5e409.zip
Open links in new windows with control+shift+click
This should restore the old behaviour of modifiers completely. Bug #604950
Diffstat (limited to 'src')
-rw-r--r--src/ephy-window.c30
1 files changed, 24 insertions, 6 deletions
diff --git a/src/ephy-window.c b/src/ephy-window.c
index bc42ff3c3..91f99307a 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -2502,11 +2502,30 @@ policy_decision_required_cb (WebKitWebView *web_view,
return TRUE;
}
- /* Open in new tab for middle click or ctrl+click */
- if (reason == WEBKIT_WEB_NAVIGATION_REASON_LINK_CLICKED &&
- (button == 2 /* middle button */ ||
- (button == 1 && state == GDK_CONTROL_MASK) /* ctrl + left button */)) {
+ if (reason == WEBKIT_WEB_NAVIGATION_REASON_LINK_CLICKED) {
EphyEmbed *embed;
+ EphyNewTabFlags flags;
+
+ flags = EPHY_NEW_TAB_OPEN_PAGE;
+
+ /* New tab in new window for control+shift+click */
+ if (button == 1 &&
+ state == (GDK_SHIFT_MASK | GDK_CONTROL_MASK))
+ {
+ flags |= EPHY_NEW_TAB_IN_NEW_WINDOW;
+ }
+ /* New tab in existing window for middle click and
+ * control+click */
+ else if (button == 2 ||
+ (button == 1 && state == GDK_CONTROL_MASK))
+ {
+ flags |= EPHY_NEW_TAB_IN_EXISTING_WINDOW;
+ }
+ /* Those were our special cases, we won't handle this */
+ else
+ {
+ return FALSE;
+ }
embed = ephy_embed_container_get_active_child
(EPHY_EMBED_CONTAINER (window));
@@ -2515,8 +2534,7 @@ policy_decision_required_cb (WebKitWebView *web_view,
window,
embed,
request,
- EPHY_NEW_TAB_IN_EXISTING_WINDOW |
- EPHY_NEW_TAB_OPEN_PAGE,
+ flags,
EPHY_WEB_VIEW_CHROME_ALL, FALSE, 0);
return TRUE;