瀏覽代碼

fix set_origin

David Rose 19 年之前
父節點
當前提交
6feda4a574
共有 1 個文件被更改,包括 5 次插入2 次删除
  1. 5 2
      panda/src/windisplay/winGraphicsWindow.cxx

+ 5 - 2
panda/src/windisplay/winGraphicsWindow.cxx

@@ -588,19 +588,22 @@ do_reshape_request(int x_origin, int y_origin, bool has_origin,
     GetWindowInfo(_hWnd, &wi);
     GetWindowInfo(_hWnd, &wi);
     AdjustWindowRectEx(&view_rect, wi.dwStyle, FALSE, wi.dwExStyle);
     AdjustWindowRectEx(&view_rect, wi.dwStyle, FALSE, wi.dwExStyle);
 
 
-    if (_properties.has_origin()) {
+    UINT flags = SWP_NOZORDER | SWP_NOSENDCHANGING;
+
+    if (has_origin) {
       x_origin = view_rect.left;
       x_origin = view_rect.left;
       y_origin = view_rect.top;
       y_origin = view_rect.top;
       
       
     } else {
     } else {
       x_origin = CW_USEDEFAULT;
       x_origin = CW_USEDEFAULT;
       y_origin = CW_USEDEFAULT;
       y_origin = CW_USEDEFAULT;
+      flags |= SWP_NOMOVE;
     }
     }
 
 
     SetWindowPos(_hWnd, NULL, x_origin, y_origin,
     SetWindowPos(_hWnd, NULL, x_origin, y_origin,
                  view_rect.right - view_rect.left,
                  view_rect.right - view_rect.left,
                  view_rect.bottom - view_rect.top,
                  view_rect.bottom - view_rect.top,
-                 SWP_NOZORDER | SWP_NOMOVE | SWP_NOSENDCHANGING);
+                 flags);
 
 
     // This isn't quite right, because handle_reshape() calls
     // This isn't quite right, because handle_reshape() calls
     // system_changed_properties(), generating the event indicating
     // system_changed_properties(), generating the event indicating