Browse Source

more robust window handling

cxgeorge 24 years ago
parent
commit
ec93057fcb

+ 4 - 0
panda/src/wdxdisplay/config_wdxdisplay.cxx

@@ -29,6 +29,8 @@ ConfigureFn(config_wdxdisplay) {
   init_libwdxdisplay();
 }
 
+extern void AtExitFn(void);
+
 ////////////////////////////////////////////////////////////////////
 //     Function: init_libwdxdisplay
 //  Description: Initializes the library.  This must be called at
@@ -45,6 +47,8 @@ init_libwdxdisplay() {
   }
   initialized = true;
 
+  atexit(AtExitFn);
+
   wdxGraphicsPipe::init_type();
   GraphicsPipe::get_factory().register_factory(
             wdxGraphicsPipe::get_class_type(),

+ 2 - 2
panda/src/wdxdisplay/wdxGraphicsPipe.cxx

@@ -31,8 +31,8 @@ TypeHandle wdxGraphicsPipe::_type_handle;
 
 wdxGraphicsPipe::wdxGraphicsPipe(const PipeSpecifier& spec)
 : InteractiveGraphicsPipe(spec) {
-    _width = GetSystemMetrics(SM_CXSCREEN);
-    _height = GetSystemMetrics(SM_CYSCREEN);
+//    _width = GetSystemMetrics(SM_CXSCREEN);
+//    _height = GetSystemMetrics(SM_CYSCREEN);
     _shift = false;
 //  global_pipe = this;
 }

+ 2 - 2
panda/src/wdxdisplay/wdxGraphicsPipe.h

@@ -67,8 +67,8 @@ private:
 
   static TypeHandle _type_handle;
 
-  int               _width;
-  int               _height;
+//  int               _width;
+//  int               _height;
   bool              _shift;
 
 protected:

File diff suppressed because it is too large
+ 299 - 253
panda/src/wdxdisplay/wdxGraphicsWindow.cxx


+ 7 - 4
panda/src/wdxdisplay/wdxGraphicsWindow.h

@@ -60,8 +60,6 @@ public:
   virtual TypeHandle get_gsg_type() const;
   static GraphicsWindow* make_wdxGraphicsWindow(const FactoryParams &params);
 
-  static LONG WINAPI static_window_proc(HWND hwnd, UINT msg, WPARAM wparam,
-    LPARAM lparam);
   LONG window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
   void process_events(void);
 
@@ -92,14 +90,14 @@ protected:
 
 public:
   HWND              _mwindow;
-  HWND              _hParentWindow;
+  HWND              _hOldForegroundWindow;  
 
 private:
   HDC               _hdc;
   HPALETTE          _colormap;
   typedef enum { NotAdjusting,MovingOrResizing,Resizing } WindowAdjustType;
   WindowAdjustType _WindowAdjustingType;
-  HCURSOR _hMouseCrossIcon;
+  HCURSOR _hMouseCursor;
   bool    _bSizeIsMaximized;
   bool              _mouse_input_enabled;
   bool              _mouse_motion_enabled;
@@ -107,6 +105,8 @@ private:
   bool              _mouse_entry_enabled;
   int               _entry_state;
   bool              _ignore_key_repeat;
+  bool              _exiting_window;
+  bool              _window_inactive;
 
 public:
   static TypeHandle get_class_type(void);
@@ -114,6 +114,9 @@ public:
   virtual TypeHandle get_type(void) const;
   virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
 
+  void DestroyMe(bool bAtExitFnCalled);
+  virtual void close_window(int exit_status);
+
 private:
   static TypeHandle _type_handle;
 };

Some files were not shown because too many files changed in this diff