Last Comment Bug 392159 - Middle-click paste doesn't work under Mac OS X when middlemouse.paste is true
: Middle-click paste doesn't work under Mac OS X when middlemouse.paste is true
Product: Core
Classification: Components
Component: Editor (show other bugs)
: Trunk
: All Mac OS X
-- normal (vote)
: mozilla11
Assigned To: Masayuki Nakano [:masayuki]
: Makoto Kato [:m_kato]
Depends on: 674770
  Show dependency treegraph
Reported: 2007-08-14 02:16 PDT by Vincent Lefevre
Modified: 2011-11-30 03:59 PST (History)
8 users (show)
masayuki: in‑testsuite+
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

Patch (5.87 KB, patch)
2011-10-28 01:11 PDT, Masayuki Nakano [:masayuki]
no flags Details | Diff | Splinter Review
Patch (4.93 KB, patch)
2011-11-26 19:52 PST, Masayuki Nakano [:masayuki]
ehsan: review+
Details | Diff | Splinter Review

Description User image Vincent Lefevre 2007-08-14 02:16:29 PDT
User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv: Gecko/20070725 Firefox/
Build Identifier: 

As documented in, I've set middlemouse.paste to true to be able to paste with the middle button, but this has no effect.

Reproducible: Always

Steps to Reproduce:
1. Set middlemouse.paste to true.
2. Copy something to the clipboard.
3. Middle-click over an editable text field.
Actual Results:  
Nothing happens.

Expected Results:  
The contents of the clipboard should be pasted, like under Linux.
Comment 1 User image Steven Michaud [:smichaud] (Retired) 2007-08-14 08:26:57 PDT
This is a problem with both Firefox and yesterday's Minefield
nightly, and so (presumably) with both Cocoa widgets and Mac widgets.
Comment 2 User image Wayne Mery (:wsmwk, NI for questions) 2010-08-04 07:56:32 PDT
ludo, can you reproduce?
Comment 3 User image Masayuki Nakano [:masayuki] 2011-10-27 19:27:38 PDT
MacOS X doesn't have a clipboard for primary selection.

So, we should use global clipboard for the middle paste.

# And we should get rid of #ifdef from the nsEditorEventHandler.cpp.
Comment 4 User image Masayuki Nakano [:masayuki] 2011-10-28 01:11:59 PDT
Created attachment 570206 [details] [diff] [review]
Comment 5 User image :Ehsan Akhgari 2011-11-25 08:53:05 PST
Comment on attachment 570206 [details] [diff] [review]

Review of attachment 570206 [details] [diff] [review]:

r=me with the nits below.

::: editor/libeditor/base/nsEditorEventListener.cpp
@@ +59,5 @@
>  // Drag & Drop, Clipboard
>  #include "nsIServiceManager.h"
>  #include "nsIClipboard.h"
> +#include "nsWidgetsCID.h"

This can be removed (see below).

@@ +75,5 @@
>  #include "nsIBidiKeyboard.h"
>  using namespace mozilla;

This can be removed (see below).

@@ +572,5 @@
>          mailEditor = do_QueryObject(mEditor);
> +      PRInt32 clipboard = nsIClipboard::kGlobalClipboard;
> +      nsCOMPtr<nsIClipboard> clipboardService =
> +        do_GetService(kCClipboardCID, &rv);

Please use do_GetService(";1", &rv).
Comment 6 User image Masayuki Nakano [:masayuki] 2011-11-26 19:52:33 PST
Created attachment 577120 [details] [diff] [review]
Comment 7 User image :Ehsan Akhgari 2011-11-29 11:34:13 PST
Comment on attachment 577120 [details] [diff] [review]

Looks great, thanks!
Comment 8 User image Masayuki Nakano [:masayuki] 2011-11-29 18:59:11 PST
Comment 9 User image Marco Bonardo [::mak] 2011-11-30 03:59:35 PST

Note You need to log in before you can comment on or make changes to this bug.