Skip to content

Commit

Permalink
Wayland: Use event loop
Browse files Browse the repository at this point in the history
  • Loading branch information
hluk committed Nov 11, 2024
1 parent 2cca846 commit fb7c5ec
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/platform/x11/systemclipboard/waylandclipboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,12 @@ QVariant DataControlOffer::retrieveData(const QString &mimeType, QVariant::Type
wl_display_flush(display);

ReceiveThread thread(pipeFds[0]);
QEventLoop loop;
connect(&thread, &QThread::finished, &loop, &QEventLoop::quit);
thread.start();
while (thread.isRunning())
QCoreApplication::processEvents();
if (thread.isRunning())
loop.exec();

const auto data = thread.data();

if (!data.isEmpty() && mimeType == applicationQtXImageLiteral()) {
Expand Down

0 comments on commit fb7c5ec

Please sign in to comment.