diff options
| author | Dana Jansens <danakj@orodu.net> | 2007-03-28 01:52:06 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2007-03-28 01:52:06 +0000 |
| commit | 339d76704400a6ea514817d91a2e935a13ecc928 (patch) | |
| tree | a8a9a44bd6a83fc9b8e4b3f698de3eca78f4e47e /openbox/event.c | |
| parent | 0ec2282e2ca6b80fa8c85dc366596cd009acc8a9 (diff) | |
handle time wrapping around.
Diffstat (limited to 'openbox/event.c')
| -rw-r--r-- | openbox/event.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/openbox/event.c b/openbox/event.c index 75cf5d2e..15724968 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -1376,3 +1376,15 @@ void event_ignore_queued_enters() } g_slist_free(saved); } + +gboolean event_time_after(Time t1, Time t2) +{ + /* + Timestamp values wrap around (after about 49.7 days). The server, given + its current time is represented by timestamp T, always interprets + timestamps from clients by treating half of the timestamp space as being + later in time than T. + - http://tronche.com/gui/x/xlib/input/pointer-grabbing.html + */ + return t1 >= t2 && t1 <= t2 + (1 << (sizeof(Time)*8-1)); +} |
