This commit is contained in:
pavlov%netscape.com 1999-09-22 06:25:13 +00:00
Родитель 66cd71e3cc
Коммит 22ac4d8c66
2 изменённых файлов: 24 добавлений и 18 удалений

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

@ -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,21 +1371,25 @@ 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();
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