On Wed, Sep 09, 2015 at 11:54:00AM -0700, pete.goodeve@xxxxxxxxxxxx wrote:
On Wed, Sep 09, 2015 at 12:26:05PM +0200, Marcus Overhagen wrote:
On Wed, Sep 9, 2015 at 9:30 AM, Jessica Hamilton
<jessica.l.hamilton@xxxxxxxxx> wrote:
Hi,
I was just looking at code for Heidi, and noticed that it doesn't
handle dropping files on its window. But I see in the code that
MessageReceived() handles the case of B_REFS_RECEIVED [1]. Running
from Terminal, BHandler appears to be dumping the message, and the
opcode is 'DATA' [2]. Changing the case statement to 'DATA' indeed
makes dropping files on the window work, which seems like a bug to me,
but I don't know the BeAPI that well.
'DATA' is B_SIMPLE_DATA and can be handled similar to B_REFS_RECEIVEDAlso note the function 'msg->WasDropped()'. What I usually do is simply
if it contains "refs".
See for example
https://github.com/haiku/haiku/blob/master/src/apps/mediaplayer/MainWin.cpp
Normally, B_REFS_RECEIVED is sent when a Open file panel is closed,
and automatically invokes RefsReceived().
This doesn't happen for drag+drop, see
https://www.haiku-os.org/legacy-docs/bebook/TheInterfaceKit_MessageConstants.html
change 'msg->what'
to B_REFS_RECEIVED if that returns true, and then pass it through the rest of
the usual
MessageReceived handling. (if the dropped item is from somewhere else than
the Tracker,
its contents wil just be ignored.)