Last Comment Bug 683085 - NativeParentWidget used incorrectly in Widget Qt port
: NativeParentWidget used incorrectly in Widget Qt port
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Widget: Qt (show other bugs)
: Trunk
: x86 Linux
: -- normal (vote)
: mozilla9
Assigned To: Oleg Romashin (:romaxa)
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-08-29 21:54 PDT by Oleg Romashin (:romaxa)
Modified: 2011-09-26 07:43 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Fix embedding widget initialization in Qt port (4.01 KB, patch)
2011-08-29 21:57 PDT, Oleg Romashin (:romaxa)
dougt: review+
Details | Diff | Review
Added comment, to push (4.23 KB, patch)
2011-09-18 23:53 PDT, Oleg Romashin (:romaxa)
romaxa: review+
Details | Diff | Review

Description Oleg Romashin (:romaxa) 2011-08-29 21:54:40 PDT
Currently we are casting aNativeParent widget to MozQWidget and trying to get Receiver in createQWidget function, which is going to be incorrect in case of embedding (when nativeParent will be just QGraphicsWidget from 3rd party embedding application)
Comment 1 Oleg Romashin (:romaxa) 2011-08-29 21:57:27 PDT
Created attachment 556753 [details] [diff] [review]
Fix embedding widget initialization in Qt port

Also created Magic parent widget handle, in order to make it possible to init mozqwidget without any parent (windowless embedding).
Comment 2 Doug Turner (:dougt) 2011-08-30 21:25:18 PDT
Comment on attachment 556753 [details] [diff] [review]
Fix embedding widget initialization in Qt port

Review of attachment 556753 [details] [diff] [review]:
-----------------------------------------------------------------

::: widget/src/qt/nsWindow.cpp
@@ +136,5 @@
>  #define GLdouble_defined 1
>  #include "Layers.h"
>  #include "LayerManagerOGL.h"
>  
> +#define PARENTLESS_WIDGET (void*)0x13579

What the hell is this? ;D
Comment 3 Oleg Romashin (:romaxa) 2011-08-30 22:49:38 PDT
it is the hack, in order to allow to create nsIWidget without native and non-native parent,
Current code like this: http://mxr.mozilla.org/mozilla-central/source/embedding/browser/webBrowser/nsWebBrowser.cpp#1120
does not allow us to create BaseWindow without any parent, but that would be useful for windowless embedding or creating simple rendering base and get rendered layout from Layout::RenderDocument API...

This hack simply allow to pass that narrow place and detect this mode.
Comment 4 Doug Turner (:dougt) 2011-09-18 23:39:00 PDT
Comment on attachment 556753 [details] [diff] [review]
Fix embedding widget initialization in Qt port

Review of attachment 556753 [details] [diff] [review]:
-----------------------------------------------------------------

r+ if you add a comment about that value.

::: widget/src/qt/nsWindow.cpp
@@ +136,5 @@
>  #define GLdouble_defined 1
>  #include "Layers.h"
>  #include "LayerManagerOGL.h"
>  
> +#define PARENTLESS_WIDGET (void*)0x13579

You need to comment why this value is picked.
Comment 5 Oleg Romashin (:romaxa) 2011-09-18 23:53:04 PDT
Created attachment 560857 [details] [diff] [review]
Added comment, to push

Moving r+
Comment 7 :Ehsan Akhgari (out sick) 2011-09-26 07:43:03 PDT
https://hg.mozilla.org/mozilla-central/rev/22ae18b4d013

Note You need to log in before you can comment on or make changes to this bug.