Menu

#2147 Qt clipboard needlessly cleared before setting new content

Bug
closed-fixed
nobody
5
2020-01-15
2019-12-17
skunkos
No

When user hits CTRL+C in Scintilla editing component (in Qt flavor), then in ScintillaQt::CopyToModeClipboard, the clipboard is cleared first and then loaded with newly copied text.

This is rather problematic, because clear() method and subsequent setMimeDataMethod() method calls trigger TWO QClipboard::dataChanged() signal emmisions very shortly one after another and signal receiver is not able to actually know that clipboard got cleared and loaded with new data. The receiver only sees latest state and thinks that clipboard was filled in twice.

Fix is simple, just remove line clipboard->clear(clipboardMode_); which is really redundant.

Discussion

  • Neil Hodgson

    Neil Hodgson - 2020-01-06
    • labels: --> scintilla, qt
    • status: open --> open-fixed
     
  • Neil Hodgson

    Neil Hodgson - 2020-01-06

    Committed fix as [184f4b].

     

    Related

    Commit: [184f4b]

  • Neil Hodgson

    Neil Hodgson - 2020-01-15
    • status: open-fixed --> closed-fixed
     
  • Neil Hodgson

    Neil Hodgson - 2020-01-15

    Committed fix as [184f4b].

     

    Related

    Commit: [184f4b]


Log in to post a comment.