From 0594e9126167c64c8315c1e44d3f61c530259755 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Sat, 26 Mar 2022 10:13:47 +0000 Subject: [PATCH] Fix processing of emacs:window_id inside DND messages if it already exists * 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 | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/haiku_support.cc b/src/haiku_support.cc index a1616258bc3..39df06e4366 100644 --- a/src/haiku_support.cc +++ b/src/haiku_support.cc @@ -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 ()) -- 2.39.2