]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix decoding of XdndStatus rectangles on 64-bit systems
authorPo Lu <luangruo@yahoo.com>
Thu, 2 Jun 2022 00:32:23 +0000 (08:32 +0800)
committerPo Lu <luangruo@yahoo.com>
Thu, 2 Jun 2022 00:32:23 +0000 (08:32 +0800)
* src/xterm.c (handle_one_xevent): Make data.l[2] and data.l[3]
unsigned.

src/xterm.c

index 7234e7c7584bdd75c507498045a968e2a9a70f8b..33b61ba02a2791752db95cb35e50cd98187231a1 100644 (file)
@@ -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;