Hello together, right now i become desperate with embedding mozilla in my own (minimal) application on Linux + Gtk. I get a segfault when calling nsIBaseWindow->Create() and i wonder, which (minimal) initialization steps are necessary until it should be safe to this method.
What did i tried so far?: Lets assume we have a working Gtk main window: gtk_init (&argc, &argv); GtkWidget *window = gtk_window_new (GTK_WINDOW_TOPLEVEL); First i initialized the mozilla runtime (i'll omit error handling statements for clearness): XRE_InitEmbedding(xulDir, appDir, nsnull, nsnull, 0); Then, in a class which implements nsIWebBrowserChrome, nsIEmbeddingSiteWindow and nsIWebProgressListener, i created a nsIWebBrowser instance in a helper method: webBrowser = do_CreateInstance(NS_WEBBROWSER_CONTRACTID, &result); Next i set the container of the previously created nsIWebBrowser: webBrowser->SetContainerWindow(NS_STATIC_CAST(nsIWebBrowserChrome*, this)); Then i created a nsIBaseWindow instance and initialized it: baseWindow = do_QueryInterface(webBrowser); baseWindow->InitWindow(nativeWindowHandle, nsnull, 0, 0, 50, 50); Now when i try to create it via: baseWindow->Create(); my application produces a segfault. Any ideas what i am missing here? Some additional background information and questions: - i compiled xulrunner on my own with the 'FIREFOX_2_0_0_4_RELEASE' branch and following .mozconfig: mk_add_options MOZ_CO_PROJECT=xulrunner mk_add_options [EMAIL PROTECTED]@/obj-xulrunner ac_add_options --enable-application=xulrunner ac_add_options --disable-javaxpcom ac_add_options --enable-default-toolkit=gtk2 do i need additional dependencies here? - do i have to pass a Gtk window as a native window handle when xulrunner is build against Gtk2 or can i use a X11 window handle as well? - what is the status for xulrunner + xlib/cairo-xlib? i tried to compile both xlib and cairo-xlib options with the 'FIREFOX_2_0_0_4_RELEASE' branch but got compile errors. thanks in advance and best regards, David _______________________________________________ dev-embedding mailing list [email protected] https://lists.mozilla.org/listinfo/dev-embedding
