]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix processing of emacs:window_id inside DND messages if it already exists
authorPo Lu <luangruo@yahoo.com>
Sat, 26 Mar 2022 10:13:47 +0000 (10:13 +0000)
committerPo Lu <luangruo@yahoo.com>
Sat, 26 Mar 2022 10:14:05 +0000 (10:14 +0000)
* src/haiku_support.cc (MessageReceived): Use DropPoint instead
of getting it manually.
(be_drag_message): Replace window_id if it already exists.

src/haiku_support.cc

index a1616258bc361f4a0c3a436cbbb67a000a7bb13a..39df06e43664e794ab1f73fe70a57c48218f8ccb 100644 (file)
@@ -725,17 +725,16 @@ public:
            && windowid == this->window_id)
          return;
 
-       if (msg->FindPoint ("_drop_point_", &whereto) == B_OK)
-         {
-           this->ConvertFromScreen (&whereto);
+       whereto = msg->DropPoint ();
 
-           rq.window = this;
-           rq.message = DetachCurrentMessage ();
-           rq.x = whereto.x;
-           rq.y = whereto.y;
+       this->ConvertFromScreen (&whereto);
 
-           haiku_write (DRAG_AND_DROP_EVENT, &rq);
-         }
+       rq.window = this;
+       rq.message = DetachCurrentMessage ();
+       rq.x = whereto.x;
+       rq.y = whereto.y;
+
+       haiku_write (DRAG_AND_DROP_EVENT, &rq);
       }
     else if (msg->GetPointer ("menuptr"))
       {
@@ -4084,7 +4083,9 @@ be_drag_message (void *view, void *message, bool allow_same_view,
 
   block_input_function ();
 
-  if (!allow_same_view)
+  if (!allow_same_view &&
+      (msg->ReplaceInt32 ("emacs:window_id", window->window_id)
+       == B_NAME_NOT_FOUND))
     msg->AddInt32 ("emacs:window_id", window->window_id);
 
   if (!vw->LockLooper ())