Closed
Bug 666254
Opened 13 years ago
Closed 2 years ago
nsIClipboard.emptyClipboard doesn't work
Categories
(Core :: Widget: Cocoa, defect)
Tracking
()
RESOLVED
FIXED
101 Branch
People
(Reporter: vb4guy, Assigned: m_kato)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; GTB7.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 1.1.4322; MS-RTC LM 8) Build Identifier: Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20100101 Firefox/5.0 According to https://developer.mozilla.org/en/nsIClipboard#emptyClipboard() calling the emptyClipboard method from nsIClipboard should clear the clipboard but it doesn't do so. This is happening in Windows XP Pro. Reproducible: Always Steps to Reproduce: Code: this.ClearData = function() { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); var nsIClipboard = Components.classes["@mozilla.org/widget/clipboard;1"].getService(Components.interfaces.nsIClipboard); nsIClipboard.emptyClipboard(nsIClipboard.kGlobalClipboard); // This doesn't appear to do anything }; Actual Results: The clipboard remains unmodified. Expected Results: The clipboard should be empty.
Comment 1•13 years ago
|
||
it clears the logic clipboard, releasing the owner, but as specified in the idl it doesn't clear the native clipboard.
Marco, Thanks for the quick response! Looking at the documentation again I see the paragraph that states that, but is there some other way to clear the native clipboard? -Mike
Comment 3•13 years ago
|
||
setData with a transferable that contains an unknown flavor should work, I don't know of other ways
I will try that but I think that this is a bug because the method takes the argument aWhichClipboard which can indicate the global/native clipboard.
Updated•11 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Updated•11 years ago
|
Component: XPCOM → Widget: Cocoa
Comment 5•11 years ago
|
||
Hmm, the nsClipboard implementation in widget/cocoa doesn't even override EmptyClipboard(), so no wonder that function does not work on OSX (since we're using the nsBaseClipboard implementation which does not talk to the OS.)
Comment 6•11 years ago
|
||
According to https://bugzilla.mozilla.org/show_bug.cgi?id=416459#c15 this is a feature, not a bug...
Flags: needinfo?(ehsan)
Comment 7•11 years ago
|
||
That's not true. The Windows implementation does indeed clear the clipboard contents. (Note that it's possible that there is no platform API on mac to do the same, I'm not very familiar with these APIs on mac.)
Flags: needinfo?(ehsan)
Updated•11 years ago
|
OS: Windows XP → Mac OS X
Hardware: x86 → All
Comment 8•3 years ago
|
||
Should this work nowadays? In bug 1261299 EmptyClipboard
for Mac OS was implemented.
Comment 9•3 years ago
|
||
@spohl: any idea? If it actually works, it could allow enabling existing tests, see https://searchfox.org/mozilla-central/search?q=%28666254%29&path=&case=true®exp=true.spohl
Flags: needinfo?(spohl.mozilla.bugs)
Assignee | ||
Comment 10•3 years ago
|
||
Actually, nsIClipboard.emptyClipboard
on macOS doesn't clear system
clipboard. Since other platforms clear it, so I would like to change to same
behaviour.
Also, since we have base class of nsIClipboard
, we should Inherit it to share
code.
Updated•3 years ago
|
Assignee: nobody → m_kato
Status: NEW → ASSIGNED
Updated•3 years ago
|
Flags: needinfo?(spohl.mozilla.bugs)
Comment 11•2 years ago
|
||
Pushed by m_kato@ga2.so-net.ne.jp: https://hg.mozilla.org/integration/autoland/rev/c40c000f87d7 nsIClipboard.emptyClipboard should clear system clipboard. r=mac-reviewers,spohl
Comment 12•2 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
status-firefox101:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 101 Branch
Comment 13•2 years ago
|
||
Setting status-firefox100=wontfix. I don't think we need to uplift this fix to Beta 100 because this is a very old bug.
status-firefox100:
--- → wontfix
status-firefox99:
--- → wontfix
status-firefox-esr91:
--- → wontfix
You need to log in
before you can comment on or make changes to this bug.
Description
•