Last Comment Bug 733627 - nsWindow::GetNonClientMargins() is using ::GetSystemMetrics(SM_CYFRAME) for both horizontal and vertical borders
: nsWindow::GetNonClientMargins() is using ::GetSystemMetrics(SM_CYFRAME) for b...
Status: RESOLVED FIXED
[good first bug][mentor=masayuki][lan...
:
Product: Core
Classification: Components
Component: Widget: Win32 (show other bugs)
: Trunk
: x86_64 Windows 7
: -- minor (vote)
: mozilla16
Assigned To: Jignesh Kakadiya [:jhk]
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-06 17:30 PST by Masayuki Nakano [:masayuki] (Mozilla Japan)
Modified: 2012-06-10 15:26 PDT (History)
5 users (show)
ryanvm: in‑testsuite-
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch(v1) (916 bytes, patch)
2012-06-08 05:23 PDT, Jignesh Kakadiya [:jhk]
jmathies: review+
masayuki: feedback+
Details | Diff | Splinter Review

Description Masayuki Nakano [:masayuki] (Mozilla Japan) 2012-03-06 17:30:44 PST
http://mxr.mozilla.org/mozilla-central/source/widget/windows/nsWindow.cpp#1933

1932 NS_IMETHODIMP
1933 nsWindow::GetNonClientMargins(nsIntMargin &margins)
1934 {
1935   nsWindow * window = GetTopLevelWindow(true);
1936   if (window && window != this) {
1937     return window->GetNonClientMargins(margins);
1938   }
1939 
1940   if (mCustomNonClient) {
1941     margins = mNonClientMargins;
1942     return NS_OK;
1943   }
1944 
1945   margins.top = GetSystemMetrics(SM_CYCAPTION);
1946   margins.bottom = GetSystemMetrics(SM_CYFRAME);
1947   margins.top += margins.bottom;
1948   margins.left = margins.right = GetSystemMetrics(SM_CYFRAME);
1949 
1950   return NS_OK;
1951 }

#1948 should be SM_CXFRAME.

I don't know how to set different size for both borders.
Comment 1 Masatoshi Kimura [:emk] 2012-03-06 17:52:37 PST
> I don't know how to set different size for both borders.
Long time ago, device pixels were not square on some video modes. (such as CGA 640 x 200 mode)
Comment 2 Jignesh Kakadiya [:jhk] 2012-06-08 05:23:07 PDT
Created attachment 631355 [details] [diff] [review]
Patch(v1)
Comment 3 Masayuki Nakano [:masayuki] (Mozilla Japan) 2012-06-09 00:24:38 PDT
Comment on attachment 631355 [details] [diff] [review]
Patch(v1)

Thank you for the patch. I think this is right. Requesting r to jimm.
Comment 4 Masayuki Nakano [:masayuki] (Mozilla Japan) 2012-06-09 20:45:59 PDT
Landed on inbound. It'll be merged to mozilla-central in a day if it passes all tests.
https://hg.mozilla.org/integration/mozilla-inbound/rev/cf39986528f8

Thank you.
Comment 5 Ryan VanderMeulen [:RyanVM] 2012-06-10 15:26:10 PDT
https://hg.mozilla.org/mozilla-central/rev/cf39986528f8

Note You need to log in before you can comment on or make changes to this bug.