Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit d0c4f6a

Browse files
committed
[Bug 19185] Don't clear dragData["private"] mid drag
The system appears to touch the drag pasteboard mid drag accessing the changeCount to increment. As drags either come from an outside source or the engine if private data exists we can retain until the drag is complete.
1 parent 3bfec90 commit d0c4f6a

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

docs/notes/bugfix-19185.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Ensure the dragData["private"] isn't cleared during a drag

engine/src/clipboard.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ void MCClipboard::ReleaseData()
123123
bool MCClipboard::PullUpdates() const
124124
{
125125
// If ownership has changed, the private clipboard data needs to be cleared
126-
if (!m_clipboard->IsOwned())
126+
if (!this->IsDragboard() && !m_clipboard->IsOwned())
127127
const_cast<MCClipboard*>(this)->ClearPrivateData();
128128

129129
// Pass on the request
@@ -1550,3 +1550,8 @@ MCStringEncoding MCClipboard::GuessHTMLEncoding(MCDataRef p_html_data)
15501550

15511551
return kMCStringEncodingUTF8;
15521552
}
1553+
1554+
bool MCClipboard::IsDragboard() const
1555+
{
1556+
return this == MCdragboard;
1557+
}

engine/src/clipboard.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ class MCClipboard :
182182
static MCClipboard* CreateSystemSelectionClipboard();
183183
static MCClipboard* CreateSystemDragboard();
184184

185-
185+
bool IsDragboard() const;
186186
private:
187187

188188
// The raw clipboard that is being wrapped

0 commit comments

Comments
 (0)