Closed Bug 1522848 Opened 8 months ago Closed 6 months ago

Add a lockAspectRatio window feature for Windows

Categories

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

enhancement

Tracking

()

VERIFIED FIXED
mozilla68
Tracking Status
firefox68 --- verified
firefox69 --- verified

People

(Reporter: mconley, Assigned: JSON_voorhees)

References

Details

Attachments

(3 files, 1 obsolete file)

This will be a chrome-only extension to the window.open feature string list. I imagine the string will be "keepAspectRatio", and the resulting window, if resizable, will maintain aspect ratio during resize.

Hey JSON_Voorhees, did you want to try to take this on?

I added the alwaysOnTop capability in bug 1519893, which maybe you can use as a template.

Here's some documentation on how we might keep aspect ratio in the widget/windows/nsWindow.cpp implementation:

https://social.msdn.microsoft.com/Forums/en-US/b0df3d1f-e211-4f54-a079-09af0096410e/keeping-a-windows-aspect-ratio-during-resize?forum=wpf

Flags: needinfo?(djustice)

mconley Yeah, I can start on it today.

Flags: needinfo?(djustice)
Assignee: nobody → djustice

I talked to JSON_voorhees about this yesterday.

Our current plan is to put an aspect-ratio locking method onto nsIXULWindow, which nsWindowWatcher will call into after it's done sizing a newly opened window.

Summary: Add a keepAspectRatio window feature for Windows → Add a lockAspectRatio window feature for Windows

Hey aklotz,

How do you feel about how we're locking aspect ratio here for Windows? Seem okay to you?

Flags: needinfo?(aklotz)

(In reply to Mike Conley (:mconley) (:⚙️) from comment #6)

How do you feel about how we're locking aspect ratio here for Windows? Seem okay to you?

I think we're okay here? I'd like to bounce this to Jim to see whether he has any thoughts.

Flags: needinfo?(aklotz) → needinfo?(jmathies)
Attachment #9045751 - Attachment is obsolete: true

Hey JSON_Voorhees,

So I tested this patch out, and it seems to work pretty well, but there seem to be some cases where it glitches out a bit. Specifically, when I'm corner-resizing the window. See the attached video. The flicker I'm less worried about for now - I'm more worried about the sudden shifts in window size, and then the window scurrying off to the left.

Any idea what's going on there?

Flags: needinfo?(djustice)

Mike,

I was able to reproduce locally. It looks to me like the jumping is happening when the user sizes the window down to a really small dimension. A minimum size may help prevent this behavior. What do you think?

Flags: needinfo?(djustice) → needinfo?(mconley)
Flags: needinfo?(mconley)

(In reply to Aaron Klotz [:aklotz] from comment #7)

(In reply to Mike Conley (:mconley) (:⚙️) from comment #6)

How do you feel about how we're locking aspect ratio here for Windows? Seem okay to you?

I think we're okay here? I'd like to bounce this to Jim to see whether he
has any thoughts.

Seems ok to me to introduce something like this.

Flags: needinfo?(jmathies)
Priority: -- → P1
Pushed by mconley@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/946839452979
Add Lock Aspect Ratio feature. r=mconley,jmathies.
Status: NEW → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
Flags: qe-verify+
QA Contact: george.craciun

Verified as fixed on the latest Nightly build (Fx69) and on the previous version (Fx68) on Windows 7 and Windows 10.
The aspect ratio is locked and the resize is working accordingly.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.