Closed Bug 1642138 Opened 4 years ago Closed 1 year ago

[macOS] Window menu does not contain "Tile Window to …" and "Move Window to …" items

Categories

(Core :: Widget: Cocoa, defect, P3)

78 Branch
defect

Tracking

()

RESOLVED FIXED
108 Branch
Tracking Status
firefox108 --- fixed

People

(Reporter: adrian, Assigned: spohl)

References

(Blocks 1 open bug, Regressed 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1 Safari/605.1.15

Steps to reproduce:

Open a Firefox window on macOS Catalina and check the "Window" menu.

Actual results:

There are no "Tile Window to Left/Right of Screen" and "Move to [SCREEN]" menu items below the "Zoom" item.

Expected results:

Apps on macOS Catalina automatically get those new menu items to manage the active window but Firefox is missing them. They're the same actions as when you long-click the green zoom button in the title bar but I have shortcuts assigned to them and that only works when they appear in the Window menu.

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → Widget: Cocoa
Product: Firefox → Core
Severity: -- → S3
Priority: -- → P3
Status: UNCONFIRMED → NEW
Ever confirmed: true

I'd like to register my interest in having this feature added - seems like it should be a simple change and the quality of life improvement would be significant. Are there plans to assign or address this soon? If someone can provide advice on the codebase and contribution process I may be willing to do it.

Flags: needinfo?(spohl.mozilla.bugs)

Thank you for offering to contribute. Here is a link to get set up to contribute to our code base: https://firefox-source-docs.mozilla.org/

Flags: needinfo?(spohl.mozilla.bugs)

Not sure if this belongs in this ticket, or to Bug 429824, or Bug 1333781. If I attempt to create custom MacOS keyboard shortcuts to move windows around, those keyboard shortcuts do not work. These are the same commands that would show up in the Window menu item. However if I hover over the title bar green button, those move options do show up there, and work. Commands to move windows, tile windows, or to move windows to other displays won't work via keyboard shortcut.

To replicate:

  1. On MacOS, go to System Preferences > Keyboard > Shortcuts
  2. Select "App Shortcuts"
  3. Click the "+" add button
  4. Add the exact wording of a menu item that would appear in the "Window" menu item, such as "Move Window to Left Side of Screen"
  5. Set the Shortcut to something, such as "Ctrl+Option+Command+Left"
  6. Shortcut works in just about all applications I tested except Firefox

(In reply to basicdays from comment #5)

Not sure if this belongs in this ticket, or to Bug 429824, or Bug 1333781. If I attempt to create custom MacOS keyboard shortcuts to move windows around, those keyboard shortcuts do not work.

These custom shortcuts not working is tracked in bug 1734292.

See Also: → 1734292

I think basicdays might be implying that fixing the one might fix the other.

There's other Window menu commands beyond move left and right that can have shortcuts as well, such as "Move to Built-in Retina Display" or "Move to DELL U3417W", to move windows between displays. Pretty much whatever is dynamically displayed in this Window menu item. I just have a theory that at least these two are related, and that pulling in the MacOS window menu may also allow for pulling in the system's shortcuts for those as well.

(In reply to daniel.d.bower from comment #8)

I think basicdays might be implying that fixing the one might fix the other.

That looks to be the case. Looking into it.

Here is a build that implements this. Feedback is appreciated:
https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/IaqJM7olSM6qYNb_BOk9JQ/runs/0/artifacts/public/build/target.dmg

There are two known issues that I will want to address:

  1. Whenever a window is tiled to the right or left, the respective option in the Window menu is replaced with a new option "Revert". If the user moves or resizes the window, this menu item should reset and make both tiling to the right and left available again. I have only been able to get this hooked up for the case that the user resizes the window, but not when the window is moved yet. I will try to address this during code review.
  2. We do not appear to respond to custom shortcuts until after the Window menu has been opened a first time. This might be an existing bug, but I will need to confirm.
Assignee: nobody → spohl.mozilla.bugs
Status: NEW → ASSIGNED

(In reply to Stephen A Pohl [:spohl] from comment #12)

Here is a build that implements this. Feedback is appreciated:

Just tried out the nightly build. Some feedback:

  1. After clicking on the Window menu, the key controls I set for moving a window left or right did work correctly, which is awesome. Tried changing the shortcut while Firefox was opened and it picked up the new shortcuts too.
  2. I'm not sure which versions of MacOS started to implement Window movement, so I'm not sure if you're checking for that, or if there's a way to query for MacOS capabilities.
  3. I don't personally really use it, but it looks like the "Tile Window" commands aren't showing. I think Bug 1601363 references this particular MacOS feature.
  4. The Window commands to move to different displays isn't available. No idea if there's a way to query the OS for what those commands would be.

Overall tho, at least having the ability to move a window to the left or right of the screen takes care of like 85% of my personal use case. Not sure the portion of folks that use window moving vs tiling though. Thanks for your work on this!

The severity field for this bug is relatively low, S3. However, the bug has 3 duplicates.
:spohl, could you consider increasing the bug severity?

For more information, please visit auto_nag documentation.

Flags: needinfo?(spohl.mozilla.bugs)
Flags: needinfo?(spohl.mozilla.bugs)
Blocks: 1781161
See Also: → 1699936
Attachment #9286699 - Attachment is obsolete: true
Pushed by spohl@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/46538d8cbaf1
Improve integration with the macOS-level Window menu handling to unlock built-in OS functionality such as tiling of windows. r=mstange
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 108 Branch
Regressions: 1799245
Regressions: 1799246
Regressions: 1799247

Backed out 46538d8cbaf1 as per Stephen's request.

Backout link

Status: RESOLVED → REOPENED
Flags: needinfo?(spohl.mozilla.bugs)
Resolution: FIXED → ---
Target Milestone: 108 Branch → ---
Pushed by spohl@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/26128c242c20
Improve integration with the macOS-level Window menu handling to unlock built-in OS functionality such as tiling of windows. r=mstange
Status: REOPENED → RESOLVED
Closed: 1 year ago1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 108 Branch
No longer regressions: 1799247
Flags: needinfo?(spohl.mozilla.bugs)
See Also: → 1786988
See Also: → 1800550
Regressions: 1805692
Regressions: 1806451
Regressions: 1800550
See Also: 1800550
Blocks: 522471
Regressions: 1806592
Regressions: 1807697
Regressions: 1809714
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: