Closed Bug 1725590 Opened 3 years ago Closed 3 years ago

Support Snap Assist on Win11

Categories

(Firefox :: Tabbed Browser, enhancement)

Desktop
Windows 11
enhancement

Tracking

()

RESOLVED DUPLICATE of bug 1718629

People

(Reporter: RT, Unassigned)

Details

When hovering over the maximize or restore down buttons on Win11, apps display the new Win11 snap assist feature (see details on https://www.thewindowsclub.com/enable-snap-layouts-on-windows-11).
During MR1 implementation the design guidelines for win10 were that the titlebar buttons should be as tall as the tabs (ie there should be no "dead" space beneath the buttons, above the toolbar), as a result custom buttons were created which imply native behaviors such as snap assist are not supported.

It seems our options are:

  • Reconsider implementation and find a way to support design guidelines and native OS behavior on buttons
  • Adjust design guidelines so that buttons are unchanged when off hover but have a reduced height on hover, leaving a dead space between the toolbar and buttons
OS: Unspecified → Windows 11
Hardware: Unspecified → Desktop

(In reply to Romain Testard [:RT] from comment #0)

During MR1 implementation the design guidelines for win10 were that the titlebar buttons should be as tall as the tabs (ie there should be no "dead" space beneath the buttons, above the toolbar), as a result custom buttons were created which imply native behaviors such as snap assist are not supported.

To be clear, this engineering choice was made years before MR1, when Win10 was new and we added support for Win10. In addition to the dead space considerations, the decision to go with custom buttons was also influenced by wanting to support tablet mode, where only the [x] button is visible. It seemed simplest at the time to just create our own buttons which mimicked the Win10 ones precisely. It wasn't explicitly reconsidered as part of MR1.

It seems our options are:

  • Reconsider implementation and find a way to support design guidelines and native OS behavior on buttons
  • Adjust design guidelines so that buttons are unchanged when off hover but have a reduced height on hover, leaving a dead space between the toolbar and buttons

From an engineering perspective, I think we need either:

  1. a way to support custom themes and the tablet mode UI, and potentially being able to change the height of the buttons, with natively rendered buttons; or
  2. a way to trigger the Win11 snap layout overlay thingy from our custom caption button

From some quick searches, I can't see a way to change the height of the caption/titlebar buttons from C++ (but maybe my search-fu is lacking), but naively, it seems like returning HTMAXBUTTON from NCHITTEST and similar messages we get from Windows, if the user's mouse/pointer is over the relevant caption button, would potentially work for the second option. Molly, does that sound right?

Flags: needinfo?(mhowell)

(In reply to :Gijs (he/him) from comment #1)

naively, it seems like returning HTMAXBUTTON from NCHITTEST and similar messages we get from Windows, if the user's mouse/pointer is over the relevant caption button, would potentially work for the second option. Molly, does that sound right?

That does seem right, I agree. That's probably the place to start.

Incidentally, I am yet to use this feature at all because nearly every app that I would want to tile also uses custom window controls.

Flags: needinfo?(mhowell)

Is this a duplicate of bug 1718629?

(In reply to Kagami :saschanaz from comment #3)

Is this a duplicate of bug 1718629?

Yep.

Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.