Closed Bug 1443392 Opened 2 years ago Closed 2 years ago

Window content is not resized when frame is changed but window is not resized


(Core :: Widget: Win32, enhancement, P1)




Tracking Status
firefox60 --- wontfix
firefox61 --- fixed


(Reporter: xidorn, Assigned: xidorn)




(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...

Depends on: 1443397
Hmmm... Probably need to figure out what's going on with test_popupSizeTo.xul and test_popupanchor.xul.
Priority: -- → P1
Comment on attachment 8956347 [details]
Bug 1443392 - Send resize event when FRAMECHANGED flag is set even if the window isn't resized.

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+
OK, I'm going to land it on 61.
Pushed by
Send resize event when FRAMECHANGED flag is set even if the window isn't resized. r=jimm
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
You need to log in before you can comment on or make changes to this bug.