From d0f45dcc1951d0bd9427fd181565cf156ea6ebfc Mon Sep 17 00:00:00 2001 From: "pinkerton%netscape.com" Date: Tue, 12 Jun 2001 23:21:26 +0000 Subject: [PATCH] when responding to window change events, make sure that we're resizing the window before invalidating it. solves perf regression with moving windows. r=pchen/sr=sfraser/a=asa. bug# 84574 git-svn-id: svn://10.0.0.236/trunk@96993 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/widget/src/mac/nsMacWindow.cpp | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/mozilla/widget/src/mac/nsMacWindow.cpp b/mozilla/widget/src/mac/nsMacWindow.cpp index e31b6dc5304..694a80b1a15 100644 --- a/mozilla/widget/src/mac/nsMacWindow.cpp +++ b/mozilla/widget/src/mac/nsMacWindow.cpp @@ -37,6 +37,7 @@ #include "nsGFXUtils.h" #include "DefProcFakery.h" #include "nsMacResources.h" +#include "nsRegionMac.h" #include @@ -610,14 +611,19 @@ nsMacWindow :: WindowEventHandler ( EventHandlerCallRef inHandlerChain, EventRef case kEventWindowBoundsChanged: { - Rect bounds; - ::InvalWindowRect(myWind, ::GetWindowPortBounds(myWind, &bounds)); - - // resize the window and repaint - nsMacWindow* self = NS_REINTERPRET_CAST(nsMacWindow*, userData); - if ( self ) { - self->mMacEventHandler->ResizeEvent(myWind); - self->mMacEventHandler->UpdateEvent(); + // are we moving or resizing the window? we only care about resize. + UInt32 attributes = 0; + ::GetEventParameter ( inEvent, kEventParamAttributes, typeUInt32, NULL, sizeof(attributes), NULL, &attributes ); + if ( attributes & kWindowBoundsChangeSizeChanged ) { + Rect bounds; + ::InvalWindowRect(myWind, ::GetWindowPortBounds(myWind, &bounds)); + + // resize the window and repaint + nsMacWindow* self = NS_REINTERPRET_CAST(nsMacWindow*, userData); + if ( self ) { + self->mMacEventHandler->ResizeEvent(myWind); + self->mMacEventHandler->UpdateEvent(); + } } break; }