diff --git a/embedding/browser/qt/src/EmbedWindowCreator.cpp b/embedding/browser/qt/src/EmbedWindowCreator.cpp index 6b3eb9d9e517..77d9d36676ac 100644 --- a/embedding/browser/qt/src/EmbedWindowCreator.cpp +++ b/embedding/browser/qt/src/EmbedWindowCreator.cpp @@ -75,7 +75,7 @@ EmbedWindowCreator::CreateChromeWindow(nsIWebBrowserChrome *aParent, if (!qecko) return NS_ERROR_FAILURE; newEmbed = qecko; - emit newEmbed->newWindow(newEmbed, aChromeFlags); + emit newEmbed->newWindow(&newEmbed, aChromeFlags); } // check to make sure that we made a new window diff --git a/embedding/browser/qt/src/qgeckoembed.cpp b/embedding/browser/qt/src/qgeckoembed.cpp index 4e35c91cd9a1..b4f8ad63bb2f 100644 --- a/embedding/browser/qt/src/qgeckoembed.cpp +++ b/embedding/browser/qt/src/qgeckoembed.cpp @@ -226,7 +226,7 @@ QGeckoEmbedPrivate::init() // Apply the current chrome mask ApplyChromeMask(); - + window->SetVisibility(PR_TRUE); } diff --git a/embedding/browser/qt/src/qgeckoembed.h b/embedding/browser/qt/src/qgeckoembed.h index 55d9cce404a0..8f0c622561cd 100644 --- a/embedding/browser/qt/src/qgeckoembed.h +++ b/embedding/browser/qt/src/qgeckoembed.h @@ -139,7 +139,7 @@ signals: void netStart(); void netStop(); - void newWindow(QGeckoEmbed *newWindow, int chromeMask); + void newWindow(QGeckoEmbed **newWindow, int chromeMask); void visibilityChanged(bool visible); void destroyBrowser(); void openURI(const QString &url); diff --git a/embedding/browser/qt/tests/mainwindow.cpp b/embedding/browser/qt/tests/mainwindow.cpp index cdcb3b52347e..7707dd662406 100644 --- a/embedding/browser/qt/tests/mainwindow.cpp +++ b/embedding/browser/qt/tests/mainwindow.cpp @@ -81,7 +81,8 @@ MyMainWindow::MyMainWindow() SLOT(slotProgress(int, int))); connect(qecko, SIGNAL(progressAll(const QString&, int, int)), SLOT(slotProgress(const QString&, int, int))); - + connect(qecko, SIGNAL(newWindow(QGeckoEmbed**, int)), + SLOT(slotNewWindow(QGeckoEmbed**, int))); connect( location, SIGNAL(returnPressed()), SLOT(changeLocation())); @@ -147,3 +148,13 @@ void MyMainWindow::slotProgress(int current, int max) { qDebug("progress %d / %d ", current, max); } + +void MyMainWindow::slotNewWindow(QGeckoEmbed **newWindow, int chromeMask) +{ + MyMainWindow *mainWindow = new MyMainWindow(); + if(!mainWindow) return; + mainWindow->resize(400, 600); + mainWindow->show(); + + *newWindow = mainWindow->qecko; +} diff --git a/embedding/browser/qt/tests/mainwindow.h b/embedding/browser/qt/tests/mainwindow.h index 89b875c9dd09..555ebc69eff5 100644 --- a/embedding/browser/qt/tests/mainwindow.h +++ b/embedding/browser/qt/tests/mainwindow.h @@ -29,6 +29,7 @@ public: private slots: void slotProgress(int, int); void slotProgress(const QString &, int, int); + void slotNewWindow(QGeckoEmbed**, int); private: QLineEdit *location;