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

Doesn't work with some target application on Windows 10 #3

Closed
DarkFighterLuke opened this issue Mar 29, 2021 · 5 comments
Closed

Doesn't work with some target application on Windows 10 #3

DarkFighterLuke opened this issue Mar 29, 2021 · 5 comments
Labels
bug Something isn't working NeedsInvestigation

Comments

@DarkFighterLuke
Copy link

DarkFighterLuke commented Mar 29, 2021

Hi, congratulations for your library, it is very useful and especially it's written in pure Go.
I have no problems at all while running on Linux, but when it comes to Windows problems magically appear (as always).
Basically, I am putting an image received from the network into the clipboard, but on Windows I get a broken clipboard, which makes impossible to copy-paste anything until I stop the application.
Using the clipboard history on Windows 10 I can partially see the image sent, but anyway all is gone.
The image I am sending is PNG encoded at the source, then send to my application which takes the image bytes received in a multipart HTTP form and puts it into the clipboard.

Thanks for help.

UPDATE:
I tried the demo tool gclip and it is able to save to a file the clipboard content, while ctrl+v (or gui equivalent) simply doesn't work as I said before. Once the file is saved, the clipboard begins to work again and I'm able to paste again.

@changkun
Copy link
Member

changkun commented Mar 29, 2021

Hi, thanks for reporting your experience on Windows. In fact, I am not an active Windows user, I added the Windows support while I was actively using Windows about a month ago and I don't have a window environment at the moment. As I remember from the dev experience, Window support for PNG data highly depends on the target application and requires either they provide valid BMP encoded header information in the clipboard or the target application handles the header well, sadly some of them does not and I tried my best to handle all the cases that I found. Since I worked one specific use of this package, which is midgard (a clipboard sharing service), works well on transferring image data between three systems (linux/windows/mac) and copy/pasting images between gclip and chrome (google slides as an example), then I published this package as a general abstraction.

I will try to see if I could find a windows environment tomorrow to further verify your case. Before that:

  1. Could you maybe provide your specific Windows 10 system version?
  2. What's your target application that is trying to copy image data from the clipboard?
  3. Is it possible for you to provide a minimum code that I can reproduce the problem easily?

@DarkFighterLuke
Copy link
Author

DarkFighterLuke commented Mar 30, 2021

First of all thanks for your very fast answer.

1. Could you maybe provide your specific Windows 10 system version?

2. What's your target application that is trying to copy image data from the clipboard?

3. Is it possible for you to provide a minimum code that I can reproduce the problem easily?
  1. My Windows version is Windows 10 Pro 20H2.
  2. The target application is Paint (at the moment).
  3. Sure, you can find the code here, in particular in server.go in the function handleIncomingImage.

@changkun changkun added wontfix This will not be worked on NeedsInvestigation and removed wontfix This will not be worked on labels Mar 31, 2021
@changkun changkun changed the title Doesn't work on Windows 10 Doesn't work with some target application on Windows 10 Mar 31, 2021
@changkun
Copy link
Member

changkun commented Apr 2, 2021

Interesting, how did it work before, but nothing works now.

@changkun changkun added the bug Something isn't working label Apr 2, 2021
@changkun
Copy link
Member

changkun commented Apr 2, 2021

I got a fix and I will push it soon.

@changkun
Copy link
Member

changkun commented Apr 2, 2021

The bug is fixed in v0.4.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working NeedsInvestigation
Projects
None yet
Development

No branches or pull requests

2 participants