Meant to send to group, oops.
On Thu, Nov 19, 2009 at 7:40 PM, Saikat Chakrabarti
<
sai...@gomockingbird.com> wrote:
> Maybe - even with the pasteboard element in there, I'm not entirely sure how
> this would work. Is the pasteboard relying on the application to provide it
> with the string that is copied? This stuff seems to imply so:
>
> if (isNativeCopyOrCutEvent)
> 0
> - {
> 0
> - var pasteboard = [CPPasteboard generalPasteboard],
> 0
> - types = [pasteboard types];
> 0
> -
> 0
> - // If this is a native copy event, then check if the pasteboard has anything in it.
> 0
> - if (types.length)
> 0
> - {
> 0
> - if ([types indexOfObjectIdenticalTo:CPStringPboardType] != CPNotFound)
> 0
> - _DOMPasteboardElement.value = [pasteboard stringForType:CPStringPboardType];
> 0
> - else
> 0
> - _DOMPasteboardElement.value = [pasteboard _generateStateUID];
> 0
> -
> 0
> - _DOMPasteboardElement.select();
>
> The way the pasteboard is setup, it doesn't seem to ever check the browser's
> clipboard. And the code above won't actually copy into the browser's
> clipboard - the dom event gets suppressed at the CPApplication stage. And
> even if it isn't suppressed at CPApplication, any paste would trigger the
> CPApplication's paste anyway (since the event is getting sent to
> CPApplication regardless of if it is a native copy or paste), which seems
> undesirable (and the problem I'm having right now). The only reason this
> pasteboard stuff was working before was that copy and paste within a
> CPTextField wasn't being handled at all by the CPApplication event handler.
> I don't know if this pasteboard code ever worked or what it worked for, but
> whatever needs to replace it needs to look fairly different. What actually
> needs to happen is a suppression of the cappuccino copy/paste functionality
> if a native copy/paste occurs. I haven't thought much about it, but I'm not
> entirely sure how to do this without specifically checking what the first
> responder is currently (and if it is something that can accept a native
> paste).