Clearing clipboard does not work

I'm getting the following error:
I 2018-02-15 06:10:11Z 42.641ms UI thread 1 "Restoring clipboard content after 5 seconds"
E 2018-02-15 06:10:12Z 43.592ms UI thread 1 "error copying to clipboard
System.Runtime.InteropServices.COMException (0x800401D0): OpenClipboard fehlgeschlagen (Ausnahme von HRESULT: 0x800401D0 (CLIPBRD_E_CANT_OPEN))
bei System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
bei System.Windows.Clipboard.Flush()
bei System.Windows.Clipboard.CriticalSetDataObject(Object data, Boolean copy)
bei System.Windows.Clipboard.SetDataInternal(String format, Object data)
bei System.Windows.Clipboard.SetText(String text, TextDataFormat format)
bei System.Windows.Clipboard.SetText(String text)
bei AgileBits.OnePassword.AppHost.<>c__DisplayClass6_0.<b__0>d.MoveNext()"


1Password Version: 7.0.519
Extension Version: Not Provided
OS Version: Windows 10
Sync Type: Account

Comments

  • edited February 2018

    I already googled the error and found a solution:

    Changed Clipboard.SetText to Clipboard.SetDataObject to prevent crash…

    Please read also this:
    https://stackoverflow.com/questions/12769264/openclipboard-failed-when-copy-pasting-data-from-wpf-datagrid

  • MikeTMikeT Agile Samurai

    Team Member

    Hi @nahrstaedt,

    Thanks for reporting it.

    Does this happen anywhere you copy 1Password data or in a specific field you're copying to, like a TOTP field?

    Thanks for the StackOverFlow link, that may not be the cure. If it was specific to that, we'd see everyone reporting the same thing and we'd see it as well, which does beg the question as to why it is happening consistently on your system. None of us can reproduce this and we had this same code for a few years now. Even some of the posts on your StackOverflow thread suggests this may be machine/process-specific.

    Do you use any clipboard tool or app that manages your clipboard like Office?

    We'll investigate to see if we can fix it simply by using the other method which doesn't look like it was a 100% fix for everyone on that thread either.

  • MikeTMikeT Agile Samurai

    Team Member

    Hi @nahrstaedt,

    I think I know what the issue is.

    This may be the issue with having a non-text object in your clipboard before you copied something in 1Password and it couldn't restore it properly after clearing the clipboard. We'll investigate this soon.

  • Thank you, today clipboard clearing worked fine.
    I'm thinking you are right and non-text objects are the cause of the error. I was copying/pasting some images yesterday.

    Why you are restoring? Can you not just clear it, this is also what the text in the settings suggest:
    "Clear Clipboard Content"

  • I, too, would not expect previous clipboard content to be restored when the feature is named "Clear".

    Suggestion: If you intend to keep the restoring behavior, have two options. One to restore it and another, mutually exclusive option to clear it instead.

  • brentybrenty

    Team Member

    Thank you, today clipboard clearing worked fine. I'm thinking you are right and non-text objects are the cause of the error. I was copying/pasting some images yesterday.

    @nahrstaedt: Good to know! That should help us test this and find a solution.

    Why you are restoring? Can you not just clear it, this is also what the text in the settings suggest: "Clear Clipboard Content"

    Because we don't want to cause data loss for users. If you copied something to the clipboard, I'm guessing you did so for a reason. If possible, 1Password should avoid wiping out user data and leave things exactly as they were when it's done with its own task.

  • brentybrenty

    Team Member

    I, too, would not expect previous clipboard content to be restored when the feature is named "Clear".

    @astral: It isn't 1Password's job or place to clear out data that you put on the clipboard from somewhere else. It isn't a general-purpose clipboard-monitoring/clearing app. It will do its best to clear its own data from the clipboard and restore whatever you'd put there on your own previously. You can always clear anything you add to the clipboard later yourself, but we don't want 1Password causing you or someone else to lose something important you put there for a reason.

    Suggestion: If you intend to keep the restoring behavior, have two options. One to restore it and another, mutually exclusive option to clear it instead.

    No. We're not going to do that. 1Password will clear its own data from the clipboard. It shouldn't destroy data you put there. You're welcome to do that yourself though, since you're the one who put something there in the first place. 1Password should not interfere with your use of other apps and data if at all possible though.

  • astralastral
    edited February 2018

    @brenty Then I suggest you rename the option - "Clear clipboard contents" does not describe 1Password's behavior, and clearly (pun only slightly intended) it isn't what you want 1Password to do, either. :)

    Here are some potential alternative labels for the setting:
    "Restore previous clipboard contents" [after xyz time]
    "Revert clipboard contents" [after xyz time]
    "Remove 1Password-added clipboard contents" [after xyz time]

  • brentybrenty

    Team Member
    edited February 2018

    @astral: I think it's important to keep in mind that this is a setting in 1Password itself, so I think in that context it's arguably self-referential, rather than being a general setting that applies system-wide. We've actually had this same wording across multiple platforms for over a decade now, and I can't recall it ever coming up before. It's certainly something we can consider though. Thank you! :)

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file