From d6647e3a85c4780ee0406d7b3d5cc3d81cef9bd6 Mon Sep 17 00:00:00 2001 From: David Rose Date: Fri, 2 Oct 2009 21:54:16 +0000 Subject: [PATCH] set_visible for osx --- direct/src/plugin/p3dOsxSplashWindow.cxx | 21 ++++++++++++++++++++- direct/src/plugin/p3dOsxSplashWindow.h | 1 + 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/direct/src/plugin/p3dOsxSplashWindow.cxx b/direct/src/plugin/p3dOsxSplashWindow.cxx index f11bd251a0..6a400e23c1 100644 --- a/direct/src/plugin/p3dOsxSplashWindow.cxx +++ b/direct/src/plugin/p3dOsxSplashWindow.cxx @@ -104,10 +104,29 @@ set_wparams(const P3DWindowParams &wparams) { TransformProcessType(&psn, kProcessTransformToForegroundApplication); SetFrontProcess(&psn); - ShowWindow(_toplevel_window); + if (_visible) { + ShowWindow(_toplevel_window); + } } } +} +//////////////////////////////////////////////////////////////////// +// Function: P3DOsxSplashWindow::set_visible +// Access: Public, Virtual +// Description: Makes the splash window visible or invisible, so as +// not to compete with the embedded Panda window in the +// same space. +//////////////////////////////////////////////////////////////////// +void P3DOsxSplashWindow:: +set_visible(bool visible) { + P3DSplashWindow::set_visible(visible); + + if (_visible) { + ShowWindow(_toplevel_window); + } else { + HideWindow(_toplevel_window); + } } //////////////////////////////////////////////////////////////////// diff --git a/direct/src/plugin/p3dOsxSplashWindow.h b/direct/src/plugin/p3dOsxSplashWindow.h index 3cedb49f31..7fd01a5583 100644 --- a/direct/src/plugin/p3dOsxSplashWindow.h +++ b/direct/src/plugin/p3dOsxSplashWindow.h @@ -34,6 +34,7 @@ public: virtual ~P3DOsxSplashWindow(); virtual void set_wparams(const P3DWindowParams &wparams); + virtual void set_visible(bool visible); virtual void set_image_filename(const string &image_filename, ImagePlacement image_placement); virtual void set_install_label(const string &install_label);