Windows build fixup. I haven't really tested whether tabs actually *work* in this scenario (widget sizing and parenting might be interesting), but it's at least enough to allow other people to start really working on code.

This commit is contained in:
Benjamin Smedberg
2009-07-07 12:26:49 -04:00
parent be586ce66f
commit c39ec69145
6 changed files with 48 additions and 10 deletions

View File

@@ -89,10 +89,12 @@
#include "TabParent.h"
#ifdef MOZ_WIDGET_GTK2
#include "mozcontainer.h"
#include <gdk/gdkx.h>
#include <gtk/gtk.h>
#endif
using namespace mozilla;
using namespace mozilla::tabs;
@@ -1102,6 +1104,18 @@ nsFrameLoader::TryNewProcess()
// FIXME check that this widget has the size and position we expect for
// this iframe?
nsPresContext* presContext = ourFrame->PresContext();
#ifdef XP_WIN
HWND parentwin =
static_cast<HWND>(w->GetNativeData(NS_NATIVE_WINDOW));
mChildProcess = new TabParent(parentwin);
mChildProcess->Move(0, 0,
presContext->AppUnitsToDevPixels(ourFrame->GetSize().width),
presContext->AppUnitsToDevPixels(ourFrame->GetSize().height));
#elif defined(MOZ_WIDGET_GTK2)
GdkWindow* parent_win =
static_cast<GdkWindow*>(w->GetNativeData(NS_NATIVE_WINDOW));
@@ -1118,7 +1132,6 @@ nsFrameLoader::TryNewProcess()
gtk_widget_realize(socket);
// set the child window's size and position
nsPresContext* presContext = ourFrame->PresContext();
GtkAllocation alloc;
alloc.x = 0; // setting position doesn't look necessary
alloc.y = 0;
@@ -1134,5 +1147,9 @@ nsFrameLoader::TryNewProcess()
mChildProcess->Move(0, 0, alloc.width, alloc.height);
#else
#error TODO for this platform
#endif
return PR_TRUE;
}