diff --git a/direct/src/plugin/p3dInstance.cxx b/direct/src/plugin/p3dInstance.cxx index f1c8ccc166..6b682d3ac2 100644 --- a/direct/src/plugin/p3dInstance.cxx +++ b/direct/src/plugin/p3dInstance.cxx @@ -201,9 +201,8 @@ set_wparams(const P3DWindowParams &wparams) { if (!_instance_window_opened && _got_fparams) { if (_splash_window == NULL) { make_splash_window(); - } else { - _splash_window->set_wparams(_wparams); } + _splash_window->set_wparams(_wparams); } // Update the instance in the sub-process. diff --git a/direct/src/plugin/p3dPythonRun.cxx b/direct/src/plugin/p3dPythonRun.cxx index 5721130c74..266f12fd6f 100755 --- a/direct/src/plugin/p3dPythonRun.cxx +++ b/direct/src/plugin/p3dPythonRun.cxx @@ -1026,10 +1026,11 @@ setup_window(P3DCInstance *inst, TiXmlElement *xwparams) { } #elif defined(HAVE_X11) - // Bad! Casting to int loses precision. - int xwindow; - if (xwparams->Attribute("parent_xwindow", &xwindow)) { - parent_window_handle = (long)xwindow; + // Use stringstream to decode the "long" attribute. + const char *parent_cstr = xwparams->Attribute("parent_xwindow"); + if (parent_cstr != NULL) { + istringstream strm(parent_cstr); + strm >> parent_window_handle; } #endif diff --git a/direct/src/plugin/p3dWindowParams.cxx b/direct/src/plugin/p3dWindowParams.cxx index 51c1d18b69..65a950b686 100644 --- a/direct/src/plugin/p3dWindowParams.cxx +++ b/direct/src/plugin/p3dWindowParams.cxx @@ -84,7 +84,13 @@ make_xml() { // The subprocess_window setting is applied by the caller. #elif defined(HAVE_X11) - xwparams->SetAttribute("parent_xwindow", (unsigned long)_parent_window._xwindow); + // TinyXml doesn't support a "long" attribute. We'll use + // stringstream to do it ourselves. + { + ostringstream strm; + strm << _parent_window._xwindow; + xwparams->SetAttribute("parent_xwindow", strm.str()); + } #endif break; diff --git a/direct/src/plugin/p3dX11SplashWindow.cxx b/direct/src/plugin/p3dX11SplashWindow.cxx index a8b632c751..4b03f9d8b0 100755 --- a/direct/src/plugin/p3dX11SplashWindow.cxx +++ b/direct/src/plugin/p3dX11SplashWindow.cxx @@ -62,8 +62,6 @@ P3DX11SplashWindow(P3DInstance *inst) : _image_filename_temp = false; _install_label_changed = false; _install_progress = 0.0; - - start_subprocess(); } //////////////////////////////////////////////////////////////////// @@ -76,6 +74,22 @@ P3DX11SplashWindow:: stop_subprocess(); } +//////////////////////////////////////////////////////////////////// +// Function: P3DX11SplashWindow::set_wparams +// Access: Public, Virtual +// Description: Changes the window parameters, e.g. to resize or +// reposition the window; or sets the parameters for the +// first time, creating the initial window. +//////////////////////////////////////////////////////////////////// +void P3DX11SplashWindow:: +set_wparams(const P3DWindowParams &wparams) { + P3DSplashWindow::set_wparams(wparams); + + if (_subprocess_pid == -1) { + start_subprocess(); + } +} + //////////////////////////////////////////////////////////////////// // Function: P3DX11SplashWindow::set_image_filename // Access: Public, Virtual @@ -402,7 +416,7 @@ subprocess_run() { //////////////////////////////////////////////////////////////////// void P3DX11SplashWindow:: receive_command() { - TiXmlDocument *doc = read_xml(_pipe_read, cerr); + TiXmlDocument *doc = read_xml(_pipe_read, nout); if (doc == NULL) { // Pipe closed or something. _subprocess_continue = false; diff --git a/direct/src/plugin/p3dX11SplashWindow.h b/direct/src/plugin/p3dX11SplashWindow.h index 22c56d3d6d..1f3486097a 100755 --- a/direct/src/plugin/p3dX11SplashWindow.h +++ b/direct/src/plugin/p3dX11SplashWindow.h @@ -35,6 +35,7 @@ public: P3DX11SplashWindow(P3DInstance *inst); virtual ~P3DX11SplashWindow(); + virtual void set_wparams(const P3DWindowParams &wparams); virtual void set_image_filename(const string &image_filename, bool image_filename_temp); virtual void set_install_label(const string &install_label);