Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove images paste logic #331

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Remove images paste logic #331

wants to merge 1 commit into from

Conversation

partyka1
Copy link

Right now, copying file in Finder and pasting it in Messenger doesn't paste the file as attachment(in case for example .zip or .doc file), neither as an image (in case of png/jpg), but it pastes that file osx system icon. Also, pasting file from such an app as Snappy doesn't work (Messenger just does nothing. I have checked code, and there was some problem with generating fake drag&drop by MMFakeDragInfo). I have tested possible scenarios, and have found that all current logic isn't necessary, as pasting works perfectly well without it.
This bug occurred on macOS Sierra, as well as OSX El Capitan.

Tested solution on macOS Sierra, and all paste file types work well. Correct me if I didn't take into account some other paste-scenario and that pull request will break it.

@greg
Copy link
Contributor

greg commented Dec 23, 2016

Pasting files works for me, but pasting screenshots that were taken to the clipboard (⌃⌘⇧4) no longer works.

Useful to note that without these changes, the first time a clipboard screenshot is pasted, nothing happens, but the second time it actually pastes. With these changes, nothing happens at all.

So it seems like the actual paste operation is ok (no need to fake drag and drop instead), but we do still need special handling for whatever datatype a clipboard screenshot is.

@emilstahl
Copy link

@greg

Pasting files works for me, but pasting screenshots that were taken to the clipboard (⌃⌘⇧4) no longer works.

Works fine for me. Sometimes I just need to paste twice..

@greg
Copy link
Contributor

greg commented Feb 6, 2017

Correct, but it's not "sometimes", it's every time the content of your clipboard changes -- if you read the paste method, you'll see that it writes the image data to a temp file and replaces the clipboard, but doesn't actually paste (or attempts to and it doesn't work).

@rsms
Copy link
Owner

rsms commented Feb 18, 2017

I want to merge this, not for the original state reason (that it's useless) but because the code is of poor quality and too hacky for my taste.

However, some things I'd like understand before merging:

  1. Why is do we still need and implementation of - (IBAction)paste:(id)sender that just calls [[NSApplication sharedApplication] sendAction:@selector(paste:) to:nil from:self] ?

  2. This diff doesn't remove MMFakeDragInfo which seems to be used for clipboard stuff. Where else in the code is MMFakeDragInfo used and is there a reason those other uses shouldn't be updated as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants