Skip to content

Commit

Permalink
X11: Get clipboard before calling X11 functions
Browse files Browse the repository at this point in the history
  • Loading branch information
hluk committed Jul 23, 2017
1 parent 2e18eab commit 8624a2a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/platform/x11/x11platformclipboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,6 @@ void X11PlatformClipboard::onSelectionChanged()
{
m_timerResetSelection.stop();

if ( waitIfSelectionIncomplete() )
return;

// Always assume that only plain text can be in primary selection buffer.
// Asking a app for bigger data when mouse selection changes can make the app hang for a moment.
const QVariantMap data = DummyClipboard::data( Selection, QStringList(mimeText) );
Expand All @@ -128,6 +125,10 @@ void X11PlatformClipboard::onSelectionChanged()
if (m_selectionData == data)
return;

// Qt clipboard data can be in invalid state after this call.
if ( waitIfSelectionIncomplete() )
return;

m_selectionData = data;
emit changed(Selection);

Expand Down

0 comments on commit 8624a2a

Please sign in to comment.