qtgui-4.8.5-qclipboard-delay.patch 1.1 KB

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