diff options
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/browser.c | 15 | ||||
-rw-r--r-- | desktop/browser.h | 2 | ||||
-rw-r--r-- | desktop/frames.c | 4 | ||||
-rw-r--r-- | desktop/gui.h | 2 | ||||
-rw-r--r-- | desktop/history_core.c | 2 |
5 files changed, 14 insertions, 11 deletions
diff --git a/desktop/browser.c b/desktop/browser.c index 899457b74..ce9e79ce1 100644 --- a/desktop/browser.c +++ b/desktop/browser.c @@ -140,7 +140,7 @@ static void browser_window_scroll_box(struct browser_window *bw, struct browser_window *browser_window_create(const char *url, struct browser_window *clone, - const char *referer, bool history_add) + const char *referer, bool history_add, bool new_tab) { struct browser_window *bw; @@ -156,12 +156,12 @@ struct browser_window *browser_window_create(const char *url, /* window characteristics */ bw->browser_window_type = BROWSER_WINDOW_NORMAL; - bw->scrolling = SCROLLING_YES; + bw->scrolling = SCROLLING_AUTO; bw->border = true; bw->no_resize = true; /* gui window */ - if ((bw->window = gui_create_browser_window(bw, clone)) == NULL) { + if ((bw->window = gui_create_browser_window(bw, clone, new_tab)) == NULL) { browser_window_destroy(bw); return NULL; } @@ -1096,7 +1096,7 @@ struct browser_window *browser_window_find_target(struct browser_window *bw, con /* handle reserved keywords */ if ((new_window) || ((target == TARGET_BLANK) || (!strcasecmp(target, "_blank")))) { - bw_target = browser_window_create(NULL, bw, NULL, false); + bw_target = browser_window_create(NULL, bw, NULL, false, false); if (!bw_target) return bw; return bw_target; @@ -1127,7 +1127,7 @@ struct browser_window *browser_window_find_target(struct browser_window *bw, con /* we require a new window using the target name */ if (!option_target_blank) return bw; - bw_target = browser_window_create(NULL, bw, NULL, false); + bw_target = browser_window_create(NULL, bw, NULL, false, false); if (!bw_target) return bw; @@ -1539,7 +1539,10 @@ void browser_window_mouse_action_html(struct browser_window *bw, /* force download of link */ browser_window_go_post(bw, url, 0, 0, false, c->url, true, true, 0); - + } else if (mouse & BROWSER_MOUSE_CLICK_1 && + mouse & BROWSER_MOUSE_MOD_2) { + /* open link in new tab */ + browser_window_create(url, bw, c->url, true, true); } else if (mouse & BROWSER_MOUSE_CLICK_2 && mouse & BROWSER_MOUSE_MOD_1) { free(browser_window_href_content.url); diff --git a/desktop/browser.h b/desktop/browser.h index 45a930c6a..a3a10b9f3 100644 --- a/desktop/browser.h +++ b/desktop/browser.h @@ -214,7 +214,7 @@ extern bool browser_reformat_pending; struct browser_window * browser_window_create(const char *url, struct browser_window *clone, const char *referer, - bool history_add); + bool history_add, bool new_tab); void browser_window_initialise_common(struct browser_window *bw, struct browser_window *clone); void browser_window_go(struct browser_window *bw, const char *url, diff --git a/desktop/frames.c b/desktop/frames.c index 0244a0045..a59980d98 100644 --- a/desktop/frames.c +++ b/desktop/frames.c @@ -93,7 +93,7 @@ void browser_window_create_iframes(struct browser_window *bw, window->parent = bw; /* gui window */ - window->window = gui_create_browser_window(window, bw); + window->window = gui_create_browser_window(window, bw, false); } /* calculate dimensions */ @@ -201,7 +201,7 @@ void browser_window_create_frameset(struct browser_window *bw, window->parent = bw; /* gui window */ - window->window = gui_create_browser_window(window, bw); + window->window = gui_create_browser_window(window, bw, false); if (window->name) LOG(("Created frame '%s'", window->name)); diff --git a/desktop/gui.h b/desktop/gui.h index c6b1b49cb..de6eae3c5 100644 --- a/desktop/gui.h +++ b/desktop/gui.h @@ -66,7 +66,7 @@ void gui_poll(bool active); void gui_quit(void); struct gui_window *gui_create_browser_window(struct browser_window *bw, - struct browser_window *clone); + struct browser_window *clone, bool new_tab); void gui_window_destroy(struct gui_window *g); void gui_window_set_title(struct gui_window *g, const char *title); void gui_window_redraw(struct gui_window *g, int x0, int y0, int x1, int y1); diff --git a/desktop/history_core.c b/desktop/history_core.c index 9fa085d8d..bcc6fc190 100644 --- a/desktop/history_core.c +++ b/desktop/history_core.c @@ -454,7 +454,7 @@ void history_go(struct browser_window *bw, struct history *history, if (new_window) { current = history->current; history->current = entry; - browser_window_create(url, bw, 0, false); + browser_window_create(url, bw, 0, false, false); history->current = current; } else { history->current = entry; |