Browse Source

set_visible for osx

David Rose 16 years ago
parent
commit
d6647e3a85
2 changed files with 21 additions and 1 deletions
  1. 20 1
      direct/src/plugin/p3dOsxSplashWindow.cxx
  2. 1 0
      direct/src/plugin/p3dOsxSplashWindow.h

+ 20 - 1
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);
+  }
 }
 
 ////////////////////////////////////////////////////////////////////

+ 1 - 0
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);