]> git.eshelyaron.com Git - emacs.git/commitdiff
Don't baselessly ignore frames after passing through the root window
authorPo Lu <luangruo@yahoo.com>
Mon, 4 Apr 2022 05:17:18 +0000 (13:17 +0800)
committerPo Lu <luangruo@yahoo.com>
Mon, 4 Apr 2022 05:17:18 +0000 (13:17 +0800)
* src/xterm.c (x_dnd_begin_drag_and_drop):
(handle_one_xevent): Don't rely on target not being None to set
x_dnd_return_frame to 2.

src/xterm.c

index c70b31c5ad175f088cb41dc2b85e88b855c9a24f..969be23c7a27e6a5546204fd98f8da86d8418448 100644 (file)
@@ -9072,11 +9072,11 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction,
                | SubstructureNotifyMask
                | PropertyChangeMask);
 
+  if (EQ (return_frame, Qnow))
+    x_dnd_update_state (FRAME_DISPLAY_INFO (f), CurrentTime);
+
   while (x_dnd_in_progress || x_dnd_waiting_for_finish)
     {
-      if (EQ (return_frame, Qnow))
-       x_dnd_update_state (FRAME_DISPLAY_INFO (f), CurrentTime);
-
       hold_quit.kind = NO_EVENT;
 #ifdef USE_GTK
       current_finish = X_EVENT_NORMAL;
@@ -12835,6 +12835,10 @@ x_dnd_update_state (struct x_display_info *dpyinfo, Time timestamp)
 
       if (target != x_dnd_last_seen_window)
        {
+         if (target != FRAME_OUTER_WINDOW (x_dnd_frame)
+             && x_dnd_return_frame == 1)
+           x_dnd_return_frame = 2;
+
          if (x_dnd_last_seen_window != None
              && x_dnd_last_protocol_version != -1
              && x_dnd_last_seen_window != FRAME_OUTER_WINDOW (x_dnd_frame))
@@ -12858,10 +12862,6 @@ x_dnd_update_state (struct x_display_info *dpyinfo, Time timestamp)
                                                 x_dnd_last_seen_window, &lmsg);
            }
 
-         if (target != FRAME_OUTER_WINDOW (x_dnd_frame)
-             && x_dnd_return_frame == 1)
-           x_dnd_return_frame = 2;
-
          if (x_dnd_return_frame == 2
              && x_any_window_to_frame (dpyinfo, target))
            {
@@ -14466,6 +14466,10 @@ handle_one_xevent (struct x_display_info *dpyinfo,
 
            if (target != x_dnd_last_seen_window)
              {
+               if (target != FRAME_OUTER_WINDOW (x_dnd_frame)
+                   && x_dnd_return_frame == 1)
+                 x_dnd_return_frame = 2;
+
                if (x_dnd_last_seen_window != None
                    && x_dnd_last_protocol_version != -1
                    && x_dnd_last_seen_window != FRAME_OUTER_WINDOW (x_dnd_frame))
@@ -14510,10 +14514,6 @@ handle_one_xevent (struct x_display_info *dpyinfo,
                      }
                  }
 
-               if (target != FRAME_OUTER_WINDOW (x_dnd_frame)
-                   && x_dnd_return_frame == 1)
-                 x_dnd_return_frame = 2;
-
                if (x_dnd_return_frame == 2
                    && x_any_window_to_frame (dpyinfo, target))
                  {
@@ -15918,6 +15918,10 @@ handle_one_xevent (struct x_display_info *dpyinfo,
 
                  if (target != x_dnd_last_seen_window)
                    {
+                     if (target != FRAME_OUTER_WINDOW (x_dnd_frame)
+                         && x_dnd_return_frame == 1)
+                       x_dnd_return_frame = 2;
+
                      if (x_dnd_last_seen_window != None
                          && x_dnd_last_protocol_version != -1
                          && x_dnd_last_seen_window != FRAME_OUTER_WINDOW (x_dnd_frame))
@@ -15964,10 +15968,6 @@ handle_one_xevent (struct x_display_info *dpyinfo,
                            }
                        }
 
-                     if (target != FRAME_OUTER_WINDOW (x_dnd_frame)
-                         && x_dnd_return_frame == 1)
-                       x_dnd_return_frame = 2;
-
                      if (x_dnd_return_frame == 2
                          && x_any_window_to_frame (dpyinfo, target))
                        {