diff --git a/widget/src/gtk/nsGtkEventHandler.cpp b/widget/src/gtk/nsGtkEventHandler.cpp index 36cbe79697f2..41b832e118b0 100644 --- a/widget/src/gtk/nsGtkEventHandler.cpp +++ b/widget/src/gtk/nsGtkEventHandler.cpp @@ -616,7 +616,7 @@ gint nsGtkWidget_Resize_EventHandler(GtkWidget *w, GtkAllocation *allocation, gp { nsWindow *win = (nsWindow*)data; - nsRect winBounds, sizeBounds; + nsRect winBounds; win->GetBounds(winBounds); g_print("resize event handler:\n\tallocation->w=%d allocation->h=%d window.w=%d window.h=%d\n", allocation->width, allocation->height, winBounds.width, winBounds.height); @@ -624,35 +624,15 @@ gint nsGtkWidget_Resize_EventHandler(GtkWidget *w, GtkAllocation *allocation, gp winBounds.height != allocation->height) { g_print("\tAllocation != current window bounds. Resize.\n"); - nsSizeEvent sizeEvent; - sizeEvent.eventStructType = NS_SIZE_EVENT; - sizeEvent.message = NS_SIZE; - sizeEvent.point.x = winBounds.x; - sizeEvent.point.y = winBounds.y; - sizeEvent.time = PR_IntervalNow(); - - // nsGUIEvent - sizeEvent.widget = win; - sizeEvent.nativeMsg = nsnull; - - winBounds.width = sizeBounds.width = allocation->width; - winBounds.height = sizeBounds.height = allocation->height; - sizeBounds.x = 0; - sizeBounds.y = 0; - - // nsSizeEvent - sizeEvent.windowSize = &sizeBounds; - sizeEvent.mWinWidth = winBounds.width; - sizeEvent.mWinHeight = winBounds.height; - - win->OnResize(sizeEvent); + winBounds.width = allocation->width; + winBounds.height = allocation->height; // win->SetBounds(winBounds); nsPaintEvent pevent; pevent.message = NS_PAINT; pevent.widget = win; pevent.time = PR_IntervalNow(); - pevent.rect = (nsRect *)&sizeBounds; + pevent.rect = (nsRect *)&winBounds; win->OnPaint(pevent); } return FALSE; diff --git a/widget/src/gtk/nsWidget.cpp b/widget/src/gtk/nsWidget.cpp index a03af8bf4083..2c96be43f118 100644 --- a/widget/src/gtk/nsWidget.cpp +++ b/widget/src/gtk/nsWidget.cpp @@ -146,9 +146,9 @@ NS_METHOD nsWidget::Move(PRUint32 aX, PRUint32 aY) NS_METHOD nsWidget::Resize(PRUint32 aWidth, PRUint32 aHeight, PRBool aRepaint) { -#ifdef DBG +//#ifdef DBG g_print("nsWidget::Resize(%3d,%3d) - %s %p %s\n", aWidth, aHeight, mWidget->name, this, aRepaint ? "paint" : "no paint"); -#endif +//#endif mBounds.width = aWidth; mBounds.height = aHeight; gtk_widget_set_usize(mWidget, aWidth, aHeight); diff --git a/widget/src/gtk/nsWindow.cpp b/widget/src/gtk/nsWindow.cpp index 8da5e9b2dfb9..032d5c5ef2ae 100644 --- a/widget/src/gtk/nsWindow.cpp +++ b/widget/src/gtk/nsWindow.cpp @@ -637,11 +637,13 @@ void nsWindow::OnDestroy() PRBool nsWindow::OnResize(nsSizeEvent &aEvent) { +/* nsRect* size = aEvent.windowSize; if (mEventCallback && !mIgnoreResize) { return DispatchWindowEvent(&aEvent); } +*/ return FALSE; } @@ -763,53 +765,6 @@ PRUint32 nsWindow::GetYCoord(PRUint32 aNewY) return(aNewY); } - -static gint DoResize(GtkWidget *w, GtkAllocation *allocation, gpointer data) -{ - nsWindow *win = (nsWindow*)data; - - nsRect bounds; - win->GetBounds(bounds); - g_print("DoResized called a->w %d a->h %d b.w %d b.h %d\n", - allocation->width, allocation->height, bounds.width, bounds.height); - if (bounds.width != allocation->width || - bounds.height != allocation->height) { - g_print("RESIZE!\n"); - - nsSizeEvent sizeEvent; - sizeEvent.eventStructType = NS_SIZE_EVENT; - sizeEvent.message = NS_SIZE; - sizeEvent.point.x = bounds.x; - sizeEvent.point.y = bounds.y; - sizeEvent.time = PR_IntervalNow(); - - // nsGUIEvent - sizeEvent.widget = win; - sizeEvent.nativeMsg = nsnull; - - bounds.width = allocation->width; - bounds.height = allocation->height; - bounds.x = 0; - bounds.y = 0; - - // nsSizeEvent - sizeEvent.windowSize = &bounds; - sizeEvent.mWinWidth = bounds.width; - sizeEvent.mWinHeight = bounds.height; - - win->OnResize(sizeEvent); - win->SetBounds(bounds); - - nsPaintEvent pevent; - pevent.message = NS_PAINT; - pevent.widget = win; - pevent.time = PR_IntervalNow(); - pevent.rect = (nsRect *)&bounds; - win->OnPaint(pevent); - } - return TRUE; /* Stop the handling of this signal */ -} - NS_METHOD nsWindow::SetMenuBar(nsIMenuBar * aMenuBar) { GtkWidget *menubar;