From 8313173ea6a4876df4240641b5f292b9e1b7cfc2 Mon Sep 17 00:00:00 2001 From: Oleg Romashin Date: Tue, 31 Aug 2010 09:35:57 -0700 Subject: [PATCH] Bug 589868 - Qt widget/EGL does not work on Maemo anymore. r=dougt a=blocking-fennec --- widget/src/qt/nsWindow.cpp | 20 ++++++++++++++++++++ widget/src/qt/nsWindow.h | 10 ++++++++++ 2 files changed, 30 insertions(+) diff --git a/widget/src/qt/nsWindow.cpp b/widget/src/qt/nsWindow.cpp index 957fd5d73df9..8585d1b18a6f 100644 --- a/widget/src/qt/nsWindow.cpp +++ b/widget/src/qt/nsWindow.cpp @@ -1972,6 +1972,26 @@ nsWindow::Create(nsIWidget *aParent, return NS_OK; } +already_AddRefed +nsWindow::CreateChild(const nsIntRect& aRect, + EVENT_CALLBACK aHandleEventFunction, + nsIDeviceContext* aContext, + nsIAppShell* aAppShell, + nsIToolkit* aToolkit, + nsWidgetInitData* aInitData, + PRBool /*aForceUseIWidgetParent*/) +{ + //We need to force parent widget, otherwise GetTopLevelWindow doesn't work + return nsBaseWidget::CreateChild(aRect, + aHandleEventFunction, + aContext, + aAppShell, + aToolkit, + aInitData, + PR_TRUE); // Force parent +} + + NS_IMETHODIMP nsWindow::SetWindowClass(const nsAString &xulWinType) { diff --git a/widget/src/qt/nsWindow.h b/widget/src/qt/nsWindow.h index 19a84a1bc6f5..8ec2c8b91276 100644 --- a/widget/src/qt/nsWindow.h +++ b/widget/src/qt/nsWindow.h @@ -130,6 +130,16 @@ public: nsIAppShell *aAppShell, nsIToolkit *aToolkit, nsWidgetInitData *aInitData); + + virtual already_AddRefed + CreateChild(const nsIntRect& aRect, + EVENT_CALLBACK aHandleEventFunction, + nsIDeviceContext* aContext, + nsIAppShell* aAppShell = nsnull, + nsIToolkit* aToolkit = nsnull, + nsWidgetInitData* aInitData = nsnull, + PRBool aForceUseIWidgetParent = PR_TRUE); + NS_IMETHOD Destroy(void); NS_IMETHOD SetParent(nsIWidget* aNewParent); virtual nsIWidget *GetParent(void);