Bug 136175 - Paste is sometimes deactivated in (context) menu even though text is copied to clipboard and CTRL+V functioning
Summary: Paste is sometimes deactivated in (context) menu even though text is copied t...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:7.2.0 target:7.1.2
Keywords:
: 141645 (view as bug list)
Depends on:
Blocks: Paste
  Show dependency treegraph
 
Reported: 2020-08-27 10:48 UTC by Telesto
Modified: 2021-05-10 08:43 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Inside Clipboard file (1.61 KB, application/octet-stream)
2020-08-27 10:48 UTC, Telesto
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Telesto 2020-08-27 10:48:07 UTC
Description:
Paste is sometimes deactivated in (context) menu even though text is copied to clipboard and CTRL+V functioning 

Technically the same as bug 116983. Except way to many comments already

Steps to Reproduce:
1. Download https://www.nirsoft.net/utils/insideclipboard.zip
2. Download the attached file
3. Open Inside Clipboard 
4. File -> Clear all clipboard data (Inside Clipboard )
5. Launch Writer
6. Right Click in side the document -> Disabled -> Fine
7. File -> Load .CLP with Inside Clipboard 
8. Right click inside the Writer document -> Paste enabled (fine)
9. Repeat step 7-8 number of times (say 5x)


Similar approach in bug 116983 comment 55

Actual Results:
Paste fails/disabled

Expected Results:
Not so


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.1.0.0.alpha0+ (x64)
Build ID: 6640d7f405d2970ba2825a9455926cc803284d01
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: nl-NL (nl_NL); UI: en-US
Calc: CL
Comment 1 Telesto 2020-08-27 10:48:25 UTC
Created attachment 164742 [details]
Inside Clipboard file
Comment 2 Mike Kaganski 2021-03-02 12:43:29 UTC
https://gerrit.libreoffice.org/c/core/+/111825

I must express greatest gratitude to Telesto for nice reliable test case in a clear bug report, and to jasonkres for great solution strategy.
Comment 3 Commit Notification 2021-03-03 10:31:03 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/cf1c835e8016f8f1eefea6d625a913c0ac343a63

tdf#116983 tdf#136175: retry if failed

It will be available in 7.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 4 Mike Kaganski 2021-03-03 10:36:46 UTC
Resolving this one, since the specific issue reproduced by steps in comment 0 should be fixed now with the commit above. I do not close bug 116983, since I don't know if there's no other bugs in clipboard handling that are somehow got mixed there. Still possibly the best would be to close also that one, and in case when another problem appears, just have a new clean issue.
Comment 5 Panos Stokas 2021-03-05 19:32:06 UTC
I was able to reproduce the bug in 7.1.1.2 and after testing, I can confirm it's fixed in build https://git.libreoffice.org/core/+log/8e49505fa7352023c252bf794ae84c9082d7264e
Comment 6 Timur 2021-03-06 16:14:22 UTC Comment hidden (obsolete)
Comment 7 Aron Budea 2021-03-06 21:11:03 UTC
(In reply to Timur from comment #6)
> > It will be available in 7.2.0.
> Meaning it's not in 7.1.
Which means it can be used for reference that the bug was reproducible.
Comment 8 Mike Kaganski 2021-03-07 05:05:18 UTC
(In reply to Timur from comment #6)

Yes I forgot to backport, sorry. It is waiting review now at https://gerrit.libreoffice.org/c/core/+/112075 and https://gerrit.libreoffice.org/c/core/+/112076 - these two must be merged only together.
Comment 9 bugzilla2 2021-03-08 18:32:27 UTC
Seems like this also fixes Bug 57147 :)

Just hope the fix will be backported to 7.0 and 7.1 too ...

Thanks to all who helped fix this nasty bug :D
Comment 10 Commit Notification 2021-03-09 16:01:32 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-7-1":

https://git.libreoffice.org/core/commit/316bebbbbd19cdccde05eba5f6098d301f032df2

tdf#116983 tdf#136175: retry if failed

It will be available in 7.1.2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 11 John 2021-03-09 19:25:44 UTC
This is looking very good. Have been using 7.2 all day with lots of copy and paste work from Acrobat into LO and naturallyspeaking into LO - no errors whereas previously they would have been numerous.

Thank you.
Comment 12 Timur 2021-03-10 12:54:01 UTC
Mike, please comment on backport to 7.0.
I reduce my backport requests only to important issues and this one it is because it's very visible. 

I had a workaround all this time, I used "Paste from Web"  extension. 
If you can, it would be interesting to explain how that one worked.
Comment 13 Mike Kaganski 2021-03-10 13:13:04 UTC
(In reply to Timur from comment #12)
> Mike, please comment on backport to 7.0.

No, I will not backport there, because there were big changes of clipboard code since then (partially because we tried to address the annoying clipboard problems blindly, partially because of other needs), and backporting would require much effort I can't spend now.

> I had a workaround all this time, I used "Paste from Web"  extension. 
> If you can, it would be interesting to explain how that one worked.

Yes. If you reproduce the bug in e.g. current 7.1.1 (i.e., you copy something e.g. from terminal until you see that the Paste button in Writer is inactive), you may continue the test: now create another Writer document (press relevant toolbar button), and see that in the new document, the Paste button is active (unlike the old one, where it's still inactive).

This was accidentally "used" in the mentioned extension [1], which created an invisible intermediate document, pasted there, processed, then copied from there into existing document. The process of creating the hidden new document did the trick - the clipboard content was refreshed (and at that moment, the clipboard was not locked by another application, unlike at initial attempt to update the state), so paste into that internal document succeeded.

[1] https://extensions.openoffice.org/en/project/paste-web
Comment 14 b. 2021-04-15 14:37:16 UTC
*** Bug 141645 has been marked as a duplicate of this bug. ***