Commit 2458b2ed authored by pinkerton%netscape.com's avatar pinkerton%netscape.com
Browse files

Adding drag auto-scrolling to trees. bug 28226, r=hyatt

parent d049c7ed
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -1847,6 +1847,20 @@ nsWidget::OnDragEnterSignal(GdkDragContext *aGdkDragContext,
nsWidget::OnDragLeaveSignal(GdkDragContext   *context,
                            guint             aTime)
{
  // tell anyone who is interested to stop tracking drags, but only when
  // we're leaving a window, not a child widget
  nsCOMPtr<nsIWidget> parent ( dont_AddRef(GetParent()) );
  if ( !parent ) {
    printf("stopping\n");
    nsCOMPtr<nsIDragService> dragServ ( do_GetService("component://netscape/widget/dragservice") );
    if ( dragServ ) {
      nsCOMPtr<nsIDragSession> session;
      dragServ->GetCurrentSession ( getter_AddRefs(session) );
      if ( session )
        session->StopTracking();
    }
  }

  // update our drag context
  UpdateDragContext(NULL, NULL, aTime);

@@ -1898,6 +1912,16 @@ nsWidget::OnDragDropSignal(GtkWidget *aWidget,
                           gint            y,
                           guint           aTime)
{
  // tell anyone who is interested to stop tracking drags, but only when
  // we're leaving a window, not a child widget
  nsCOMPtr<nsIDragService> dragServ ( do_GetService("component://netscape/widget/dragservice") );
  if ( dragServ ) {
    nsCOMPtr<nsIDragSession> session;
    dragServ->GetCurrentSession ( getter_AddRefs(session) );
    if ( session )
      session->StopTracking();
  }

  UpdateDragContext(aWidget, aDragContext, aTime);

  nsMouseEvent    event;