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 10, 2024
1 parent 8754f9b commit 401963d
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 @@ -319,9 +319,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 401963d

Please sign in to comment.