зеркало из https://github.com/mozilla/gecko-dev.git
fix for 14292, 4289, 13051
This commit is contained in:
Родитель
66cd71e3cc
Коммит
22ac4d8c66
|
@ -38,6 +38,8 @@ nsToolkit::nsToolkit()
|
|||
//-------------------------------------------------------------------------
|
||||
nsToolkit::~nsToolkit()
|
||||
{
|
||||
if (mSharedGC)
|
||||
gdk_gc_unref(mSharedGC);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
@ -58,12 +60,12 @@ void nsToolkit::CreateSharedGC(void)
|
|||
pixmap = ::gdk_pixmap_new (NULL, 1, 1, gdk_rgb_get_visual()->depth);
|
||||
mSharedGC = ::gdk_gc_new (pixmap);
|
||||
gdk_pixmap_unref (pixmap);
|
||||
mSharedGC = gdk_gc_ref(mSharedGC);
|
||||
}
|
||||
|
||||
GdkGC *nsToolkit::GetSharedGC(void)
|
||||
{
|
||||
mSharedGC = gdk_gc_ref(mSharedGC);
|
||||
return mSharedGC;
|
||||
return gdk_gc_ref(mSharedGC);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
|
|
@ -1345,17 +1345,15 @@ nsWidget::OnMotionNotifySignal(GdkEventMotion * aGdkMotionEvent)
|
|||
|
||||
event.point.x = nscoord(x);
|
||||
event.point.y = nscoord(y);
|
||||
|
||||
event.widget = this;
|
||||
}
|
||||
|
||||
#if 0
|
||||
if (nsnull != sButtonMotionTarget)
|
||||
if (sButtonMotionTarget)
|
||||
{
|
||||
gint diffX;
|
||||
gint diffY;
|
||||
|
||||
if (aGdkMotionEvent != NULL)
|
||||
if (aGdkMotionEvent)
|
||||
{
|
||||
// Compute the difference between the original root coordinates
|
||||
diffX = (gint) aGdkMotionEvent->x_root - sButtonMotionRootX;
|
||||
|
@ -1373,22 +1371,26 @@ nsWidget::OnMotionNotifySignal(GdkEventMotion * aGdkMotionEvent)
|
|||
{
|
||||
event.widget = this;
|
||||
|
||||
if (aGdkMotionEvent != NULL)
|
||||
if (aGdkMotionEvent)
|
||||
{
|
||||
event.point.x = nscoord(aGdkMotionEvent->x);
|
||||
event.point.y = nscoord(aGdkMotionEvent->y);
|
||||
event.point.x = nscoord(x);
|
||||
event.point.y = nscoord(y);
|
||||
}
|
||||
}
|
||||
|
||||
if (aGdkMotionEvent != NULL)
|
||||
if (aGdkMotionEvent)
|
||||
{
|
||||
event.time = aGdkMotionEvent->time;
|
||||
}
|
||||
#endif
|
||||
|
||||
printf("x=%i , y=%i target=%p\n", event.point.x, event.point.y, event.widget);
|
||||
|
||||
AddRef();
|
||||
|
||||
DispatchMouseEvent(event);
|
||||
if (sButtonMotionTarget)
|
||||
sButtonMotionTarget->DispatchMouseEvent(event);
|
||||
else
|
||||
DispatchMouseEvent(event);
|
||||
|
||||
Release();
|
||||
}
|
||||
|
@ -1715,8 +1717,16 @@ nsWidget::OnButtonReleaseSignal(GdkEventButton * aGdkButtonEvent)
|
|||
break;
|
||||
}
|
||||
|
||||
|
||||
InitMouseEvent(aGdkButtonEvent, event, eventType);
|
||||
|
||||
event.widget = sButtonMotionTarget ? sButtonMotionTarget : this;
|
||||
|
||||
NS_ADDREF(event.widget);
|
||||
NS_STATIC_CAST(nsWidget*,event.widget)->DispatchMouseEvent(event);
|
||||
NS_IF_RELEASE(event.widget);
|
||||
|
||||
|
||||
if (sButtonMotionTarget)
|
||||
{
|
||||
sButtonMotionTarget = nsnull;
|
||||
|
@ -1724,12 +1734,6 @@ nsWidget::OnButtonReleaseSignal(GdkEventButton * aGdkButtonEvent)
|
|||
sButtonMotionRootX = -1;
|
||||
sButtonMotionRootY = -1;
|
||||
}
|
||||
|
||||
AddRef();
|
||||
|
||||
DispatchMouseEvent(event);
|
||||
|
||||
Release();
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
/* virtual */ void
|
||||
|
|
Загрузка…
Ссылка в новой задаче