Closed Bug 72515 Opened 23 years ago Closed 23 years ago

drag and drop of message drags the whole outliner image

Categories

(SeaMonkey :: MailNews: Message Display, defect, P2)

PowerPC
Mac System 8.6
defect

Tracking

(Not tracked)

VERIFIED FIXED
mozilla0.9.1

People

(Reporter: sspitzer, Assigned: bugzilla)

References

Details

(Whiteboard: [nsbeta1+])

Attachments

(2 files)

ducarroz found this out, and pinkerton explained to me why this was the case.

something about getting the image from the frame, and in this case the frame
contains the whole outliner body.

pinkerton, can you clarify, and repeat your suggestion on how to fix this?
when you call nsIDragService::InvokeDragSession, there is a parameter that is an 
array of regions. This list of regions forms the structure dragged by the cursor. 
Instead of passing null, pass the rectangles of what is selected.

I also need to turn off the translucent dragging stuff for now. It just causes 
more problems than it's worth.
Scott, Seth, do you know how I can retreive the rectangle from the ouliner widget?
nope...maybe dave knows.
Keywords: nsbeta1
QA Contact: esther → sheelar
marking nsbeta1+
Priority: -- → P2
Whiteboard: [nsbeta1+]
Target Milestone: --- → mozilla0.9.1
It sounds like this is probably going to be a fix needed in the outliner.  Who
is the right person to assign this to?  If it's a mailnews bug then feel free to
correct me.
this has nothing to do with the outliner. there is a param to InvokeDragSession() 
that everyone (incorrectly) passes null to that lists an array of rectangles. if 
this list is null, we cheat and use the frame. the bug is on the client side, not 
outliner.
How do we get this list of rectangles?  I don't know if the d&d code changed,
but I don't think this bug existed when we weren't using the outliner.  What is
different?
what is different is that outliner now uses 1 frame, where as before each cell of 
the tree widget was a frame. 

you get the rectangles from outliner itself, by iterating over the selection and 
asking outliner for the rectangles of the needed rows.
the problem here is to retreive the rectangle to drag...Whe we have figure out 
that, should be very easy to fix it!
pink, I did the following test:

var region =
Components.classesByID["{da5b130a-1dd1-11b2-ad47-f455b1814a78}"].createInstance(Components.interfaces.nsIScriptableRegion);
    region.Init();
    region.SetToRect(10, 20, 30, 50);
    dump("region=" + region + "\n");

...

    var nsIDragService = Components.interfaces.nsIDragService;
    dragService.invokeDragSession ( event.target, transArray, region,
nsIDragService.DRAGDROP_ACTION_COPY +
    nsIDragService.DRAGDROP_ACTION_MOVE );

and, despite I pass a valid region, we still drag the whole outliner frame??

BTW, I still don't know how to retreive the rects from the outliner!

Note that this applies even when the mousedown isn't on a message -- you can 
drag the thread pane of an empty folder. Is that a separate bug?
Hardware: PC → Macintosh
Summary: drag and drop of message causes us to drag an the whole outliner image → drag and drop of message drags the whole outliner image
Depends on: 74831
ok, that should have at least given a smaller rectangle...i'll try looking into 
it when i get a free second (heh).

regarding getting the rects, ben has hiding in his tree (for months) an api to 
get the appropriate rectangles of a row, but it's been beta1-'d or something. i 
forget the exact bug, but it's already marked as a blocker. check his buglist and 
make some noise.
Thanks for looking at it...
74831 has landed to the point where it's good enough to start using.
No longer depends on: 74831
i have a fix to nsIScriptableRegion and to the mac drag service to make this work 
with the hacked region.

durcarroz, you need to make your calls to nsIScriptableRegion lowercase (eg, 
init(), setRect(), etc) as I changed the IDL while i was in there.

filed 80196 for my changes.
Depends on: 80196
much better this time, I can drag my test rectangle. Now I still need to extract
the right one...
Status: NEW → ASSIGNED
Whiteboard: [nsbeta1+] → [nsbeta1+] Have fix
Attached patch Proposed fix, v1Splinter Review
r=varada
I was going to ask:  please use the prog id ("@mozilla.org/gfx/region;1")
instead of the CID.  

but then looking at nsGfxFactoryWin.cpp and nsGfxFactoryMac.cpp, that wouldn't
work. not all the Gfx factories (for all the various toolkits) are generic
modules.  can you log a byg on switching from CID to progid in messengerdnd.js?
we'll make it blocked by bugs to switch the factories to use generic modules.

sr=sspitzer
Fixed and checked in
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Whiteboard: [nsbeta1+] Have fix → [nsbeta1+]
Mac only bug
verified 2001052112 buildid Mac G4 9.0.4. This problem is now fixed.
Status: RESOLVED → VERIFIED
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: