소스 검색

more robust window handling

cxgeorge 24 년 전
부모
커밋
ec93057fcb

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

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

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

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

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

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

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 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;
   virtual TypeHandle get_gsg_type() const;
   static GraphicsWindow* make_wdxGraphicsWindow(const FactoryParams &params);
   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);
   LONG window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
   void process_events(void);
   void process_events(void);
 
 
@@ -92,14 +90,14 @@ protected:
 
 
 public:
 public:
   HWND              _mwindow;
   HWND              _mwindow;
-  HWND              _hParentWindow;
+  HWND              _hOldForegroundWindow;  
 
 
 private:
 private:
   HDC               _hdc;
   HDC               _hdc;
   HPALETTE          _colormap;
   HPALETTE          _colormap;
   typedef enum { NotAdjusting,MovingOrResizing,Resizing } WindowAdjustType;
   typedef enum { NotAdjusting,MovingOrResizing,Resizing } WindowAdjustType;
   WindowAdjustType _WindowAdjustingType;
   WindowAdjustType _WindowAdjustingType;
-  HCURSOR _hMouseCrossIcon;
+  HCURSOR _hMouseCursor;
   bool    _bSizeIsMaximized;
   bool    _bSizeIsMaximized;
   bool              _mouse_input_enabled;
   bool              _mouse_input_enabled;
   bool              _mouse_motion_enabled;
   bool              _mouse_motion_enabled;
@@ -107,6 +105,8 @@ private:
   bool              _mouse_entry_enabled;
   bool              _mouse_entry_enabled;
   int               _entry_state;
   int               _entry_state;
   bool              _ignore_key_repeat;
   bool              _ignore_key_repeat;
+  bool              _exiting_window;
+  bool              _window_inactive;
 
 
 public:
 public:
   static TypeHandle get_class_type(void);
   static TypeHandle get_class_type(void);
@@ -114,6 +114,9 @@ public:
   virtual TypeHandle get_type(void) const;
   virtual TypeHandle get_type(void) const;
   virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
   virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
 
 
+  void DestroyMe(bool bAtExitFnCalled);
+  virtual void close_window(int exit_status);
+
 private:
 private:
   static TypeHandle _type_handle;
   static TypeHandle _type_handle;
 };
 };

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.