Closed
Bug 1443392
Opened 7 years ago
Closed 7 years ago
Window content is not resized when frame is changed but window is not resized
Categories
(Core :: Widget: Win32, enhancement, P1)
Tracking
()
RESOLVED
FIXED
mozilla61
People
(Reporter: xidorn, Assigned: xidorn)
References
Details
Attachments
(1 file)
See bug 1439875 comment 50 for the problem without correctly handling this.
According to the document of WINDOWPOS structure, when SWP_FRAMECHANGED flag is set, WM_NCCALCSIZE message is sent even if window's size is not changed. [1]
That indicates that, we may need to resize the window content in response to SWP_FRAMECHANGED even if SWP_NOSIZE flag is set, since Windows informs us that the window's client area must be calculated.
There seems to be multiple places where we may want to handle it:
* nsWindow::OnWindowPosChanged, call OnResize when SWP_FRAMECHANGED is set.
* nsWindow::OnWindowPosChanging, remove the check of no SWP_NOSIZE.
* nsWindow::ProcessMessage, call into either OnResize or UpdateNonClientMargins for WM_NCCALCSIZE when mCustomNonClient is false.
In my experiment with bug 1439875, I used the first approach, and it makes the test passes.
It is not clear to me whether we need to call into UpdateNonClientMargins in this case. The window style itself is probably not changing in this case, neither is size mode, so we probably don't need to update mNonClientOffset, which seems to be the only thing UpdateNonClientMargins is doing except a conditionally reflow.
Given this I guess it's fine to just call OnResize in this case, then...
[1] https://msdn.microsoft.com/en-us/library/windows/desktop/ms632612(v=vs.85).aspx
Comment hidden (mozreview-request) |
Assignee | ||
Comment 2•7 years ago
|
||
Hmmm... Probably need to figure out what's going on with test_popupSizeTo.xul and test_popupanchor.xul.
https://treeherder.mozilla.org/#/jobs?repo=try&revision=748d6dbea927be8d04ccabab93e33249e0b8a634
Comment hidden (mozreview-request) |
Updated•7 years ago
|
Priority: -- → P1
Assignee | ||
Comment 4•7 years ago
|
||
Comment 5•7 years ago
|
||
mozreview-review |
Comment on attachment 8956347 [details]
Bug 1443392 - Send resize event when FRAMECHANGED flag is set even if the window isn't resized.
https://reviewboard.mozilla.org/r/225216/#review231660
windowing related events are a little crazy in Windows widget. Expect odd regressions from changes like this. You migth want to wait for 61 too.
Attachment #8956347 -
Flags: review?(jmathies) → review+
Assignee | ||
Comment 6•7 years ago
|
||
OK, I'm going to land it on 61.
Pushed by xquan@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e3dae8b7e2f2
Send resize event when FRAMECHANGED flag is set even if the window isn't resized. r=jimm
Comment 8•7 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox61:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
Updated•7 years ago
|
You need to log in
before you can comment on or make changes to this bug.
Description
•