From ce869c629ba44e90bfe808d136625c32226ba91f Mon Sep 17 00:00:00 2001 From: stippi Date: Wed, 24 Feb 2010 21:00:55 +0000 Subject: [PATCH] Selecting or not selecting the newly opened tab never worked, since the "select" field was added to the NEW_WINDOW_REQUESTED message, and not passed on to the internal NEW_TAB message. Fixed this, and also added a check for the tertiary mouse button for regular navigation actions. This means clicking links with the middle mouse button opens in a background tab regard less if it would have opened a new page when clicked with the primary button. git-svn-id: http://svn.haiku-os.org/webpositive/webkit/trunk@199 94f232f2-1747-11df-bad5-a5bfde151594 --- src/apps/webpositive/LauncherWindow.cpp | 5 +++-- src/apps/webpositive/LauncherWindow.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/apps/webpositive/LauncherWindow.cpp b/src/apps/webpositive/LauncherWindow.cpp index f89037dc13..61522109f1 100644 --- a/src/apps/webpositive/LauncherWindow.cpp +++ b/src/apps/webpositive/LauncherWindow.cpp @@ -408,6 +408,7 @@ void LauncherWindow::MenusBeginning() void LauncherWindow::newTab(const BString& url, bool select) { +printf("newTab(%s, %d)\n", url.String(), select); // Executed in app thread (new BWebPage needs to be created in app thread). BWebView* webView = new BWebView("web_view"); webView->WebPage()->SetDownloadListener(m_downloadListener); @@ -435,7 +436,7 @@ void LauncherWindow::NavigationRequested(const BString& url, BWebView* view) { } -void LauncherWindow::NewWindowRequested(const BString& url) +void LauncherWindow::NewWindowRequested(const BString& url, bool primaryAction) { // Always open new windows in the application thread, since // creating a BWebView will try to grab the application lock. @@ -445,7 +446,7 @@ void LauncherWindow::NewWindowRequested(const BString& url) BMessage message(NEW_TAB); message.AddPointer("window", this); message.AddString("url", url); - message.AddBool("select", false); + message.AddBool("select", primaryAction); be_app->PostMessage(&message); } diff --git a/src/apps/webpositive/LauncherWindow.h b/src/apps/webpositive/LauncherWindow.h index c85530ec49..d2ad03c5cd 100644 --- a/src/apps/webpositive/LauncherWindow.h +++ b/src/apps/webpositive/LauncherWindow.h @@ -73,7 +73,7 @@ public: private: // WebPage notification API implementations virtual void NavigationRequested(const BString& url, BWebView* view); - virtual void NewWindowRequested(const BString& url); + virtual void NewWindowRequested(const BString& url, bool primaryAction); virtual void LoadNegotiating(const BString& url, BWebView* view); virtual void LoadCommited(const BString& url, BWebView* view); virtual void LoadProgress(float progress, BWebView* view);