summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qdnd_x11.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel/qdnd_x11.cpp')
-rw-r--r--src/gui/kernel/qdnd_x11.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/gui/kernel/qdnd_x11.cpp b/src/gui/kernel/qdnd_x11.cpp
index 9591b9a..0d24ed7 100644
--- a/src/gui/kernel/qdnd_x11.cpp
+++ b/src/gui/kernel/qdnd_x11.cpp
@@ -51,10 +51,10 @@
#include "qbitmap.h"
#include "qdesktopwidget.h"
#include "qevent.h"
-#include "qdatetime.h"
#include "qiodevice.h"
#include "qpointer.h"
#include "qcursor.h"
+#include "qtimestamp.h"
#include "qvariant.h"
#include "qvector.h"
#include "qurl.h"
@@ -1911,23 +1911,19 @@ Qt::DropAction QDragManager::drag(QDrag * o)
// then we could still have problems, but this is highly unlikely
QApplication::flush();
- QTime started = QTime::currentTime();
- QTime now = started;
+ QTimestamp timer;
+ timer.start();
do {
XEvent event;
if (XCheckTypedEvent(X11->display, ClientMessage, &event))
qApp->x11ProcessEvent(&event);
- now = QTime::currentTime();
- if (started > now) // crossed midnight
- started = now;
-
// sleep 50 ms, so we don't use up CPU cycles all the time.
struct timeval usleep_tv;
usleep_tv.tv_sec = 0;
usleep_tv.tv_usec = 50000;
select(0, 0, 0, 0, &usleep_tv);
- } while (object && started.msecsTo(now) < 1000);
+ } while (object && timer.hasExpired(1000));
}
object = o;