aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--embed/mozilla/AutoWindowModalState.cpp33
2 files changed, 34 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index f49323856..01092d1f9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-10-06 Christian Persch <chpe@cvs.gnome.org>
+
+ * embed/mozilla/AutoWindowModalState.cpp:
+
+ Use the top DOM window here, and adapt to gecko 1.8.1.
+
2006-10-05 Christian Persch <chpe@cvs.gnome.org>
* embed/mozilla/GeckoSpellCheckEngine.cpp:
diff --git a/embed/mozilla/AutoWindowModalState.cpp b/embed/mozilla/AutoWindowModalState.cpp
index ca7596b38..20100e60c 100644
--- a/embed/mozilla/AutoWindowModalState.cpp
+++ b/embed/mozilla/AutoWindowModalState.cpp
@@ -25,19 +25,42 @@
AutoWindowModalState::AutoWindowModalState (nsIDOMWindow *aWindow)
{
-#ifdef HAVE_GECKO_1_9
- mWindow = do_QueryInterface (aWindow);
+#ifdef HAVE_GECKO_1_8_1
+ if (aWindow) {
+ nsresult rv;
+ nsCOMPtr<nsIDOMWindow> topWin;
+ rv = aWindow->GetTop (getter_AddRefs (topWin));
+ if (NS_SUCCEEDED (rv)) {
+ mWindow = do_QueryInterface (topWin);
+ }
+ NS_ASSERTION (mWindow, "Should have a window here!");
+ }
+
if (mWindow) {
+#ifdef HAVE_GECKO_1_9
mWindow->EnterModalState ();
+#else
+ nsCOMPtr<nsPIDOMWindow_MOZILLA_1_8_BRANCH> window (do_QueryInterface (mWindow));
+ NS_ENSURE_TRUE (window, );
+
+ window->EnterModalState ();
+#endif /* HAVE_GECKO_1_9 */
}
-#endif
+#endif /* HAVE_GECKO_1_8_1 */
}
AutoWindowModalState::~AutoWindowModalState()
{
-#ifdef HAVE_GECKO_1_9
+#ifdef HAVE_GECKO_1_8_1
if (mWindow) {
+#ifdef HAVE_GECKO_1_9
mWindow->LeaveModalState ();
+#else
+ nsCOMPtr<nsPIDOMWindow_MOZILLA_1_8_BRANCH> window (do_QueryInterface (mWindow));
+ NS_ENSURE_TRUE (window, );
+
+ window->LeaveModalState ();
+#endif /* HAVE_GECKO_1_9 */
}
-#endif
+#endif /* HAVE_GECKO_1_8_1 */
}