D5704: Improve the x11 timestamp handling

Martin Gräßlin noreply at phabricator.kde.org
Wed May 3 19:36:40 UTC 2017


graesslin created this revision.
Restricted Application added a project: KWin.
Restricted Application added subscribers: kwin, plasma-devel.

REVISION SUMMARY
  So far KWin only updated the x11 timestamp if the new timestamp is larger
  than the existing one. While this is a useful thing it creates problems
  when the 32 bit msec based time stamp wraps around which happens after
  running an X server for 49 days. After the timestamp wrapped around KWin
  would not update the timestamp any more and thus some calls might fail.
  Most prominent victims are keyboard and pointer grab which fails as the
  timestamp is either larger than the server timestamp or smaller than the
  last grab timestamp.
  
  Another problem related to timestamp handling is KWin getting broken by
  wrong timestamps sent by applications. A prominent example is clusterssh
  which used to send a timestamp as unix time which is larger than the
  x timestamp and thus our timestamp gets too large.
  
  This change addresses these problems by allowing to reset the timestamp.
  This is only used from updateXTime (which is normally invoked before we
  do things like grabKeyboard). Thus we make QX11Info::getTimestamp the
  ultimate trusted source for timestamps.
  
  BUG: 377901
  BUG: 348569
  FIXED-IN: 5.8.7

TEST PLAN
  As I cannot wait 50 days: unit tests for the two conditions added.

REPOSITORY
  R108 KWin

BRANCH
  x11-timestamp-handling-5.8

REVISION DETAIL
  https://phabricator.kde.org/D5704

AFFECTED FILES
  autotests/CMakeLists.txt
  autotests/test_x11_timestamp_update.cpp
  main.h
  utils.cpp
  utils.h

To: graesslin, #kwin, #plasma
Cc: plasma-devel, kwin, spstarr, progwolff, Zren, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, lukas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20170503/2254b434/attachment.html>


More information about the Plasma-devel mailing list