Bug 589868 - Qt widget/EGL does not work on Maemo anymore. r=dougt a=blocking-fennec
authorOleg Romashin <romaxa@gmail.com>
Tue, 31 Aug 2010 09:35:57 -0700
changeset 51781 ccf0c898b4c8b7cde3c0dbf7e234d199476fb801
parent 51780 0d8d6369655d6b16c11cbf97afa761890016634c
child 51782 bfd87c4de2ff57f6b9e7244cdd85f49156f3b8b1
push id15425
push userdougt@mozilla.com
push dateTue, 31 Aug 2010 16:58:55 +0000
treeherdermozilla-central@ccf0c898b4c8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdougt, blocking-fennec
bugs589868
milestone2.0b6pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 589868 - Qt widget/EGL does not work on Maemo anymore. r=dougt a=blocking-fennec
widget/src/qt/nsWindow.cpp
widget/src/qt/nsWindow.h
--- a/widget/src/qt/nsWindow.cpp
+++ b/widget/src/qt/nsWindow.cpp
@@ -1967,16 +1967,36 @@ nsWindow::Create(nsIWidget        *aPare
 
     // check if we should listen for resizes
     mListenForResizes = (aNativeParent ||
                          (aInitData && aInitData->mListenForResizes));
 
     return NS_OK;
 }
 
+already_AddRefed<nsIWidget>
+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)
 {
     if (!mWidget)
       return NS_ERROR_FAILURE;
 
     nsXPIDLString brandName;
     GetBrandName(brandName);
--- a/widget/src/qt/nsWindow.h
+++ b/widget/src/qt/nsWindow.h
@@ -125,16 +125,26 @@ public:
     NS_IMETHOD         Create(nsIWidget        *aParent,
                               nsNativeWidget   aNativeParent,
                               const nsIntRect  &aRect,
                               EVENT_CALLBACK   aHandleEventFunction,
                               nsIDeviceContext *aContext,
                               nsIAppShell      *aAppShell,
                               nsIToolkit       *aToolkit,
                               nsWidgetInitData *aInitData);
+
+    virtual already_AddRefed<nsIWidget>
+    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);
     virtual float      GetDPI();
     NS_IMETHOD         Show(PRBool aState);
     NS_IMETHOD         SetModal(PRBool aModal);
     NS_IMETHOD         IsVisible(PRBool & aState);
     NS_IMETHOD         ConstrainPosition(PRBool aAllowSlop,