From: Po Lu Date: Thu, 2 Jun 2022 00:32:23 +0000 (+0800) Subject: Fix decoding of XdndStatus rectangles on 64-bit systems X-Git-Tag: emacs-29.0.90~1910^2~295^2~1 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=47b8c3f0b97b6e59f475c996bba3cbb7f2e7ddf2;p=emacs.git Fix decoding of XdndStatus rectangles on 64-bit systems * src/xterm.c (handle_one_xevent): Make data.l[2] and data.l[3] unsigned. --- diff --git a/src/xterm.c b/src/xterm.c index 7234e7c7584..33b61ba02a2 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -15077,6 +15077,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, && event->xclient.message_type == dpyinfo->Xatom_XdndStatus) { Window target; + unsigned long r1, r2; target = event->xclient.data.l[0]; @@ -15084,11 +15085,14 @@ handle_one_xevent (struct x_display_info *dpyinfo, && target == x_dnd_last_seen_window && event->xclient.data.l[1] & 2) { + r1 = event->xclient.data.l[2]; + r2 = event->xclient.data.l[2]; + x_dnd_mouse_rect_target = target; - x_dnd_mouse_rect.x = (event->xclient.data.l[2] & 0xffff0000) >> 16; - x_dnd_mouse_rect.y = (event->xclient.data.l[2] & 0xffff); - x_dnd_mouse_rect.width = (event->xclient.data.l[3] & 0xffff0000) >> 16; - x_dnd_mouse_rect.height = (event->xclient.data.l[3] & 0xffff); + x_dnd_mouse_rect.x = (r1 & 0xffff0000) >> 16; + x_dnd_mouse_rect.y = (r1 & 0xffff); + x_dnd_mouse_rect.width = (r2 & 0xffff0000) >> 16; + x_dnd_mouse_rect.height = (r2 & 0xffff); } else x_dnd_mouse_rect_target = None;