diff --git a/widget/src/gtk/nsWidget.cpp b/widget/src/gtk/nsWidget.cpp index fb9ab65f82d1..e315da8baae7 100644 --- a/widget/src/gtk/nsWidget.cpp +++ b/widget/src/gtk/nsWidget.cpp @@ -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 parent ( dont_AddRef(GetParent()) ); + if ( !parent ) { + printf("stopping\n"); + nsCOMPtr dragServ ( do_GetService("component://netscape/widget/dragservice") ); + if ( dragServ ) { + nsCOMPtr 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 dragServ ( do_GetService("component://netscape/widget/dragservice") ); + if ( dragServ ) { + nsCOMPtr session; + dragServ->GetCurrentSession ( getter_AddRefs(session) ); + if ( session ) + session->StopTracking(); + } + UpdateDragContext(aWidget, aDragContext, aTime); nsMouseEvent event;