(Lisp_Object time_object, Lisp_Object terminal)
{
struct x_display_info *dpyinfo;
- Time time;
+ uint32_t time;
+ /* time should be a 32-bit integer, regardless of what the size of
+ the X type `Time' is on this system. */
dpyinfo = check_x_display_info (terminal);
- CONS_TO_INTEGER (time_object, Time, time);
+ CONS_TO_INTEGER (time_object, uint32_t, time);
x_set_last_user_time_from_lisp (dpyinfo, time);
return Qnil;
old_time = dpyinfo->last_user_time;
#endif
- /* Time can be sign extended if retrieved from a client message.
- Make sure it is always 32 bits, or systems with 64-bit longs
- will crash after 24 days of X server uptime. (bug#59480) */
- time &= X_ULONG_MAX;
-
#ifdef ENABLE_CHECKING
eassert (time <= X_ULONG_MAX);
#endif
/* Set the provided time as the user time, which is
required for SetInputFocus to work correctly after
taking the input focus. */
- x_display_set_last_user_time (dpyinfo, event->xclient.data.l[1],
+
+ /* Time can be sign extended if retrieved from a client message.
+ Make sure it is always 32 bits, or systems with 64-bit longs
+ will crash after 24 days of X server uptime. (bug#59480) */
+ x_display_set_last_user_time (dpyinfo, (event->xclient.data.l[1]
+ & 0xffffffff),
true, true);
goto done;
}