[Bf-taskforce25] Drag & Drop into 2.5

Elia Sarti vekoon at gmail.com
Thu Jul 23 12:00:11 CEST 2009


Hi Brecht,

Brecht Van Lommel wrote, on 07/22/2009 03:18 PM:
> Hi,
>
> I don't have much to comment, the basic architecture for this sounds
> fine.
>
> On Mon, 2009-07-20 at 14:37 +0200, Elia Sarti wrote:
>   
>> Details and Issues
>>
>> If I'm not mistaken as of now Context only returns "active" 
>> window/space/area/region in terms of what it was when the event was 
>> generated. It would be nice to have both "active" and "target" with 
>> target being the "active" in terms of where the mouse pointer or input are.
>> I'm not sure this is really necessary but we just need a way to retrieve 
>> drag data from where the MOUSEDRAG was generated and drop data from 
>> where the MOUSEDROP is generated.
>> I admit I didn't look much at the code yet so I could be wrong. Maybe 
>> this can already be done? For instance, if we do the 
>> MOUSEDRAG-associated operator modal then maybe we can catch the 
>> MOUSEDROP event in the modal() callback, set some custom data in it and 
>> then tell the system to keep on broadcasting the event? I'm not sure 
>> this is doable and in that case how much of a hack it is.
>>     
>
> One thing I don't fully understand is if MOUSEDRAG and MOUSEDROP would
> be handled by two separate operators or a single one? I presume it would
> be two different ones, because that is more extensible. Now, in that
> case I think the active/target context issue can be solved by giving the
> MOUSEDRAG operator the active context and MOUSEDROP the target context.
>
> This may require some WM tweaks, depending on how the handover between
> the two will work, but it's probably quite simple. Modal ops for example
> already keep the original context they were started in, so if MOUSEDRAG
> is a modal op it keeps the original context, then you stop the operator,
> and start a new MOUSEDROP operator which will get the context based on
> where the mouse is again.
>
> Brecht.
>   
Yes but the problem is exactly this, that each operator in the end gets 
own context. Maybe I'm missing something but there's need for the 
MOUSEDROP event to have both mouse_drag and mouse_drop data. The problem 
is that these two types of data lie into two different space contexts, 
unless we store this data at some higher level (like WM), which I'm not 
sure is ok? This is the data retrieved from the CTX_data_drag_pointer 
and CTX_data_drop_pointer. We'll have to set them under C->wm. If this 
is fine then there's no problem.






More information about the Bf-taskforce25 mailing list