[haiku-development] Re: Handling drag'n'drop off files from Tracker

  • From: Marcus Overhagen <marcus.overhagen@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Wed, 9 Sep 2015 12:26:05 +0200

'DATA' is B_SIMPLE_DATA and can be handled similar to B_REFS_RECEIVED
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

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.

[1]
https://github.com/waddlesplash/Heidi/blob/master/core/CentralWindow.cpp#L205
[2] Terminal Output:
BHandler w>Heidi: MessageReceived() couldn't understand the message:
BMessage('DATA') {
src_window = (type = 'PNTR')(size = 4)
click_pt = BPoint(x:106, y:107)
TrackerViewToken = (type = 'MSNG')(size = 24)
refs = entry_ref(device=6, directory=1639645,
name="ShellView.cpp", path="/Data/Heidi/core/ShellView.cpp")
buttons = int32(0x1 or 1)
_drop_point_ = BPoint(x:879, y:463)
_drop_offset_ = BPoint(x:104, y:6)
}

Cheers,
Jessica


Other related posts: