From 6014a35ed3cb767166d281566d3d7abc4d8ee932 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Tue, 2 Jul 2013 12:20:44 +0100 Subject: Implement entry launching. Currently only launches in new window. --- desktop/global_history.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'desktop/global_history.c') diff --git a/desktop/global_history.c b/desktop/global_history.c index ee09c1cdb..29d744e0a 100644 --- a/desktop/global_history.c +++ b/desktop/global_history.c @@ -648,6 +648,29 @@ static nserror global_history_tree_node_entry_cb( break; case TREE_MSG_NODE_LAUNCH: + { + nserror error; + struct browser_window *clone = NULL; + enum browser_window_nav_flags flags = + BROWSER_WINDOW_VERIFIABLE | + BROWSER_WINDOW_HISTORY | + BROWSER_WINDOW_TAB; + + /* TODO: Set clone window, to window that new tab appears in */ + + if (msg.data.node_launch.mouse & + (BROWSER_MOUSE_MOD_1 | BROWSER_MOUSE_MOD_2) || + clone == NULL) { + /* Shift or Ctrl launch, open in new window rather + * than tab. */ + flags ^= BROWSER_WINDOW_TAB; + } + + error = browser_window_create(flags, e->url, NULL, clone, NULL); + if (error != NSERROR_OK) { + warn_user(messages_get_errorcode(error), 0); + } + } break; } return NSERROR_OK; -- cgit v1.2.3