Bug 504499 - Windows CE build always start up with the window maximized, change not persisted. r=vladimir

This commit is contained in:
Justin Dolske 2009-07-23 17:35:49 -07:00
parent bdd1b9909f
commit 8627d77d9d

View File

@ -4334,7 +4334,21 @@ PRBool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam,
else else
event.mSizeMode = nsSizeMode_Normal; event.mSizeMode = nsSizeMode_Normal;
#else #else
event.mSizeMode = mSizeMode; // Bug 504499 - Can't find a way to query if the window is maximized
// on Windows CE. So as a hacky workaround, we'll assume that if the
// window size exactly fills the screen, then it must be maximized.
RECT wr;
::GetWindowRect(mWnd, &wr);
if (::IsIconic(mWnd))
event.mSizeMode = nsSizeMode_Minimized;
else if (wr.left == 0 &&
wr.top == 0 &&
wr.right == ::GetSystemMetrics(SM_CXSCREEN) &&
wr.bottom == ::GetSystemMetrics(SM_CYSCREEN))
event.mSizeMode = nsSizeMode_Maximized;
else
event.mSizeMode = nsSizeMode_Normal;
#endif #endif
InitEvent(event); InitEvent(event);