From: Po Lu Date: Sat, 26 Mar 2022 10:13:47 +0000 (+0000) Subject: Fix processing of emacs:window_id inside DND messages if it already exists X-Git-Tag: emacs-29.0.90~1931^2~902 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0594e9126167c64c8315c1e44d3f61c530259755;p=emacs.git 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. --- 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 ())