diff --git a/mozilla/widget/src/xlib/nsWidget.cpp b/mozilla/widget/src/xlib/nsWidget.cpp index d432f73153a..46571b8ee5c 100644 --- a/mozilla/widget/src/xlib/nsWidget.cpp +++ b/mozilla/widget/src/xlib/nsWidget.cpp @@ -745,6 +745,13 @@ nsWidget::DeleteWindowCallback(Window aWindow) delete window_key; } +#undef TRACE_PAINT +#undef TRACE_PAINT_FLASH + +#ifdef TRACE_PAINT_FLASH +#include "nsXUtils.h" // for nsGtkUtils::gdk_window_flash() +#endif + PRBool nsWidget::OnPaint(nsPaintEvent &event) { @@ -764,6 +771,36 @@ nsWidget::OnPaint(nsPaintEvent &event) else { result = PR_FALSE; } + +#ifdef TRACE_PAINT + static PRInt32 sPrintCount = 0; + + if (event.rect) + { + printf("%4d nsWidget::OnPaint (this=%p,name=%s,xid=%p,rect=%d,%d,%d,%d)\n", + sPrintCount++, + (void *) this, + (const char *) nsCAutoString(mName), + (void *) mBaseWindow, + event.rect->x, + event.rect->y, + event.rect->width, + event.rect->height); + } + else + { + printf("%4d nsWidget::OnPaint (this=%p,name=%s,xid=%p,rect=none)\n", + sPrintCount++, + (void *) this, + (const char *) nsCAutoString(mName), + (void *) mBaseWindow); + } +#endif + +#ifdef TRACE_PAINT_FLASH + nsXUtils::FlashWindow(mDisplay,mBaseWindow,2,100000); +#endif + } return result; } diff --git a/mozilla/widget/src/xlib/nsWindow.cpp b/mozilla/widget/src/xlib/nsWindow.cpp index b2a918fc291..b3adf1fe6e5 100644 --- a/mozilla/widget/src/xlib/nsWindow.cpp +++ b/mozilla/widget/src/xlib/nsWindow.cpp @@ -102,6 +102,11 @@ nsWindow::GetEventMask() return event_mask; } +#undef TRACE_INVALIDATE + +#ifdef TRACE_INVALIDATE +static PRInt32 sInvalidatePrintCount = 0; +#endif NS_IMETHODIMP nsWindow::Invalidate(PRBool aIsSynchronous) { @@ -114,6 +119,16 @@ NS_IMETHODIMP nsWindow::Invalidate(PRBool aIsSynchronous) mBounds.width, mBounds.height); // XXX fix this pevent.time = 0; + +#ifdef TRACE_INVALIDATE + printf("%4d nsWindow::Invalidate(this=%p,name=%s,xid=%p,sync=%s)\n", + sInvalidatePrintCount++, + (void *) this, + (const char *) nsCAutoString(mName), + (void *) mBaseWindow, + aIsSynchronous ? "yes" : "no"); +#endif + AddRef(); OnPaint(pevent); Release(); @@ -132,6 +147,21 @@ NS_IMETHODIMP nsWindow::Invalidate(const nsRect & aRect, PRBool aIsSynchronous) pevent.rect = new nsRect(aRect); // XXX fix this pevent.time = 0; + +#ifdef TRACE_INVALIDATE + printf("%4d nsWidget::Invalidate(this=%p,name=%s,xid=%p,sync=%s,rect=%d,%d,%d,%d)\n", + sInvalidatePrintCount++, + (void *) this, + (const char *) nsCAutoString(mName), + (void *) mBaseWindow, + aIsSynchronous ? "yes" : "no", + aRect.x, + aRect.y, + aRect.width, + aRect.height); +#endif + + AddRef(); OnPaint(pevent); Release();