mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-24 19:37:15 +00:00
Resizing works again, but resizes seem behind by one step.
This commit is contained in:
parent
52b5bcc79f
commit
eb5a46231c
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user