Resizing works again, but resizes seem behind by one step.

This commit is contained in:
msw%gimp.org 1998-12-07 05:08:00 +00:00
parent 52b5bcc79f
commit eb5a46231c
2 changed files with 26 additions and 19 deletions

View File

@ -627,16 +627,25 @@ gint nsGtkWidget_Resize_EventHandler(GtkWidget *w, GtkAllocation *allocation, gp
winBounds.height != allocation->height) {
g_print("\tAllocation != current window bounds. Resize.\n");
winBounds.width = allocation->width;
winBounds.height = allocation->height;
// win->SetBounds(winBounds);
nsRect sizeBounds;
sizeBounds.x = 0;
sizeBounds.y = 0;
winBounds.width = sizeBounds.width = allocation->width;
winBounds.height = sizeBounds.height = allocation->height;
nsPaintEvent pevent;
pevent.message = NS_PAINT;
pevent.widget = win;
pevent.time = PR_IntervalNow();
pevent.rect = (nsRect *)&winBounds;
win->OnPaint(pevent);
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();
sizeEvent.widget = win;
sizeEvent.nativeMsg = nsnull;
sizeEvent.windowSize = &sizeBounds;
sizeEvent.mWinWidth = winBounds.width;
sizeEvent.mWinHeight = winBounds.height;
win->OnResize(sizeEvent);
win->SetBounds(winBounds);
}
return PR_FALSE;
}

View File

@ -212,8 +212,13 @@ NS_METHOD nsWindow::CreateNative(GtkWidget *parentWidget)
mainWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_signal_connect(GTK_OBJECT(mainWindow),
"realize",
GTK_SIGNAL_FUNC(window_realize_callback),
NULL);
GTK_SIGNAL_FUNC(window_realize_callback),
NULL);
gtk_signal_connect(GTK_OBJECT(mWidget),
"size_allocate",
GTK_SIGNAL_FUNC(nsGtkWidget_Resize_EventHandler),
this);
// VBox for the menu, etc.
mVBox = gtk_vbox_new(PR_FALSE, 0);
@ -276,12 +281,6 @@ void nsWindow::InitCallbacks(char * aName)
"key_release_event",
GTK_SIGNAL_FUNC(nsGtkWidget_KeyReleaseMask_EventHandler),
this);
/*
gtk_signal_connect(GTK_OBJECT(mWidget),
"size_allocate",
GTK_SIGNAL_FUNC(nsGtkWidget_Resize_EventHandler),
this);
*/
}
//-------------------------------------------------------------------------
@ -639,13 +638,12 @@ void nsWindow::OnDestroy()
PRBool nsWindow::OnResize(nsSizeEvent &aEvent)
{
/*
nsRect* size = aEvent.windowSize;
if (mEventCallback && !mIgnoreResize) {
return DispatchWindowEvent(&aEvent);
}
*/
return PR_FALSE;
}