diff options
author | Руслан Ижбулатов <lrn1986@gmail.com> | 2015-04-22 19:21:53 +0000 |
---|---|---|
committer | Руслан Ижбулатов <lrn1986@gmail.com> | 2016-01-18 09:23:44 +0000 |
commit | f74f81f06b1b08269120ada349cc57e2af02cd8d (patch) | |
tree | 7dd4bc0665c8e35c05ff7c82916f934c2f4fd458 /gdk/win32 | |
parent | 83eb36a896c14c754bf28e05407738fcf66cb9d7 (diff) | |
download | gtk+-f74f81f06b1b08269120ada349cc57e2af02cd8d.tar.gz |
W32: Detect ticks wraparound
https://bugzilla.gnome.org/show_bug.cgi?id=748327
Diffstat (limited to 'gdk/win32')
-rw-r--r-- | gdk/win32/gdkevents-win32.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c index bb2a2dea1a..76398334b8 100644 --- a/gdk/win32/gdkevents-win32.c +++ b/gdk/win32/gdkevents-win32.c @@ -178,7 +178,9 @@ _gdk_win32_get_next_tick (gulong suggested_tick) if (suggested_tick == 0) suggested_tick = GetTickCount (); - if (suggested_tick <= cur_tick) + /* Ticks eventually wrap around. + * This works as long as the interval between ticks is < 2147483648ms */ + if (suggested_tick <= cur_tick && ((cur_tick - suggested_tick) < 0x7FFFFFFF)) return cur_tick; else return cur_tick = suggested_tick; |