Closed Bug 1856452 Opened 1 year ago Closed 1 year ago

When building with the macOS 14 SDK, windows cannot be moved on macOS 14

Categories

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

task

Tracking

()

RESOLVED FIXED
120 Branch
Tracking Status
firefox120 --- fixed

People

(Reporter: mstange, Assigned: bradwerth)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

When building with the macOS 14 SDK, windows cannot be moved by dragging them. This only affects macOS 14 Sonoma.

This needs to be fixed before we can build Firefox with the macOS 14 SDK (bug 1855564).

See bug 1856296 for when we accidentally shipped this to Nightly.

Copying over my comments from the other bug:

(In reply to Markus Stange [:mstange] from bug 1856296 comment #11)

We implement window dragging by setting up our NSView hierarchy in such a way that the NSViews in the back return YES from movableByWindowBackground, and then we place non-movable transparent NSViews in the non-movable regions of the window (they return NO from movableByWindowBackground). See here for more details.

We also have a hack here to avoid paints which might be causing problems and which might be unnecessary these days.

(In reply to Markus Stange [:mstange] from bug 1856296 comment #12)

When debugging this, I suggest the following approach: First, try to remove the call to ManipulateViewWithoutNeedingDisplay (just call mNonDraggableRegion.UpdateRegion directly). If that doesn't fix it, dump the NSView hierarchy starting at the window's border view ([[window contentView] superview]) along with each view's movableByWindowBackground property. There may also be a NSWindow styleMask flag that affects this behavior.

The macOS 14 AppKit release notes mention a change to clipToBounds:

For applications linked against the macOS 14 SDK, the default value of this property is false. Apps linked against older SDKs default to true.

I wonder if there's a view in our view hierarchy which is not movableByWindowBackground which used to be clipped out and is now not clipped out any more and interferes with the dragging.

This can be fixed very simply by setting clipToBounds on the NonDraggableViews we create in ViewRegion::UpdateRegion. That's not as satisfying as I would like, because it seems to imply that the problem is some kind of view added to one of the NonDraggableView objects, and I don't see where that could be done. I'll post the fix here and we'll discuss in review if we want to push for a better-understood solution.

Or perhaps the container view only respects the bounds of its subviews if those subviews have clipToBounds set, as if it's checking their clip rather than their bounds.

Attachment #9356255 - Attachment description: Bug 1856452: Constrain the clip of NonDraggableView so it can't affect anything outside its bounds. → Bug 1856452: Make NonDraggableView opaque region limited to its bounds.
Pushed by bwerth@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7fc3469f6363 Make NonDraggableView opaque region limited to its bounds. r=mstange
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 120 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: