From a150602b0f1b17573d179f8b63e85f3467a8068d Mon Sep 17 00:00:00 2001 From: stippi Date: Tue, 20 Apr 2010 15:44:10 +0000 Subject: [PATCH] Return early in BrowserWindow::DispatchMessage(), if the message was already handled. This would also fix return keys ending up in the URLTextView. git-svn-id: http://svn.haiku-os.org/webpositive/webkit/trunk@441 94f232f2-1747-11df-bad5-a5bfde151594 --- src/apps/webpositive/BrowserWindow.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/apps/webpositive/BrowserWindow.cpp b/src/apps/webpositive/BrowserWindow.cpp index e23bc229da..8ed76b199d 100644 --- a/src/apps/webpositive/BrowserWindow.cpp +++ b/src/apps/webpositive/BrowserWindow.cpp @@ -397,11 +397,13 @@ BrowserWindow::DispatchMessage(BMessage* message, BHandler* target) && message->FindInt32("modifiers", (int32*)&modifiers) == B_OK) { modifiers = modifiers & 0x000000ff; - if (bytes[0] == B_LEFT_ARROW && modifiers == B_COMMAND_KEY) + if (bytes[0] == B_LEFT_ARROW && modifiers == B_COMMAND_KEY) { PostMessage(GO_BACK); - else if (bytes[0] == B_RIGHT_ARROW && modifiers == B_COMMAND_KEY) + return; + } else if (bytes[0] == B_RIGHT_ARROW && modifiers == B_COMMAND_KEY) { PostMessage(GO_FORWARD); - else if (target == fURLInputGroup->TextView()) { + return; + } else if (target == fURLInputGroup->TextView()) { // Handle B_RETURN in the URL text control. This is the easiest // way to react *only* when the user presses the return key in the // address bar, as opposed to trying to load whatever is in there @@ -413,6 +415,7 @@ BrowserWindow::DispatchMessage(BMessage* message, BHandler* target) fURLInputGroup->GoButton()->Invoke(); snooze(1000); fURLInputGroup->GoButton()->SetValue(B_CONTROL_OFF); + return; } } }