Browse Source

windisplay: fix origin not changing upon window being dragged

rdb 8 years ago
parent
commit
019df482d6
1 changed files with 10 additions and 6 deletions
  1. 10 6
      panda/src/windisplay/winGraphicsWindow.cxx

+ 10 - 6
panda/src/windisplay/winGraphicsWindow.cxx

@@ -1440,15 +1440,12 @@ window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) {
     break;
     break;
 
 
   case WM_SIZE:
   case WM_SIZE:
+    // Actually, since we don't return in WM_WINDOWPOSCHANGED, WM_SIZE won't
+    // end up being called at all.  This is more efficient according to MSDN.
     if (windisplay_cat.is_debug()) {
     if (windisplay_cat.is_debug()) {
       windisplay_cat.debug()
       windisplay_cat.debug()
         << "WM_SIZE: " << hwnd << ", " << wparam << "\n";
         << "WM_SIZE: " << hwnd << ", " << wparam << "\n";
     }
     }
-
-    // Resist calling handle_reshape before the window has opened.
-    if (_hWnd != NULL) {
-      handle_reshape();
-    }
     break;
     break;
 
 
   case WM_EXITSIZEMOVE:
   case WM_EXITSIZEMOVE:
@@ -1456,8 +1453,15 @@ window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) {
     break;
     break;
 
 
   case WM_WINDOWPOSCHANGED:
   case WM_WINDOWPOSCHANGED:
+    if (windisplay_cat.is_debug()) {
+      windisplay_cat.debug()
+        << "WM_WINDOWPOSCHANGED: " << hwnd << ", " << wparam << "\n";
+    }
+    if (_hWnd != NULL) {
+      handle_reshape();
+    }
     adjust_z_order();
     adjust_z_order();
-    break;
+    return 0;
 
 
   case WM_PAINT:
   case WM_PAINT:
     // In response to WM_PAINT, we check to see if there are any update
     // In response to WM_PAINT, we check to see if there are any update