diff --git a/mozilla/gfx/src/photon/nsDrawingSurfacePh.cpp b/mozilla/gfx/src/photon/nsDrawingSurfacePh.cpp index d44b6d7459c..2e5b619da65 100644 --- a/mozilla/gfx/src/photon/nsDrawingSurfacePh.cpp +++ b/mozilla/gfx/src/photon/nsDrawingSurfacePh.cpp @@ -377,15 +377,12 @@ NS_IMETHODIMP nsDrawingSurfacePh :: Select( void ) int err; PhDrawContext_t *oldDC; -#if 0 -/* Why flush what might be in there?? */ err=PmMemFlush( (PmMemoryContext_t *) mGC, mPixmap ); // get the image if (err == -1) { NS_ASSERTION(0, "nsDrawingSurfacePh::Select - Error calling PmMemFlush"); return NS_ERROR_FAILURE; } -#endif oldDC=PmMemStart( (PmMemoryContext_t *) mGC); if (oldDC == NULL) diff --git a/mozilla/gfx/src/photon/nsRegionPh.cpp b/mozilla/gfx/src/photon/nsRegionPh.cpp index 845dec880a8..1708917f1e1 100644 --- a/mozilla/gfx/src/photon/nsRegionPh.cpp +++ b/mozilla/gfx/src/photon/nsRegionPh.cpp @@ -84,14 +84,7 @@ nsresult nsRegionPh :: Init(void) { PR_LOG(PhGfxLog, PR_LOG_DEBUG, ("nsRegionPh::Init this=<%p>\n", this)); - /* This looks like a memory leak kirk 10/18/99 */ -#if 0 - mRegion = NULL; - mRegionType = eRegionComplexity_empty; -#else - SetRegionEmpty(); //HACK! -#endif - + SetRegionEmpty(); return NS_OK; } diff --git a/mozilla/widget/src/photon/nsAppShell.cpp b/mozilla/widget/src/photon/nsAppShell.cpp index 6728e739551..963722d8e81 100644 --- a/mozilla/widget/src/photon/nsAppShell.cpp +++ b/mozilla/widget/src/photon/nsAppShell.cpp @@ -33,10 +33,9 @@ #include PRBool nsAppShell::mPtInited = PR_FALSE; -nsIEventQueue *kedlEQueue = nsnull; - -//static int modal_count; +PRBool ExitMainLoop; +/* This is defined to make the EventQueueToken look just like GTK's */ typedef int gint; #include @@ -281,94 +280,12 @@ NS_METHOD nsAppShell::Spindown() } -#if 0 -//------------------------------------------------------------------------- -// -// PushThreadEventQueue -// -//------------------------------------------------------------------------- -NS_IMETHODIMP -nsAppShell::PushThreadEventQueue() -{ -PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsAppShell::PushThreadEventQueue\n")); - - nsresult rv; - gint inputToken; - nsIEventQueue *eQueue; - - // push a nested event queue for event processing from netlib - // onto our UI thread queue stack. - NS_WITH_SERVICE(nsIEventQueueService, eventQService, kEventQueueServiceCID, &rv); - if (NS_SUCCEEDED(rv)) { - PR_Lock(mLock); - rv = eventQService->PushThreadEventQueue(); - if (NS_SUCCEEDED(rv)) { - eventQService->GetThreadEventQueue(PR_GetCurrentThread(), &eQueue); - - int err; - err = PtAppAddFd(NULL,eQueue->GetEventQueueSelectFD(),Pt_FD_READ,event_processor_callback,eQueue); - if (err == -1) - { - printf("nsAppShell::PushThreadEventQueue Error calling PtAppAddFd\n"); - exit(1); - } - - mEventQueueTokens->PushToken(eQueue, inputToken); - } - PR_Unlock(mLock); - } else - NS_ERROR("Appshell unable to obtain eventqueue service."); - return rv; -} - -//------------------------------------------------------------------------- -// -// PopThreadEventQueue -// -//------------------------------------------------------------------------- -NS_IMETHODIMP -nsAppShell::PopThreadEventQueue() -{ -PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsAppShell::PopThreadEventQueue\n")); - - nsresult rv; - nsIEventQueue *eQueue; - - NS_WITH_SERVICE(nsIEventQueueService, eventQService, kEventQueueServiceCID, &rv); - if (NS_SUCCEEDED(rv)) { - gint queueToken; - PR_Lock(mLock); - eventQService->GetThreadEventQueue(PR_GetCurrentThread(), &eQueue); - eventQService->PopThreadEventQueue(); - if (mEventQueueTokens->PopToken(eQueue, &queueToken)) - { - int err; - err=PtAppRemoveFd(NULL,eQueue->GetEventQueueSelectFD()); - if ( err == -1) - { - printf("nsAppShell::PopThreadEventQueue Error calling PtAppRemoveFd\n"); - exit(1); - } - } - PR_Unlock(mLock); - NS_IF_RELEASE(eQueue); - } else - NS_ERROR("Appshell unable to obtain eventqueue service."); - return rv; -} -#endif - - -int done_damn_it = 0; void MyMainLoop( void ) { -// printf ("kedl: start main loop!\n"); fflush(stdout); - done_damn_it = 0; - while (! done_damn_it) + ExitMainLoop = PR_FALSE; + while (! ExitMainLoop) { -// printf ("kedl: process event\n"); fflush(stdout); PtProcessEvent(); -// printf ("kedl: processed event\n"); fflush(stdout); } } @@ -454,31 +371,10 @@ done: NS_METHOD nsAppShell::Exit() { PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsAppShell::Exit.\n")); -// printf ("kedl: TRY to exit main loop!\n"); fflush (stdout); - done_damn_it = 1; - + ExitMainLoop = PR_TRUE; return NS_OK; } -#if 0 -//------------------------------------------------------------------------- -// -// GetNativeData -// -//------------------------------------------------------------------------- -void* nsAppShell::GetNativeData(PRUint32 aDataType) -{ - PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsAppShell::GetNativeData\n")); - - if( aDataType == NS_NATIVE_SHELL ) - { - /* This is what GTK does */ - return nsnull; - } - return nsnull; -} -#endif - NS_METHOD nsAppShell::GetNativeEvent(PRBool &aRealEvent, void *&aEvent) { @@ -624,35 +520,25 @@ NS_IMETHODIMP nsAppShell::Observe(nsISupports *aSubject, if (topic.Equals(gEQActivatedNotification)) { nsCOMPtr eq(do_QueryInterface(aSubject)); if (eq) { -#if 0 - queueToken = gdk_input_add(eq->GetEventQueueSelectFD(), - GDK_INPUT_READ, - event_processor_callback, - eq); -#else - err = PtAppAddFd(NULL,eq->GetEventQueueSelectFD(),Pt_FD_READ,event_processor_callback,eq); - if (err == -1) - { - printf("nsAppShell::PushThreadEventQueue Error calling PtAppAddFd\n"); - exit(1); - } -#endif + err = PtAppAddFd(NULL,eq->GetEventQueueSelectFD(),Pt_FD_READ,event_processor_callback,eq); + if (err == -1) + { + printf("nsAppShell::Observe Error calling PtAppAddFd errno=<%d>\n", errno); + //exit(1); + } mEventQueueTokens->PushToken(eq, queueToken); } } else if (topic.Equals(gEQDestroyedNotification)) { nsCOMPtr eq(do_QueryInterface(aSubject)); if (eq) { - if (mEventQueueTokens->PopToken(eq, &queueToken)) -#if 0 - gdk_input_remove(queueToken); -#else + if (mEventQueueTokens->PopToken(eq, &queueToken)) { err=PtAppRemoveFd(NULL,eq->GetEventQueueSelectFD()); if ( err == -1) { - printf("nsAppShell::PopThreadEventQueue Error calling PtAppRemoveFd\n"); - exit(1); + printf("nsAppShell::Observe Error calling PtAppRemoveFd errno=<%d>\n", errno); + //exit(1); } -#endif + } } } return NS_OK; diff --git a/mozilla/widget/src/photon/nsWidget.cpp b/mozilla/widget/src/photon/nsWidget.cpp index 3b97562a3ba..444184a1bef 100644 --- a/mozilla/widget/src/photon/nsWidget.cpp +++ b/mozilla/widget/src/photon/nsWidget.cpp @@ -767,10 +767,12 @@ NS_METHOD nsWidget::Invalidate(PRBool aIsSynchronous) if ( GetParentClippedArea(rect) == PR_TRUE) { + PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsWidget::Invalidate 1 Clipped rect=(%i,%i,%i,%i)\n", rect.x, rect.y, rect.width, rect.height )); + /* Damage has to be relative Widget coords */ mUpdateArea->SetTo( rect.x - mBounds.x, rect.y - mBounds.y, rect.width, rect.height ); - PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsWidget::Invalidate 1 Clipped mUpdateArea=(%i,%i,%i,%i)\n", rect.x - mBounds.x, rect.y - mBounds.y, rect.width, rect.height )); + PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsWidget::Invalidate 1 Clipped mUpdateArea=(%i,%i,%i,%i)\n", rect.x - mBounds.x, rect.y - mBounds.y, rect.width, rect.height )); if (PtWidgetIsRealized(mWidget)) { @@ -862,7 +864,11 @@ NS_IMETHODIMP nsWidget::InvalidateRegion(const nsIRegion *aRegion, PRBool aIsSyn PRUint32 i; PtWidgetArea( mWidget, &area ); // parent coords - + if (PtWidgetIsClass(mWidget, PtWindow)) + { + area.pos.x = area.pos.y = 0; + } + len = regionRectSet->mRectsLen; for (i=0;iFreeRects(regionRectSet); + ((nsIRegion*)aRegion)->SetTo(0,0,0,0); return NS_OK; } @@ -892,6 +899,8 @@ PRBool nsWidget::GetParentClippedArea( nsRect &rect ) { // Traverse parent heirarchy and clip the passed-in rect bounds +PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsWidget::GetParentClippedArea 1\n")); + PtArg_t arg; PhArea_t *area; PtWidget_t *parent; @@ -899,7 +908,7 @@ PRBool nsWidget::GetParentClippedArea( nsRect &rect ) nsRect rect2; PtWidget_t *disjoint = PtFindDisjoint( mWidget ); -//printf( "Clipping widget (%p) rect: %d,%d,%d,%d\n", this, rect.x, rect.y, rect.width, rect.height ); +PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsWidget::GetParentClippedArea Clipping widget (%p) rect: %d,%d,%d,%d\n", this, rect.x, rect.y, rect.width, rect.height )); // convert passed-in rect to absolute window coords first... PtWidgetOffset( mWidget, &offset ); @@ -907,7 +916,7 @@ PRBool nsWidget::GetParentClippedArea( nsRect &rect ) rect.y += offset.y; -//printf( " screen coords: %d,%d,%d,%d\n", rect.x, rect.y, rect.width, rect.height ); +PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsWidget::GetParentClippedArea screen coords: %d,%d,%d,%d\n", rect.x, rect.y, rect.width, rect.height )); parent = PtWidgetParent( mWidget ); while( parent ) @@ -918,18 +927,18 @@ PRBool nsWidget::GetParentClippedArea( nsRect &rect ) rect2.width = area->size.w; rect2.height = area->size.h; - if( parent != disjoint ) + if ((parent == disjoint) || (PtWidgetIsClass(parent, PtWindow))) { + rect2.x = rect2.y = 0; + } + else + { PtWidgetOffset( parent, &offset ); rect2.x = area->pos.x + offset.x; rect2.y = area->pos.y + offset.y; } - else - { - rect2.x = rect2.y = 0; - } -//printf( " parent at: %d,%d,%d,%d\n", rect2.x, rect2.y, rect2.width, rect2.height ); +PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsWidget::GetParentClippedArea parent at: %d,%d,%d,%d\n", rect2.x, rect2.y, rect2.width, rect2.height )); if( ( rect.x >= ( rect2.x + rect2.width )) || // rect is out of bounds to right (( rect.x + rect.width ) <= rect2.x ) || // rect is out of bounds to left @@ -965,7 +974,7 @@ PRBool nsWidget::GetParentClippedArea( nsRect &rect ) rect.height = (rect2.y + rect2.height) - rect.y; } -//printf( " new widget coords: %d,%d,%d,%d\n", rect.x, rect.y, rect.width, rect.height ); +PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsWidget::GetParentClippedArea new widget coords: %d,%d,%d,%d\n", rect.x, rect.y, rect.width, rect.height )); } } @@ -979,7 +988,7 @@ PRBool nsWidget::GetParentClippedArea( nsRect &rect ) rect.x -= offset.x; rect.y -= offset.y; -//printf( " final widget coords: %d,%d,%d,%d\n", rect.x, rect.y, rect.width, rect.height ); +PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsWidget::GetParentClippedArea final widget coords: %d,%d,%d,%d\n", rect.x, rect.y, rect.width, rect.height )); if( rect.width && rect.height ) return PR_TRUE; @@ -1977,9 +1986,11 @@ void nsWidget::InitDamageQueue() { mDmgQueueInited = PR_TRUE; +#if 1 int Global_Widget_Hold_Count; Global_Widget_Hold_Count = PtHold(); PR_LOG(PhWidLog, PR_LOG_DEBUG,("nsWidget::InitDamageQueue PtHold Global_Widget_Hold_Count=<%d> this=<%p>\n", Global_Widget_Hold_Count, this)); +#endif } else { @@ -2076,6 +2087,11 @@ void nsWidget::UpdateWidgetDamage() nsRect temp_rect; PtWidgetArea( mWidget, &area ); + if (PtWidgetIsClass(mWidget, PtWindow)) + { + area.pos.x = area.pos.y = 0; + } + if (NS_FAILED(mUpdateArea->GetRects(®ionRectSet))) { NS_ASSERTION(0,"nsWidget::UpdateWidgetDamaged Error mUpdateArea->GetRects returned NULL"); @@ -2145,10 +2161,12 @@ void nsWidget::RemoveDamagedWidget(PtWidget_t *aWidget) { mDmgQueueInited = PR_FALSE; +#if 1 /* The matching PtHold is in nsWidget::InitDamageQueue */ int Global_Widget_Hold_Count; Global_Widget_Hold_Count = PtRelease(); PR_LOG(PhWidLog, PR_LOG_DEBUG,("nsWidget::RemoveDamagedWidget PtHold/PtRelease Global_Widget_Hold_Count=<%d> this=<%p>\n", Global_Widget_Hold_Count, this)); +#endif if( mWorkProcID ) PtAppRemoveWorkProc( nsnull, mWorkProcID ); @@ -2183,6 +2201,11 @@ int nsWidget::WorkProc( void *data ) nsRect temp_rect; PtWidgetArea( dqe->widget, &area ); // parent coords + if (PtWidgetIsClass(dqe->widget, PtWindow)) + { + area.pos.x = area.pos.y = 0; + } + PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsWidget::WorkProc damaging widget=<%p> area=<%d,%d,%d,%d>\n", dqe->widget, area.pos.x, area.pos.y, area.size.w, area.size.h)); if (PtWidgetIsClass(dqe->widget, PtWindow)) { @@ -2217,15 +2240,18 @@ PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsWidget::WorkProc damaging widget=<%p> area=<% *dq = nsnull; mDmgQueueInited = PR_FALSE; - - /* The matching PtHold is in nsWidget::InitDamageQueue */ int Global_Widget_Hold_Count; + +#if 1 + /* The matching PtHold is in nsWidget::InitDamageQueue */ Global_Widget_Hold_Count = PtRelease(); PR_LOG(PhWidLog, PR_LOG_DEBUG,("nsWidget::WorkProc end, PtHold/PtRelease Global_Widget_Hold_Count=<%d>\n", Global_Widget_Hold_Count)); +#endif -// Global_Widget_Hold_Count = PtFlush(); /* this may not be necessary since after PtRelease */ -// PR_LOG(PhWidLog, PR_LOG_DEBUG,("nsWidget::WorkProc PtFlush Global_Widget_Hold_Count=<%d>\n", Global_Widget_Hold_Count)); - +#if 1 + Global_Widget_Hold_Count = PtFlush(); /* this may not be necessary since after PtRelease */ + PR_LOG(PhWidLog, PR_LOG_DEBUG,("nsWidget::WorkProc PtFlush Global_Widget_Hold_Count=<%d>\n", Global_Widget_Hold_Count)); +#endif } return Pt_END; diff --git a/mozilla/widget/src/photon/nsWindow.cpp b/mozilla/widget/src/photon/nsWindow.cpp index 566e6100997..aaf86d02089 100644 --- a/mozilla/widget/src/photon/nsWindow.cpp +++ b/mozilla/widget/src/photon/nsWindow.cpp @@ -58,7 +58,7 @@ nsWindow::nsWindow() mClientWidget = nsnull; mShell = nsnull; mFontMetrics = nsnull; - mClipChildren = PR_FALSE; + mClipChildren = PR_TRUE; /* This needs to be true for Photon */ mClipSiblings = PR_FALSE; mBorderStyle = eBorderStyle_default; mWindowType = eWindowType_child; @@ -200,6 +200,8 @@ NS_METHOD nsWindow::PreCreateWidget(nsWidgetInitData *aInitData) { SetWindowType( aInitData->mWindowType ); SetBorderStyle( aInitData->mBorderStyle ); + mClipChildren = aInitData->clipChildren; + mClipSiblings = aInitData->clipSiblings; PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsWindow::PreCreateWidget mClipChildren=<%d> mClipSiblings=<%d> mBorderStyle=<%d> mWindowType=<%d>\n", mClipChildren, mClipSiblings, mBorderStyle, mWindowType)); @@ -417,6 +419,15 @@ NS_METHOD nsWindow::CreateNative(PtWidget_t *parentWidget) // call the event callback to notify about creation DispatchStandardEvent( NS_CREATE ); +#if 0 +/* kirkj hack trying to get modal dialogs to work better */ + if ( ( mWindowType == eWindowType_dialog ) || + ( mWindowType == eWindowType_child ) ) + { + this->Show(PR_TRUE); + } +#endif + result = NS_OK; } else @@ -520,8 +531,8 @@ NS_METHOD nsWindow::Scroll(PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect) PhPoint_t offset = { aDx, aDy }; PhArea_t area; PhRid_t rid = PtWidgetRid( widget ); - PhTile_t *clipped_tiles, *sib_tiles, *tile; - PhTile_t *offset_tiles, *intersection = nsnull; + PhTile_t *clipped_tiles=nsnull, *sib_tiles=nsnull, *tile=nsnull; + PhTile_t *offset_tiles=nsnull, *intersection = nsnull; // int flux = PtStartFlux( widget ) - 1; @@ -532,7 +543,7 @@ NS_METHOD nsWindow::Scroll(PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect) PhPoint_t *pos; PhPoint_t p; - PR_LOG(PhWidLog, PR_LOG_DEBUG, (" Moving children...\n" )); + PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsWindow::Scroll Moving children...\n" )); for( w=PtWidgetChildFront( widget ); w; w=PtWidgetBrotherBehind( w )) { PtSetArg( &arg, Pt_ARG_POS, &pos, 0 ); @@ -554,7 +565,6 @@ NS_METHOD nsWindow::Scroll(PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect) if( GetSiblingClippedRegion( &clipped_tiles, &sib_tiles ) == NS_OK ) { - // Now we need to calc the actual blit tiles. We do this by making a copy // of the client-rect tiles (clipped_tiles) and offseting them by (-aDx,-aDy) // then intersecting them with the original clipped_tiles. These new tiles (there @@ -590,10 +600,10 @@ NS_METHOD nsWindow::Scroll(PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect) // Blit individual tiles tile = intersection; - PR_LOG(PhWidLog, PR_LOG_DEBUG, (" Blitng tiles...\n" )); + PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsWindow::Scroll Bliting tiles...\n" )); while( tile ) { - PR_LOG(PhWidLog, PR_LOG_DEBUG, (" tile (%i,%i,%i,%i)\n", tile->rect.ul.x, tile->rect.ul.y, tile->rect.lr.x, tile->rect.lr.y )); + PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsWindow::Scroll tile (%i,%i,%i,%i)\n", tile->rect.ul.x, tile->rect.ul.y, tile->rect.lr.x, tile->rect.lr.y )); PhBlit( rid, &tile->rect, &offset ); tile = tile->next; } @@ -613,11 +623,11 @@ NS_METHOD nsWindow::Scroll(PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect) clipped_tiles = PhClipTilings( clipped_tiles, offset_tiles, nsnull ); tile = clipped_tiles; - PR_LOG(PhWidLog, PR_LOG_DEBUG, (" Damaging tiles...\n" )); + PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsWindow::Scroll Damaging tiles...\n" )); while( tile ) { PtDamageExtent( widget, &(tile->rect)); - PR_LOG(PhWidLog, PR_LOG_DEBUG, (" tile (%i,%i,%i,%i)\n", tile->rect.ul.x, tile->rect.ul.y, tile->rect.lr.x, tile->rect.lr.y )); + PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsWindow::Scroll tile (%i,%i,%i,%i)\n", tile->rect.ul.x, tile->rect.ul.y, tile->rect.lr.x, tile->rect.lr.y )); tile = tile->next; } @@ -628,12 +638,12 @@ NS_METHOD nsWindow::Scroll(PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect) } else { - PR_LOG(PhWidLog, PR_LOG_DEBUG, (" clipped out!\n" )); + PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsWindow::Scroll clipped out!\n" )); } } else { - PR_LOG(PhWidLog, PR_LOG_DEBUG, (" widget is NULL!\n" )); + PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsWindow::Scroll widget is NULL!\n" )); } return NS_OK; @@ -929,8 +939,7 @@ PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsWindow::RawDrawFunc area+offset=<%d,%d,%d,%d> #if 0 rect = damage->rect; #else -// PhTile_t *top = damage->next; - PhTile_t *top = damage; + PhTile_t *top = damage->next; rect = top->rect; top=top->next; while (top) @@ -1003,7 +1012,11 @@ printf("nsWindow::RawDrawFunc nsDmg <%d,%d,%d,%d>\n", nsDmg.x, nsDmg.y, nsDmg.wi PR_LOG(PhWidLog, PR_LOG_DEBUG, ( "Dispatching paint event (area=%ld,%ld,%ld,%ld).\n",nsDmg.x,nsDmg.y,nsDmg.width,nsDmg.height )); result = pWin->DispatchWindowEvent(&pev); } - + else + { + printf("nsWindow::RawDrawFunc SetWindowClipping resulted in nothing to draw\n"); + } + NS_RELEASE(pev.renderingContext); } } @@ -1094,6 +1107,8 @@ NS_METHOD nsWindow::GetSiblingClippedRegion( PhTile_t **btiles, PhTile_t **ctile { nsresult res = NS_ERROR_FAILURE; + PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsWindow::GetSiblingClippedRegion 0\n")); + if(( btiles ) && ( ctiles )) { *btiles = PhGetTile(); @@ -1104,6 +1119,8 @@ NS_METHOD nsWindow::GetSiblingClippedRegion( PhTile_t **btiles, PhTile_t **ctile PhArea_t *area; PtArg_t arg; + PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsWindow::GetSiblingClippedRegion 1\n")); + PtSetArg( &arg, Pt_ARG_AREA, &area, 0 ); if( PtGetResources( mWidget, 1, &arg ) == 0 ) { @@ -1142,6 +1159,8 @@ NS_METHOD nsWindow::GetSiblingClippedRegion( PhTile_t **btiles, PhTile_t **ctile if( *ctiles ) { // We have siblings... now clip'em + PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsWindow::GetSiblingClippedRegion 5\n")); + *btiles = PhClipTilings( *btiles, *ctiles, nsnull ); res = NS_OK; } @@ -1149,6 +1168,8 @@ NS_METHOD nsWindow::GetSiblingClippedRegion( PhTile_t **btiles, PhTile_t **ctile } } + PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsWindow::GetSiblingClippedRegion error failure \n")); + return res; } @@ -1164,7 +1185,7 @@ NS_METHOD nsWindow::SetWindowClipping( PhTile_t *damage, PhPoint_t &offset ) clip_tiles = last = nsnull; - if( mClipChildren ) + if ( mClipChildren ) { PR_LOG(PhWidLog, PR_LOG_DEBUG, (" clipping children...\n")); @@ -1192,37 +1213,7 @@ NS_METHOD nsWindow::SetWindowClipping( PhTile_t *damage, PhPoint_t &offset ) } } - #if 0 - if( mClipSiblings ) - { - PR_LOG(PhWidLog, PR_LOG_DEBUG, (" clipping siblings...\n")); - - for( w=PtWidgetBrotherInFront( mWidget ); w; w=PtWidgetBrotherInFront( w )) - { - if( PtWidgetIsRealized( w )) - { - PtSetArg( &arg, Pt_ARG_AREA, &area, 0 ); - PtGetResources( w, 1, &arg ); - tile = PhGetTile(); - if( tile ) - { - tile->rect.ul.x = area->pos.x; - tile->rect.ul.y = area->pos.y; - tile->rect.lr.x = area->pos.x + area->size.w - 1; - tile->rect.lr.y = area->pos.y + area->size.h - 1; - tile->next = NULL; - if( !clip_tiles ) - clip_tiles = tile; - if( last ) - last->next = tile; - last = tile; - } - } - } - } - #endif - - if( mClipSiblings ) + if ( mClipSiblings ) { PtWidget_t *node = mWidget; PhPoint_t origin = { 0, 0 }; @@ -1352,10 +1343,11 @@ void nsWindow::ResizeHoldOff() if ( (mResizeProcID = PtAppAddWorkProc( nsnull, ResizeWorkProc, top )) != nsnull ) { +#if 1 int Global_Widget_Hold_Count; Global_Widget_Hold_Count = PtHold(); PR_LOG(PhWidLog, PR_LOG_DEBUG,("nsWindow::ResizeHoldOff PtHold Global_Widget_Hold_Count=<%d> this=<%p>\n", Global_Widget_Hold_Count, this)); - +#endif mResizeQueueInited = PR_TRUE; } else @@ -1437,10 +1429,11 @@ void nsWindow::RemoveResizeWidget() mResizeQueueInited = PR_FALSE; PtWidget_t *top = PtFindDisjoint( mWidget ); +#if 1 int Global_Widget_Hold_Count; Global_Widget_Hold_Count = PtRelease(); PR_LOG(PhWidLog, PR_LOG_DEBUG,("nsWindow::RemoveResizeWidget PtHold/PtRelease Global_Widget_Hold_Count=<%d> this=<%p>\n", Global_Widget_Hold_Count, this)); - +#endif if( mResizeProcID ) PtAppRemoveWorkProc( nsnull, mResizeProcID ); } @@ -1469,9 +1462,11 @@ int nsWindow::ResizeWorkProc( void *data ) nsWindow::mResizeQueue = nsnull; nsWindow::mResizeQueueInited = PR_FALSE; +#if 1 int Global_Widget_Hold_Count; Global_Widget_Hold_Count = PtRelease(); PR_LOG(PhWidLog, PR_LOG_DEBUG,("nsWindow::ResizeWorkProc PtHold/PtRelease Global_Widget_Hold_Count=<%d> this=<%p>\n", Global_Widget_Hold_Count, NULL)); +#endif } return Pt_END;