On Sat, Jul 09, 2016 at 04:09:30AM +0200, Enrico Forestieri wrote:
> 
> I had a closer look at this issue. First of all, it occurs with both
> Qt4 and Qt5, the only difference being that Qt5 prints a warning.
> Then, it does not occur with all applications. I can reproduce with
> gnome-terminal and gedit, but cannot reproduce with gvim, for example.
> It only occurs after selecting something in lyx and trying to paste to
> another application for the first time. Then the paste succeeds on a
> second attempt, even if the window has not the focus anymore. However,
> selecting something else in lyx, it starts over again.

I see similar behavior.

> I came up with the attached patch that solves the issue for me.

Thanks for working on this.

> It requires the Qt5X11Extras module, which is not mandatory, though.
> The patch simply tries to refresh the timestamp of the selection request.
> I still get the warning from Qt5 (even if only once), but the paste by the
> middle mouse button succeeds anyway. Recall that this issue does not occur
> with a focus-follows-mouse policy. Given that it also does not occur with
> some applications, I don't know who is to blame for this.

I tested the patch and can reproduce your findings. The first paste now
works. As you mentioned, I still get the warning, but only one warning
where without the patch I get three warnings.

I tried a few random variations on your patch to squash the last
warning. One that worked for me is to add

  return true;

after

  xcb_flush(con);

I have no idea if that makes any sense but perhaps it provides a clue.
Does the warning go away if you add that?

Finally, this doesn't seem to solve the flood of messages I get when
CopyQ is running, but I don't think this is worth investigating.

Scott

Attachment: signature.asc
Description: PGP signature

Reply via email to