Middle-click paste doesn't work under Mac OS X when middlemouse.paste is true

RESOLVED FIXED in mozilla11

Status

()

Core
Editor
RESOLVED FIXED
10 years ago
6 years ago

People

(Reporter: Vincent Lefevre, Assigned: masayuki)

Tracking

Trunk
mozilla11
All
Mac OS X
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

10 years ago
User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6
Build Identifier: 

As documented in http://kb.mozillazine.org/Middlemouse.paste, 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.
This is a problem with both Firefox 2.0.0.6 and yesterday's Minefield
nightly, and so (presumably) with both Cocoa widgets and Mac widgets.
Status: UNCONFIRMED → NEW
Ever confirmed: true

Updated

9 years ago
Assignee: jag → nobody
ludo, can you reproduce?
MacOS X doesn't have a clipboard for primary selection.
http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ApplicationKit/Classes/NSPasteboard_Class/Reference/Reference.html

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

# And we should get rid of #ifdef from the nsEditorEventHandler.cpp.
Status: NEW → ASSIGNED
Component: XUL → Editor
QA Contact: xptoolkit.widgets → editor
Hardware: PowerPC → All
Depends on: 674770
Created attachment 570206 [details] [diff] [review]
Patch
Assignee: nobody → masayuki
Attachment #570206 - Flags: review?(ehsan)
Comment on attachment 570206 [details] [diff] [review]
Patch

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;
>  
> +static NS_DEFINE_CID(kCClipboardCID, NS_CLIPBOARD_CID);

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("@mozilla.org/widget/clipboard;1", &rv).
Created attachment 577120 [details] [diff] [review]
Patch
Attachment #570206 - Attachment is obsolete: true
Attachment #577120 - Flags: review?(ehsan)
Attachment #570206 - Flags: review?(ehsan)
Comment on attachment 577120 [details] [diff] [review]
Patch

Looks great, thanks!
Attachment #577120 - Flags: review?(ehsan) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/f739602236da
Flags: in-testsuite+
Whiteboard: [inbound]
Target Milestone: --- → mozilla11
https://hg.mozilla.org/mozilla-central/rev/f739602236da
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Whiteboard: [inbound]
You need to log in before you can comment on or make changes to this bug.