fix maximize on win32

This commit is contained in:
Eduardo Bart 2011-12-29 23:30:09 -02:00
parent 808eb8cd80
commit fd9b9a85ce
3 changed files with 4 additions and 12 deletions

View File

@ -263,7 +263,6 @@ void WIN32Window::internalCreateWindow()
DWORD dwExStyle = WS_EX_APPWINDOW | WS_EX_WINDOWEDGE; DWORD dwExStyle = WS_EX_APPWINDOW | WS_EX_WINDOWEDGE;
DWORD dwStyle = WS_OVERLAPPEDWINDOW | WS_CLIPSIBLINGS | WS_CLIPCHILDREN; DWORD dwStyle = WS_OVERLAPPEDWINDOW | WS_CLIPSIBLINGS | WS_CLIPCHILDREN;
dump << m_size;
RECT windowRect = {m_pos.x, m_pos.y, m_pos.x + m_size.width(), m_pos.y + m_size.height()}; RECT windowRect = {m_pos.x, m_pos.y, m_pos.x + m_size.width(), m_pos.y + m_size.height()};
AdjustWindowRectEx(&windowRect, dwStyle, FALSE, dwExStyle); AdjustWindowRectEx(&windowRect, dwStyle, FALSE, dwExStyle);
@ -471,15 +470,14 @@ LRESULT WIN32Window::windowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar
break; break;
} }
case WM_MOVE: { case WM_MOVE: {
m_lastWindowPos = m_pos;
m_pos.x = LOWORD(lParam); m_pos.x = LOWORD(lParam);
m_pos.y = HIWORD(lParam); m_pos.y = HIWORD(lParam);
dump << m_pos;
break; break;
} }
case WM_SIZE: { case WM_SIZE: {
switch(wParam) { switch(wParam) {
case SIZE_MAXIMIZED: case SIZE_MAXIMIZED:
m_pos = m_lastWindowPos;
m_maximized = true; m_maximized = true;
break; break;
case SIZE_RESTORED: case SIZE_RESTORED:
@ -488,12 +486,8 @@ LRESULT WIN32Window::windowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar
} }
m_visible = !(wParam == SIZE_MINIMIZED); m_visible = !(wParam == SIZE_MINIMIZED);
if(!m_maximized) {
m_size.setWidth(LOWORD(lParam)); m_size.setWidth(LOWORD(lParam));
m_size.setHeight(HIWORD(lParam)); m_size.setHeight(HIWORD(lParam));
}
m_onResize(m_size); m_onResize(m_size);
break; break;
} }

View File

@ -77,7 +77,6 @@ private:
HDC m_deviceContext; HDC m_deviceContext;
HGLRC m_glContext; HGLRC m_glContext;
bool m_maximized; bool m_maximized;
Point m_lastWindowPos;
std::string m_clipboardText; std::string m_clipboardText;
std::map<int, Fw::Key> m_keyMap; std::map<int, Fw::Key> m_keyMap;
}; };

View File

@ -560,7 +560,6 @@ void X11Window::poll()
} }
// updates window pos // updates window pos
if(m_pos != newPos && !isMaximized())
m_pos = newPos; m_pos = newPos;
break; break;
} }