summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbconnection.h
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-03-16 01:01:29 +0100
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-03-16 01:01:30 +0100
commit11b9c813e6705b0349e4c241f9132a6649977431 (patch)
tree69df65cb06c9617ab305a55be413a6be63677913 /src/plugins/platforms/xcb/qxcbconnection.h
parent8cc8eb8f24b9d297a25c9841326c6fa8561cf80e (diff)
parent4554fa7b191566df0a6c07e686c642c78eb88095 (diff)
Merge remote-tracking branch 'origin/5.13' into dev
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbconnection.h')
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h
index 6747b237da..7cf25d41a6 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.h
+++ b/src/plugins/platforms/xcb/qxcbconnection.h
@@ -185,10 +185,10 @@ public:
QXcbWindow *platformWindowFromId(xcb_window_t id);
inline xcb_timestamp_t time() const { return m_time; }
- inline void setTime(xcb_timestamp_t t) { if (t > m_time) m_time = t; }
+ inline void setTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_time)) m_time = t; }
inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; }
- inline void setNetWmUserTime(xcb_timestamp_t t) { if (t > m_netWmUserTime) m_netWmUserTime = t; }
+ inline void setNetWmUserTime(xcb_timestamp_t t) { if (timeGreaterThan(t, m_netWmUserTime)) m_netWmUserTime = t; }
xcb_timestamp_t getTimestamp();
xcb_window_t getSelectionOwner(xcb_atom_t atom) const;
@@ -264,6 +264,8 @@ private:
void destroyScreen(QXcbScreen *screen);
void initializeScreens();
bool compressEvent(xcb_generic_event_t *event) const;
+ inline bool timeGreaterThan(xcb_timestamp_t a, xcb_timestamp_t b) const
+ { return static_cast<int32_t>(a - b) > 0 || b == XCB_CURRENT_TIME; }
#if QT_CONFIG(xcb_xinput)
void xi2SetupDevice(void *info, bool removeExisting = true);