Applying patch from buhr@stat.wisc.edu. Fixes destination widget confusion (14759). Unix-only, a=mscott

This commit is contained in:
mcafee%netscape.com 1999-10-12 07:26:47 +00:00
Родитель 010b13e83b
Коммит 45701b9bfb
1 изменённых файлов: 13 добавлений и 1 удалений

Просмотреть файл

@ -1880,7 +1880,19 @@ nsWidget::OnButtonReleaseSignal(GdkEventButton * aGdkButtonEvent)
InitMouseEvent(aGdkButtonEvent, event, eventType);
event.widget = sButtonMotionTarget ? sButtonMotionTarget : this;
if (sButtonMotionTarget) {
gint diffX = 0;
gint diffY = 0;
diffX = (gint) aGdkButtonEvent->x_root - sButtonMotionRootX;
diffY = (gint) aGdkButtonEvent->y_root - sButtonMotionRootY;
event.widget = sButtonMotionTarget;
// see comments in nsWidget::OnMotionNotifySignal
event.point.x = nscoord(sButtonMotionWidgetX + diffX);
event.point.y = nscoord(sButtonMotionWidgetY + diffY);
}
NS_ADDREF(event.widget);
NS_STATIC_CAST(nsWidget*,event.widget)->DispatchMouseEvent(event);