From a83ddc5212736f89a0b94667c495494fe6861d63 Mon Sep 17 00:00:00 2001 From: Michael Palimaka Date: Mon, 16 Jun 2014 23:52:24 +1000 Subject: Fix delay with QClipboard and useEventLoop. This manifests when using LibreOffice with KDE integration. When KFileDialog is open, the clipboard is repeatedly polled causing a visible delay since using QClipboard in "useEventLoop" mode adds 50ms delay to every single clipboard fetch. Change-Id: Id30cda7b983ae7c949fa270d04f772fa44fc21cd Task-number: QTBUG-38585 --- src/gui/kernel/qclipboard_x11.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qclipboard_x11.cpp b/src/gui/kernel/qclipboard_x11.cpp index 14bf088..5f442b9 100644 --- a/src/gui/kernel/qclipboard_x11.cpp +++ b/src/gui/kernel/qclipboard_x11.cpp @@ -548,7 +548,8 @@ bool QX11Data::clipboardWaitForEvent(Window win, int type, XEvent *event, int ti return false; XSync(X11->display, false); - usleep(50000); + if (!XPending(X11->display)) + usleep(5000); now.start(); -- 2.0.0