nsWindow::GetNonClientMargins() is using ::GetSystemMetrics(SM_CYFRAME) for both horizontal and vertical borders

RESOLVED FIXED in mozilla16

Status

()

Core
Widget: Win32
--
minor
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: masayuki, Assigned: jhk)

Tracking

Trunk
mozilla16
x86_64
Windows 7
Points:
---
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [good first bug][mentor=masayuki][lang=c++])

Attachments

(1 attachment)

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.
> 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)
Whiteboard: [good first bug]

Updated

5 years ago
Whiteboard: [good first bug] → [good first bug][mentor=masayuki][lang=c++]
(Assignee)

Comment 2

5 years ago
Created attachment 631355 [details] [diff] [review]
Patch(v1)
Attachment #631355 - Flags: feedback?(masayuki)
Comment on attachment 631355 [details] [diff] [review]
Patch(v1)

Thank you for the patch. I think this is right. Requesting r to jimm.
Attachment #631355 - Flags: review?(jmathies)
Attachment #631355 - Flags: feedback?(masayuki)
Attachment #631355 - Flags: feedback+

Updated

5 years ago
Attachment #631355 - Flags: review?(jmathies) → review+
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.
Assignee: nobody → jigneshhk1992
Status: NEW → ASSIGNED
https://hg.mozilla.org/mozilla-central/rev/cf39986528f8
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Target Milestone: --- → mozilla16
You need to log in before you can comment on or make changes to this bug.