public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Mark Geisert <mark@maxrnd.com>
To: cygwin@cygwin.com
Subject: Re: [ANNOUNCEMENT] Updated: cygutils 1.4.16-7
Date: Sun, 26 Sep 2021 02:40:11 -0700	[thread overview]
Message-ID: <78b28c3f-4604-2805-0b87-a47e0b6437ac@maxrnd.com> (raw)
In-Reply-To: <20210925133125.8f894de4e596a71e7f24961f@nifty.ne.jp>

Hi Takashi,

Takashi Yano via Cygwin wrote:
> Sometimes, putclip shows error
> "Unable to open the clipboard"
> when I run 'echo A | putclip'.
> 
> I digged into this problem, and found OpenClipboard() sometimes
> fails with error ERROR_ACCESS_DENIED if it is called just after
> SetClipboardData() and CloseClipboard().
> 
> Currently, putclip calls OpenClipboard()/CloseClipboard() four
> times. Is there any reason why closing and reopening clipboard
> several times?

I don't know why the author coded putclip that way.  Perhaps Windows required 
different clipboard interfacing long ago?  Or the author was being very cautious?

> Is there any problem if you open clipboard once and close it at
> the end of function int putclip() just like the patch attached?
> 
> The problem above disappears if the patch is applied.

I will implement something similar to your patch for -8 in the next few days. 
Thank you for digging into this issue; I had seen evidence the clipboard was busy 
but wondered why Windows itself couldn't serialize access.  It's amusing to find 
that putclip is apparently interfering with itself :-).
Cheers,

..mark

  parent reply	other threads:[~2021-09-26  9:40 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-23  6:37 Mark Geisert
2021-09-25  4:31 ` Takashi Yano
2021-09-25  7:23   ` Takashi Yano
2021-09-25  8:12     ` Takashi Yano
2021-09-26  9:44       ` Mark Geisert
2021-09-26  9:43     ` Mark Geisert
2021-09-26  9:40   ` Mark Geisert [this message]
2021-09-26 18:41     ` Doug Henderson
2021-09-27  0:46       ` Westcoast Human
2021-09-27  6:13         ` Brian Inglis
2021-09-27  6:29           ` Brian Inglis
2021-09-27 20:00           ` Richard Beels
2021-09-27 20:00           ` Richard Beels
2021-09-27 20:00           ` Richard Beels
2021-09-27 10:10         ` Takashi Yano
2021-09-27 11:07           ` Takashi Yano
2021-09-28  3:58             ` Westcoast Human

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=78b28c3f-4604-2805-0b87-a47e0b6437ac@maxrnd.com \
    --to=mark@maxrnd.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).