Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP2:GA
libqt5-qtbase.18772
0001-XCB-Fix-clipboard-breaking-when-timer-wrap...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-XCB-Fix-clipboard-breaking-when-timer-wraps-after-50days.patch of Package libqt5-qtbase.18772
From 036fe49580d7470eeaa4c168845bdf2483946f22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Turek?= <lukas@turek.eu> Date: Fri, 22 Feb 2019 19:26:37 +0100 Subject: [PATCH] XCB: Fix clipboard breaking when timer wraps after 50 days xcb_timestamp_t is a 32-bit unsigned value in miliseconds, so it wraps after 49.7 days. When it happens, QXcbConnection::m_time stops updating and copy & paste in an application would not work until the application is restarted. This patch detects the timer wrap and allows m_time to wrap too. The fix was verified in KDE desktop with applications running for 51 days. Fixes: QTBUG-65145 Change-Id: I328c4179c1b1f71914adda6f9a0ca3991a7e808e Reviewed-by: Uli Schlachter <psychon@znc.in> Reviewed-by: Milian Wolff <milian.wolff@kdab.com> Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io> --- src/plugins/platforms/xcb/qxcbconnection.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/src/plugins/platforms/xcb/qxcbconnection.h +++ b/src/plugins/platforms/xcb/qxcbconnection.h @@ -429,10 +429,10 @@ public: void addPeekFunc(PeekFunc f); 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; } bool hasGLX() const { return has_glx_extension; } bool hasXFixes() const { return xfixes_first_event > 0; } @@ -494,6 +494,8 @@ private: void updateScreens(); void handleButtonPress(xcb_generic_event_t *event); void handleButtonRelease(xcb_generic_event_t *event); + inline bool timeGreaterThan(xcb_timestamp_t a, xcb_timestamp_t b) const + { return static_cast<int32_t>(a - b) > 0 || b == XCB_CURRENT_TIME; } bool m_xi2Enabled; int m_xi2Minor;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor