diff --git a/src/apps/webpositive/BrowserWindow.cpp b/src/apps/webpositive/BrowserWindow.cpp index acffde3387..784d4a2f6a 100644 --- a/src/apps/webpositive/BrowserWindow.cpp +++ b/src/apps/webpositive/BrowserWindow.cpp @@ -711,19 +711,6 @@ BrowserWindow::MenusBeginning() } -void -BrowserWindow::MenusEnded() -{ - // Reenabled the clipboard items, since we don't update them when - // the capabilities really change, but only when the menu is opened. - // The shortcuts need to work when the capabilities change without - // the Edit menu being opened meanwhile. - fCutMenuItem->SetEnabled(true); - fCopyMenuItem->SetEnabled(true); - fPasteMenuItem->SetEnabled(true); -} - - void BrowserWindow::CreateNewTab(const BString& url, bool select, BWebView* webView) { @@ -1451,7 +1438,10 @@ BrowserWindow::_UpdateClipboardItems() // BWebView doesn't have focus, we'll dispatch these message // there anyway. This works so fast that the user can never see // the wrong enabled state when the menu opens until the result - // message arrives. + // message arrives. The initial state needs to be enabled, since + // standard shortcut handling is always wrapped inside MenusBeginning() + // and MenusEnded(), and since we update items asynchronously, we need + // to have them enabled to begin with. fCutMenuItem->SetEnabled(true); fCopyMenuItem->SetEnabled(true); fPasteMenuItem->SetEnabled(true); diff --git a/src/apps/webpositive/BrowserWindow.h b/src/apps/webpositive/BrowserWindow.h index 0eda3126dd..73b6fdd48c 100644 --- a/src/apps/webpositive/BrowserWindow.h +++ b/src/apps/webpositive/BrowserWindow.h @@ -81,7 +81,6 @@ public: virtual void MessageReceived(BMessage* message); virtual bool QuitRequested(); virtual void MenusBeginning(); - virtual void MenusEnded(); void CreateNewTab(const BString& url, bool select, BWebView* webView = 0);